SlideShare una empresa de Scribd logo
Code in the Cloud 1st Edition Mark C. Chu-
Carroll download
https://ebookultra.com/download/code-in-the-cloud-1st-edition-
mark-c-chu-carroll/
Explore and download more ebooks or textbooks
at ebookultra.com
We believe these products will be a great fit for you. Click
the link to download now, or visit ebookultra.com
to discover even more!
Infrastructure as Code Managing Servers in the Cloud 1
(Early Release) Edition Kief Morris
https://ebookultra.com/download/infrastructure-as-code-managing-
servers-in-the-cloud-1-early-release-edition-kief-morris/
Breakers of the Code 1st Edition C. B. Archer
https://ebookultra.com/download/breakers-of-the-code-1st-edition-c-b-
archer/
Cloud Computing and Big Data 1st Edition C. Catlett
https://ebookultra.com/download/cloud-computing-and-big-data-1st-
edition-c-catlett/
Server Driven Web Apps with htmx Any Language Less Code
Simpler Code 1st Edition R. Mark Volkmann
https://ebookultra.com/download/server-driven-web-apps-with-htmx-any-
language-less-code-simpler-code-1st-edition-r-mark-volkmann/
Philosophy in The Twilight Zone 1st Edition Noel Carroll
https://ebookultra.com/download/philosophy-in-the-twilight-zone-1st-
edition-noel-carroll/
Interpreting the National Electrical Code Eighth Edition
Truman C. Surbrook
https://ebookultra.com/download/interpreting-the-national-electrical-
code-eighth-edition-truman-c-surbrook/
Ontology and the Lexicon Chu
https://ebookultra.com/download/ontology-and-the-lexicon-chu/
Speech Coding Algorithms Foundation and Evolution of
Standardized Coders 1st Edition Wai C. Chu
https://ebookultra.com/download/speech-coding-algorithms-foundation-
and-evolution-of-standardized-coders-1st-edition-wai-c-chu/
NEC 2005 Handbook NFPA 70 National Electric Code
International Electrical Code Series Tenth Edition Mark W.
Earley
https://ebookultra.com/download/nec-2005-handbook-nfpa-70-national-
electric-code-international-electrical-code-series-tenth-edition-mark-
w-earley/
Code in the Cloud 1st Edition Mark C. Chu-Carroll
Code in the Cloud 1st Edition Mark C. Chu-Carroll
Digital Instant Download
Author(s): Mark C. Chu-Carroll
ISBN(s): 1934356638
Edition: 1
File Details: PDF, 6.43 MB
Year: 2011
Language: english
Code in the Cloud 1st Edition Mark C. Chu-Carroll
What readers are saying about Code in the Cloud
This is a great book if you want to learn about the cloud and how to
use App Engine. It was nice to see examples in both Python and Java.
Mark does an excellent job of explaining the technologies involved in a
down-to-earth, less-hype–more-facts way that I found engaging. Very
nice read indeed!
Fred Daoud
Author, Stripes: ...and Java Web Development Is Fun Again
and Getting Started with Apache Click
When you think about the distinction between essential and acciden-
tal complexity in web application development, chores like acquiring
server hardware, installing an operating system, and worrying about
how well those infrastructure choices are going to serve your applica-
tion’s needs down the road definitely fall into the latter group. Code
in the Cloud explains how developers can use the services provided by
the Google App Engine platform to write highly flexible and scalable
web-based applications without worrying about a lot of the low-level
deployment details that have plagued developers in the past.
Lyle Johnson
Senior Analyst, Sentar Inc.
Compact, well-commented code, and clear explanations—what more
could a new cloud developer want?
Dorothea Salo
University of Wisconsin–Madison
Code in the Cloud
Programming Google App Engine
Mark C. Chu-Carroll
The Pragmatic Bookshelf
Raleigh, North Carolina Dallas, Texas
Many of the designations used by manufacturers and sellers to distinguish their prod-
ucts are claimed as trademarks. Where those designations appear in this book, and The
Pragmatic Programmers, LLC was aware of a trademark claim, the designations have
been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The
Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g
device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher
assumes no responsibility for errors or omissions, or for damages that may result from
the use of information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team
create better software and have more fun. For more information, as well as the latest
Pragmatic titles, please visit us at http://www.pragprog.com.
The team that produced this book includes:
Editor: Colleen Toporek
Indexing: Sara Lynn Eastler
Copy edit: Kim Wimpsett
Production: Janet Furlow
Customer support: Ellie Callahan
International: Juliet Benda
Copyright © 2011 Pragmatic Programmers, LLC.
All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmit-
ted, in any form, or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without the prior consent of the publisher.
Printed in the United States of America.
ISBN-10: 1-934356-63-8
ISBN-13: 978-1-934356-63-0
Printed on acid-free paper.
P1.0 printing, April, 2011
Version: 2011-4-14
Contents
I Getting Started with Google App Engine 9
1 Introduction 10
1.1 What’s Cloud Computing? . . . . . . . . . . . . . . . 10
1.2 Cloud Computing Programming Systems . . . . . . 16
1.3 Acknowledgments . . . . . . . . . . . . . . . . . . . . 19
2 Getting Started 20
2.1 Setting Up a Google App Engine Account . . . . . . 20
2.2 Setting Up Your Development Environment . . . . . 22
2.3 Starting to Program in Python with App Engine . . 25
2.4 Monitoring Your Application . . . . . . . . . . . . . . 32
II Programming Google App Engine with Python 36
3 A First Real Cloud Application 37
3.1 The Basic Chat Application . . . . . . . . . . . . . . 37
3.2 The Basics of HTTP . . . . . . . . . . . . . . . . . . . 41
3.3 Mapping Chat into HTTP . . . . . . . . . . . . . . . . 45
4 Managing Data in the Cloud 53
4.1 Why Didn’t Chat Work? . . . . . . . . . . . . . . . . . 53
4.2 Making Chat Persistent . . . . . . . . . . . . . . . . . 56
5 Google App Engine Services for Login Authentication 65
5.1 Introducing the Users Service . . . . . . . . . . . . . 65
5.2 The Users Service . . . . . . . . . . . . . . . . . . . . 66
5.3 Integrating the Users Service into Chat . . . . . . . 67
6 Organizing Code: Separating UI and Logic 70
6.1 Getting Started with Templates . . . . . . . . . . . . 70
6.2 Building Related Views with Templates . . . . . . . 75
6.3 Multiple Chat Rooms . . . . . . . . . . . . . . . . . . 81
CONTENTS 6
7 Making the UI Pretty: Templates and CSS 87
7.1 Introducing CSS . . . . . . . . . . . . . . . . . . . . . 88
7.2 Styling Text Using CSS . . . . . . . . . . . . . . . . . 89
7.3 Page Layouts Using CSS . . . . . . . . . . . . . . . . 94
7.4 Building Our Interface Using Flowed Layout . . . . 102
7.5 Including CSS Files in App Engine Applications . . 105
8 Getting Interactive 107
8.1 Interactive Web Services: The Basics . . . . . . . . . 107
8.2 The Model-View-Controller Design Pattern . . . . . 110
8.3 Talking to the Server without Disruption . . . . . . 113
8.4 References and Resources . . . . . . . . . . . . . . . 121
III Programming Google App Engine with Java 122
9 Google App Engine and Java 123
9.1 Introducing GWT . . . . . . . . . . . . . . . . . . . . 125
9.2 Getting Started with Java and GWT . . . . . . . . . 127
9.3 RPC in GWT . . . . . . . . . . . . . . . . . . . . . . . 135
9.4 Testing and Deploying with GWT . . . . . . . . . . . 140
10 Managing Server-Side Data 141
10.1 Data Persistence in Java . . . . . . . . . . . . . . . . 141
10.2 Storing Persistent Objects in GWT . . . . . . . . . . 145
10.3 Retrieving Persistent Objects in GWT . . . . . . . . . 149
10.4 Gluing the Client and the Server Together . . . . . . 151
10.5 References and Resources . . . . . . . . . . . . . . . 153
11 Building User Interfaces in Java 154
11.1 Why Use GWT? . . . . . . . . . . . . . . . . . . . . . 154
11.2 Building GWT UIs with Widgets . . . . . . . . . . . . 155
11.3 Making the UI Active: Handling Events . . . . . . . 162
11.4 Making the UI Active: Updating the Display . . . . . 167
11.5 Wrapping Up with GWT . . . . . . . . . . . . . . . . 169
11.6 References and Resources . . . . . . . . . . . . . . . 170
12 Building the Server Side of a Java Application 171
12.1 Filling in Gaps: Supporting Chat Rooms . . . . . . . 171
12.2 Proper Interactive Design: Being Incremental . . . . 176
12.3 Updating the Client . . . . . . . . . . . . . . . . . . . 184
12.4 Chat Administration . . . . . . . . . . . . . . . . . . 185
Report erratum
this copy is (P1.0 printing, April, 2011)
Download from Wow! eBook <www.wowebook.com>
CONTENTS 7
12.5 Running and Deploying the Chat Application . . . . 187
12.6 Wrapping Up the Server Side . . . . . . . . . . . . . 189
IV Advanced Google App Engine 190
13 Advanced Datastore: Property Types 191
13.1 Building a Filesystem Service . . . . . . . . . . . . . 191
13.2 Modeling the Filesystem: A First Cut . . . . . . . . . 195
13.3 Property Types Reference . . . . . . . . . . . . . . . . 212
13.4 Wrapping Up Property Types . . . . . . . . . . . . . 215
14 Advanced Datastore: Queries and Indices 216
14.1 Indices and Queries in Datastore . . . . . . . . . . . 217
14.2 More Flexible Models . . . . . . . . . . . . . . . . . . 223
14.3 Transactions, Keys, and Entity Groups . . . . . . . 224
14.4 Policy and Consistency Models . . . . . . . . . . . . 226
14.5 Incremental Retrieval . . . . . . . . . . . . . . . . . . 230
15 Google App Engine Services 232
15.1 The Memcache Service . . . . . . . . . . . . . . . . . 233
15.2 Accessing Other Stuff: The URL Fetch Service . . . 238
15.3 Communicating with People: Mail and Chat Services 239
15.4 Sending and Receiving Email . . . . . . . . . . . . . 243
15.5 Wrapping Up Services . . . . . . . . . . . . . . . . . 246
16 Server Computing in the Cloud 248
16.1 Scheduling Jobs with App Engine Cron . . . . . . . 249
16.2 Running Jobs Dynamically Using the Task Queue . 253
16.3 Wrapping Up Server Computing . . . . . . . . . . . . 259
17 Security in App Engine Services 260
17.1 What Is Security? . . . . . . . . . . . . . . . . . . . . 260
17.2 Basic Security . . . . . . . . . . . . . . . . . . . . . . 261
17.3 Advanced Security . . . . . . . . . . . . . . . . . . . 269
18 Administering Your App Engine Deployment 277
18.1 Monitoring . . . . . . . . . . . . . . . . . . . . . . . . 277
18.2 Peeking at the Datastore . . . . . . . . . . . . . . . . 281
18.3 Logs and Debugging . . . . . . . . . . . . . . . . . . 282
18.4 Managing Your Application . . . . . . . . . . . . . . 284
18.5 Paying for What You Use . . . . . . . . . . . . . . . . 285
Report erratum
this copy is (P1.0 printing, April, 2011)
Download from Wow! eBook <www.wowebook.com>
CONTENTS 8
19 Wrapping Up 287
19.1 Cloud Concepts . . . . . . . . . . . . . . . . . . . . . 287
19.2 Google App Engine Concepts . . . . . . . . . . . . . 288
19.3 Where to Go from Here . . . . . . . . . . . . . . . . . 290
19.4 References and Resources . . . . . . . . . . . . . . . 292
Index 293
Report erratum
this copy is (P1.0 printing, April, 2011)
Download from Wow! eBook <www.wowebook.com>
Part I
Getting Started with Google
App Engine
Download from Wow! eBook <www.wowebook.com>
Chapter 1
Introduction
Cloud computing is an innovative and exciting style of programming
and using computers. It creates tremendous opportunities for software
developers: cloud computing can provide an amazing new platform for
building new kinds applications. In this chapter, we’ll look at the basic
concepts: what cloud computing is, when and why you should use it,
and what kinds of cloud-based services are available to you as an appli-
cation developer.
1.1 What’s Cloud Computing?
Before we look at how to write cloud programs with Google App Engine,
let’s start at the very beginning and ask just what we mean by cloud
computing? What is the cloud? How is it different from desktop comput-
ing or old-fashioned client-server computing? And most importantly,
why should you, as a software developer, care about the cloud? When
should you use it, and what should you use it for?
The Cloud Concept
In the modern world of the Internet and the World Wide Web, there
are thousands upon thousands of computers sitting in data centers,
scattered around the world. We use those computers constantly—for
chatting with other people, sending email, playing games, and reading
and writing blogs. When we’re doing one of these everyday activities,
we’re accessing a program running on a server, using our browser as a
client.
But where is the program actually running? Where is the data? Where
are the servers? They’re somewhere out there, somewhere in some
Download from Wow! eBook <www.wowebook.com>
WHAT’S CLOUD COMPUTING? 11
data center, somewhere in the world. You don’t know where, and more
importantly, you don’t care; there’s absolutely no reason for you to care.
What matters to you is that you can get to the program and the data
whenever you need to.
Let’s look at a simple example. A few years ago, I started writing a blog.
(The blog has since moved, but it’s still a good example.) When I got
started, I used Google’s Blogger service to write it. Every day, I would
open up my web browser, go to http://goodmath.blogspot.com/admin, and
start writing. When I finished, I’d click on the Post button, and the blog
post would appear to all of my readers. From my point of view, it just
worked. All I needed was my web browser and the URL, and I could
write my blog.
Behind the scenes, Blogger is a complex piece of software run by Google
in one of its data centers. It hosts hundreds of thousands of blogs, and
those blogs are read by millions of users every day. When you look at
it this way, it’s obvious that the software behind Blogger is running on
lots of computers. How many? We don’t know. In fact, it’s probably not
even a fixed number—when not many people are accessing it, it doesn’t
need to be running on as many machines; when more people start using
it, it needs more machines. The number of machines running it varies.
But from the user’s point of view—whether that user is a blog author or
a blog reader—none of that matters. Blogger is a service, and it works.
When I want to write a post, I can go to Blogger and write it, and when
people go to my blog’s web page, they can read it.
That’s the fundamental idea of the cloud: programs and data are on a
computer somewhere out there, and you neither know nor care where
that computer is.
Why call this collection of resources a cloud? A cloud is a huge collec-
tion of tiny droplets of water. Some of those droplets fall on my yard,
providing the trees and the lawn with water; some run off into the reser-
voir from which my drinking water comes. And the clouds themselves
grow from evaporated water, which comes from all over the place. All I
want is enough water in my yard to keep the plants alive and enough
in the reservoir so that I have something to drink. I don’t care which
cloud brings the rain; it’s all the same to me. I don’t care where on
earth that water came from. It’s all just water—the particular drops are
pretty much exactly the same, and I can’t tell the difference. As long as
I get enough, I’m happy.
Report erratum
this copy is (P1.0 printing, April, 2011)
Download from Wow! eBook <www.wowebook.com>
WHAT’S CLOUD COMPUTING? 12
So think about the various data centers around the world where compa-
nies have swarms of computers—as clouds. Lots of the biggest players
in network computing, including Google, Amazon, Microsoft, IBM, and
Yahoo, all have thousands of machines connected to networks running
all sorts of software. Each of those centers is a cloud, and each pro-
cessor, each disk drive, is a droplet of water in that cloud. In the cloud
world, when you write a program, you don’t know what computer it’s
going to run on. You don’t know where the disks that store the data are,
and you don’t need to care. You just need to know how many droplets
you need.
Cloud to the Developer
Cloud computing is a fundamental change from how computers and
software have worked in the past. Traditionally, if you wanted to run
an application, you went out and bought a computer and software,
set it up on your own premises, and ran your program. You needed
to pick out which operating system you were going to run, handle the
installation of your software, and maintain your computer—keeping
track of software upgrades, security, backups, and so on.
With cloud computing, you don’t do any of that. If you’re a user of the
cloud, you buy access to the application you want and then connect
to it from anywhere. Installing the software, maintaining the hardware
and software where the application runs, making sure that the data is
kept safe and secure—none of that is your concern. In the cloud, you
buy software as a service. If you need more storage than a typical user,
you buy extra storage from the service provider. If that means buying
and installing a new disk drive, that’s up to the provider. You just buy
storage-as-a-service from them: how they provide it is their problem.
You tell them what you need—in both the physical sense (“I need 1TB of
storage.”) and in less tangible quality-of-service senses (“I need to guar-
antee that my storage is transactional, so that after I commit a change,
data will never be lost.”). You tell them your requirements, and some
cloud provider will sell you a service that meets those requirements.
What this means is that when you’re developing for the cloud, instead
of buying a computer and running software on it, you break things
down to basic building blocks, buy those pieces from service providers,
and put them together however you want to build a system.
The building blocks are the resources you need to run a program or to
perform a task. Resources include things like processing time, network
Report erratum
this copy is (P1.0 printing, April, 2011)
Download from Wow! eBook <www.wowebook.com>
WHAT’S CLOUD COMPUTING? 13
bandwidth, disk storage, and memory. As a user of the cloud, you don’t
need to be concerned about where these resources are located. You
know what you need, and you buy that from whoever can provide it to
you most conveniently.
For developers, cloud computing introduces an even bigger change.
When you develop for the cloud, you’re not building a piece of software
to sell to your customers—you’re building a service for your customers
to use. Understanding that difference is crucial: you need to design
your application around the idea that it’s a service you’re going to pro-
vide to users, not a standalone application that they’re going to install
on their computers. Your customers are going to choose a service based
on the tasks they want to accomplish, so your application needs to be
designed with the task in mind, and you must provide it in the most
flexible way possible.
For example, if you want to build a to-do list application for a desk-
top computer, it’s a fairly straightforward process. There are lots of
variations in how you can arrange the UI, but the basic idea of what
you’re building is obvious. You would build one UI—after all, why would
you need more than one? And you’d build it mainly for a single user.
If you are developing this to-do list application for the cloud, though,
you’d want multiple UIs: at the very least, you’d want one UI for people
accessing your service using their desktop computer and one for people
using a mobile browser on a cell phone. You’d probably want to provide
an open interface that other people could use for building clients for
other devices. And you’d need to design it for multiple users; if you put
an application in the cloud, there’s only one program, but it can be
used by lots of people. So you need to design it around the assumption
that even if users never work together using your application, it’s still a
multi-user system.
For developers, the most exciting aspect of cloud computing is its scala-
bility. When you’re developing in the cloud, you can write a simple pro-
gram to be used by one or two people—and then, without ever changing
a line of code, that program can scale up to support millions of users.
The program is scale-neutral: you write it so it will work equally well
for one dozen users or one million users. As you get more users, all you
need to do is buy more resources—and your program will just work.
You can start with a simple program running on one server somewhere
in the cloud and scale up by adding resources until you’ve got millions
of users.
Report erratum
this copy is (P1.0 printing, April, 2011)
Download from Wow! eBook <www.wowebook.com>
WHAT’S CLOUD COMPUTING? 14
Cloud versus Client-Server
In many ways, the basic style of development for cloud-based software
is similar to programming for client-server computing. Both are based
on the idea that you don’t really run programs on your own computer.
Your computer provides a window into an application, but it doesn’t run
the application itself. Instead of running the program on your computer,
all you do on your own computer is run some kind of user interface.
The real program is running somewhere else on a computer called a
server. You use the server because, for whatever reason, the resources
necessary to run the program aren’t available on your local computer:
it’s cheaper, faster, or more convenient to run the program somewhere
else where the necessary resources are easy to obtain.
The big difference between cloud and client-server development is in
what you know: in traditional client-server systems, you might have
a specific computer that is your server, and that’s where your stuff
is running. The computer may not be sitting on your desk in front of
you, but you know where it is. For example, when I was in college, one
of the first big computers I used was a VAX 11/780 nicknamed “Gold.”
Gold lived in the Rutgers university computing lab in Hill Center. I used
Gold pretty much daily for at least a year before I actually got to see it.
The data center had at least thirty other computers: several DEC 20s,
a couple of Pyramids, an S/390, and a bunch of Suns. But of those
machines, I specifically used Gold. Every program that I wrote, I wrote
specifically to run on Gold, and that’s the only place that I could run it.
In the cloud, you aren’t confined to a specific server. You have com-
puting resources—that is, someone is renting you a certain amount
of computation on some collection of computers somewhere. You don’t
know where they are; you don’t know what kind of computers they are.
You could have two massive machines with 32 processors each and 64
gigabytes of memory; or they could be 64 dinky little single-processor
machines with 2 gigabytes of memory. The computers where you run
your program could have great big disks of their own, or they could be
diskless machines accessing storage on dedicated storage servers. To
you, as a user of the cloud, that doesn’t matter. You’ve got the resources
you pay for, and where they are makes no difference as long as you get
what you need.
Report erratum
this copy is (P1.0 printing, April, 2011)
Download from Wow! eBook <www.wowebook.com>
WHAT’S CLOUD COMPUTING? 15
When to Develop for the Cloud
So now you know what the cloud is. It’s a revolutionary way of thinking
about computing; it’s a universe of servers that you can build an appli-
cation on; it’s a world of services that you can build or that you can use
to build other things. Now, the question is, when should you use it?
You can write almost any application you want in the cloud. In fact,
many people strongly believe that everything should be in the cloud—
that there’s no longer any reason to develop applications for standalone
personal computers. I don’t go quite that far: many applications are well
suited to the cloud, but that doesn’t mean that it’s the ideal platform
for everything. You can build anything as a service in the cloud, but it
might be a lot harder than developing it as a standalone application.
There are three kinds of applications that it makes sense to build in the
cloud:
Collaborative applications.
If the application you’re building will be used by groups of people
to work together, share data, communicate, or collaborate, then
you really should build that application in the cloud. Collaboration
is the cloud’s natural niche.
Services.
If you ask, “What does my application do?” and the most natural
answer sounds like a service, then you’re looking at a cloud appli-
cation. The difference between an application and a service can
be subtle—you can describe almost anything as a service. The key
question here is what’s the most natural description of it? If you
want to describe the desktop iTunes application, you could say,
“It lets people manage their music collections,” which does sound
service-like. But it leaves out the key property of what the iTunes
desktop application does: it manages a collection of music files
on the users’ computers and lets them sync that music with their
iPods using a serial cable. Described the latter way, it’s clear that
it’s a desktop application, not a cloud application.
On the other hand, if you take a look at something like eMusic,
you’ll come to a different conclusion. eMusic is a subscription-
based website that lets users browse an enormous collection of
music and buy a certain number of songs per month. eMusic is
clearly a service: it lets people search through a library of hun-
dreds of thousands of musical tracks, providing them with the
Report erratum
this copy is (P1.0 printing, April, 2011)
Download from Wow! eBook <www.wowebook.com>
Random documents with unrelated
content Scribd suggests to you:
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Fern.
La ley
De esclavo.
¿Quién la hizo?
El Rey.
¿Por qué?
Porque suyo soy.
¿Pues no te ha estimado hoy?
Y tambien me ha aborrecido.
¿Un dia posible ha sido
A desunir dos estrellas?
Para presumir por ellas,
Las flores habrán venido.
Estas, que fueron pompa y alegría
Despertando al albor de la mañana,
A la tarde serán lástima vana,
Durmiendo en brazos de la noche fria.
Este matiz, que al cielo desafía,
Iris listado de oro, nieve y grana,
Será escarmiento de la vida humana:
¡Tanto se emprende en término de un dia!
A florecer las rosas madrugaron,
Y para envejecerse florecieron:
Cuna y sepulcro en un boton hallaron.
Tales los hombres sus fortunas vieron:
En un dia nacieron y espiraron;
Que pasados los siglos, horas fueron.
Horror y miedo me has dado,
Ni oirte ni verte quiero;
Sé el desdichado primero
De quien huye un desdichado.
¿Y las flores?
Si has hallado
Jeroglíficos en ellas,
Deshacellas y rompellas
Sólo sabrán mis rigores.
¿Qué culpa tienen las flores?
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
Parecerse á las estrellas.
¿Ya no las quieres?
Ninguna
Estimo en su rosicler.
¿Cómo?
Nace la mujer
Sujeta á muerte y fortuna;
Y en esta estrella importuna
Tasada mi vida ví.
¿Flores con estrellas?
Sí.
Aunque sus rigores lloro,
Esa propiedad ignoro.
Escucha, sabráslo.
Dí.
Esos rasgos de luz, esas centellas
Que cobran con amagos superiores
Alimentos del sol en resplandores,
Aquello viven que se duele dellas.
Flores nocturnas son; aunque tan bellas,
Efímeras padecen sus ardores;
Pues si un dia es el siglo de las flores,
Una noche es la edad de las estrellas.
De esa, pues, primavera fugitiva
Ya nuestro mal, ya nuestro bien se infiere:
Registro es nuestro, ó muera el sol ó viva.
¿Qué duracion habrá que el hombre espere,
O qué mudanza habrá, que no reciba
De astro, que cada noche nace y muere?
(Vanse Fénix, Zara y Rosa.)
ESCENA XV.
MULEY.—DON FERNANDO.
Muley.
D. Fern.
Muley.
D. Fern.
Muley.
A que se ausentase Fénix
En esta parte esperé;
Que el águila más amante
Huye de la luz tal vez.
¿Estamos solos?
Sí.
Escucha.
¿Qué quieres, noble Muley?
Que sepas que hay en el pecho
De un moro lealtad y fe.
No sé por dónde empezar
A declararme, ni sé
Si diga cuánto he sentido
Este inconstante desden
Del tiempo, este estrago injusto
De la suerte, este cruel
Ejemplo del mundo, y este
De la fortuna vaiven.
Pero á riesgo estoy, si aquí
Hablar contigo me ven;
Que tratarte sin respeto
Es ya decreto del Rey.
Y así, á mi dolor dejando
La voz, que él podrá más bien
Explicarse como esclavo,
Vengo á arrojarme á esos piés.
Yo lo soy tuyo, y así
No vengo, Infante, á ofrecer
Mi favor, sino á pagar
Deuda que un tiempo cobré.
La vida que tú me diste,
Vengo á darte; que hacer bien
Es tesoro que se guarda
Para cuando es menester.
Y porque el temor me tiene
Con grillos de miedo al pié,
Y está mi pecho y mi cuello
Entre el cuchillo y cordel,
Quiero, acortando discursos,
Declararme de una vez.
Y así digo, que esta noche
Tendré en el mar un bajel
Prevenido; en las troneras
De las mazmorras pondré
Instrumentos, que desarmen
Las prisiones que teneis.
Luégo, por parte de afuera,
Los candados romperé:
Tú con todos los cautivos,
Que Fez encierra hoy en él,
Vuelve á tu patria, seguro
De que yo lo quedo en Fez;
Pues es fácil el decir
Que ellos pudieron romper
La prision; y así los dos
Habremos librado bien,
Yo el honor y tú la vida;
Pues es cierto que á saber
El Rey mi intento, me diera
Por traidor con justa ley,
Que no sintiera el morir.
Y porque son menester
Para granjear voluntades
Dineros, aquí se ve
A estas joyas reducido
Innumerable interes.
Este es, Fernando, el rescate
De mi prision, esta es
La obligacion que te tengo;
Que un esclavo noble y fiel
Tan inmenso bien habia
De pagar alguna vez.
D. Fern.
Muley.
D. Fern.
Muley.
D. Fern.
Rey.
Muley.
Rey.
Muley.
Rey.
Muley.
Rey.
Agradecerte quisiera
La libertad; pero el Rey
Sale al jardin.
¿Hate visto
Conmigo?
No.
Pues no des
Que sospechar.
Destos ramos
Haré rústico cancel,
Que me encubra miéntras pasa. (Escóndese.)
ESCENA XVI.
EL REY.—MULEY.
(Ap. ¿Con tal secreto Muley
Y Fernando? ¿Y irse el uno
En el punto que me ve,
Y disimular el otro?
Algo hay aquí que temer.
Sea cierto, ó no sea cierto,
Mi temor procuraré
Asegurar.) Mucho estimo...
Gran señor, dáme tus piés.
Hallarte aquí.
¿Qué me mandas?
Mucho he sentido el no ver
A Ceuta por mia.
Conquista,
Coronado de laurel,
Sus muros; que á tu valor
Mal se podrá defender.
Con más doméstica guerra
Muley.
Rey.
Muley.
Rey.
Muley.
Rey.
Muley.
Se ha de rendir á mis piés.
¿De qué suerte?
Desta suerte:
Con abatir y poner
A Fernando en tal estado,
Que él mismo á Ceuta me dé.
Sabrás, pues, Muley amigo,
Que yo he llegado á temer
Que del Maestre la persona
No está muy segura en Fez.
Los cautivos, que en estado
Tan abatido le ven,
Se lastiman, y recelo
Que se amotinen por él.
Fuera desto, siempre ha sido
Poderoso el interes;
Que las guardas con el oro
Son fáciles de romper.
(Ap. Yo quiero apoyar agora
Que todo esto puede ser,
Porque de mí no se tenga
Sospecha.) Tú temes bien,
Fuerza es que quieran librarle.
Pues sólo un remedio hallé,
Porque ninguno se atreva
A atropellar mi poder.
¿Y es, señor?
Muley, que tú
Le guardes, y á cargo esté
Tuyo; á tí no ha de torcerte
Ni el temor ni el interes.
Alcaide eres del Infante,
Procura el guardarle bien;
Porque en cualquiera ocasion
Tú me has de dar cuenta dél. (Vase.)
Sin duda alguna que oyó
D. Fern.
Muley.
D. Fern.
Muley.
D. Fern.
Nuestros conciertos el Rey.
¡Válgame Alá!
ESCENA XVII.
DON FERNANDO.—MULEY.
¿Qué te aflige?
¿Has escuchado?
Muy bien.
¿Pues para qué me preguntas
Qué me aflige, si me ves
En tan ciega confusion,
Y entre mi amigo y el Rey,
El amistad y el honor
Hoy en batalla se ven?
Si soy contigo leal,
He de ser traidor con él;
Ingrato seré contigo,
Si con él me juzgo fiel.
¿Qué he de hacer (¡valedme, cielos!),
Pues al mismo que llegué
A rendir la libertad,
Me entrega, para que esté
Seguro en mi confianza?
¿Qué he de hacer si ha echado el Rey
Llave maestra al secreto?
Mas para acertarlo bien,
Te pido que me aconsejes:
Díme tú qué debo hacer.
Muley, amor y amistad
En grado inferior se ven
Con la lealtad y el honor.
Nadie iguala con el Rey;
Muley.
D. Fern.
Muley.
El solo es igual consigo:
Y así mi consejo es
Que á él le sirvas y me faltes.
Tu amigo soy; y porque
Esté seguro tu honor,
Yo me guardaré tambien;
Y aunque otro llegue á ofrecerme
Libertad, no acetaré
La vida, porque tu honor
Conmigo seguro esté.
Fernando, no me aconsejas
Tan leal como cortés.
Sé que te debo la vida,
Y que pagártela es bien;
Y así lo que está tratado,
Esta noche dispondré.
Líbrate tú, que mi vida
Se quedará á padecer
Tu muerte: líbrate tú,
Que nada temo despues.
¿Y será justo que yo
Sea tirano y cruel
Con quien conmigo es piadoso,
Y mate al honor cruel
Que á mí me está dando vida?
No, y así te quiero hacer
Juez de mi causa y mi vida:
Aconséjame tambien.
¿Tomaré la libertad
De quien queda á padecer
Por mí? ¿Dejaré que sea
Uno con su honor cruel,
Por ser liberal conmigo?
¿Qué me aconsejas?
No sé;
Que no me atrevo á decir
D. Fern.
Sí ni no: el no, porque
Me pesará que lo diga;
Y el sí, porque echo de ver
Si voy á decir que sí,
Que no te aconsejo bien.
Sí aconsejas, porque yo,
Por mi Dios y por mi ley,
Seré un príncipe constante
En la esclavitud de Fez.
Muley.
Rey.
Muley.
Rey.
Muley.
Rey.
Muley.
Rey.
Muley.
JORNADA TERCERA.
Sala de una quinta del rey moro.
ESCENA PRIMERA.
MULEY, EL REY.
(Ap. Ya que socorrer no espero,
Por tantas guardas del Rey,
A Don Fernando, hacer quiero
Sus ausencias, que esta es ley
De un amigo verdadero.)
Señor, pues yo te serví
En tierra y mar, como sabes,
Si en tu gracia merecí
Lugar, en penas tan graves
Atento me escucha.
Dí.
Fernando...
No digas más.
¿Posible es que no me oirás?
No, que diciendo Fernando,
Ya me ofendes.
¿Cómo, ó cuándo?
Como ocasion no me das
De hacer lo que me pidieres,
Cuando me ruegas por él.
¿Si soy su guarda, no quieres,
Señor, que dé cuenta dél?
Rey.
Muley.
Dí; pero piedad no esperes.
Fernando, cuya importuna
Suerte, sin piedad alguna
Vive, á pesar de la fama,
Tanto que el mundo le llama
El monstruo de la fortuna,
Examinando el rigor,
Mejor dijera el poder
De tu corona, señor,
Hoy á tan mísero sér
Le ha traido su valor,
Que en un lugar arrojado,
Tan humilde y desdichado,
Que es indigno de tu oido,
Enfermo, pobre y tullido,
Piedad pide al que ha pasado;
Porque como le mandaste
Que en la mazmorra durmiese,
Que en los baños trabajase,
Que tus caballos curase
Y nadie á comer le diese,
A tal extremo llegó,
Como era su natural
Tan flaco, que se tulló;
Y así la fuerza del mal
Brío y majestad rindió.
Pasando la noche fria
En una mazmorra dura,
Constante en su fe porfía;
Y al salir la lumbre pura
Del sol, que es padre del dia,
Los cautivos (¡pena fiera!)
En una mísera estera
Le ponen en tal lugar,
Que es, ¿dirélo? un muladar;
Porque es su olor de manera,
Rey.
Que nadie puede sufrille
Junto á su casa; y así
Todos dan en despedílle,
Y ha venido á estar allí
Sin hablalle y sin oílle,
Ni compadecerse dél.
Sólo un criado y un fiel
Caballero en pena extraña
Le consuela y acompaña.
Estos dos parten con él
Su porcion, tan sin provecho,
Que para uno solo es poca;
Pues cuando los labios toca,
Se suele pasar al pecho
Sin que lo sepa la boca;
Y áun á estos dos los castiga
Tu gente, por la piedad
Que al dueño á servir obliga;
Mas no hay rigor ni crueldad,
Por más que ya los persiga,
Que dél los pueda apartar.
Miéntras uno va á buscar
De comer, el otro queda
Con quien consolarse pueda
De su desdicha y pesar.
Acaba ya rigor tanto:
Tén del Príncipe, señor,
Puesto en tan fiero quebranto,
Ya que no piedad, horror;
Asombro, ya que no llanto.
Bien está, Muley.
ESCENA II.
É
Fénix.
Rey.
Fénix.
Rey.
Fénix.
Rey.
FÉNIX.—Dichos.
Señor,
Si ha merecido en tu amor
Gracia alguna mi humildad,
Hoy á vuestra Majestad,
Vengo á pedir un favor.
¿Qué podré negarte á tí?
Fernando el Maestre...
Está bien;
Ya no hay que pasar de ahí.
Horror da á cuantos le ven
En tal estado; de tí
Sólo merecer quisiera...
¡Detente, Fénix, espera!
¿Quién á Fernando le obliga
Para que su muerte siga,
Para que infelice muera?
Si por ser cruel y fiel
A su fe, sufre castigo
Tan dilatado y cruel,
Él es el cruel consigo,
Que yo no lo soy con él.
¿No está en su mano el salir
De su miseria, y vivir?
Pues eso en su mano está,
Entregue á Ceuta, y saldrá
De padecer y sentir
Tantas penas y rigores.
ESCENA III.
CELIN.—Dichos.
Celin.
Fénix.
Muley.
Rey.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Licencia aguardan que des,
Señor, dos embajadores:
De Tarudante uno es,
Y el otro del portugues
Alfonso.
(Ap.) ¿Hay penas mayores?
Sin duda que por mí envía
Tarudante.
(Ap.) Hoy perdí, cielos,
La esperanza que tenía.
Mátenme amistad y celos,
Todo lo perdí en un dia.
Entren, pues. En este estrado (Vase Celin.)
Conmigo te asienta, Fénix. (Siéntanse.)
ESCENA IV.
DON ALFONSO y TARUDANTE, cada uno por su parte.
—Dichos.
Generoso rey de Fez...
Rey de Fez altivo y fuerte...
Cuya fama...
Cuya vida...
Nunca muera...
Viva siempre...
(A Fénix.) Y tú de aquel sol aurora...
Tú de aquel ocaso oriente...
A pesar de siglos dures...
A pesar de tiempos reines...
Porque tengas...
Porque goces...
Felicidades...
Laureles...
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
Rey.
Tarud.
D. Alf.
Altas dichas...
Triunfos grandes...
Pocos males...
Muchos bienes...
¿Cómo miéntras hablo yo,
Tú, cristiano, á hablar te atreves?
Porque nadie habla primero
Que yo, donde yo estuviere.
A mí, por ser de nacion
Alarbe, el lugar me deben
Primero; que los extraños
Donde hay propios, no prefieren.
Donde saben cortesía,
Sí hacen; pues vemos siempre
Que dan en cualquiera parte
El mejor lugar al huésped.
Cuando esa razon lo fuera,
Aun no pudiera vencerme;
Porque el primero lugar
Sólo se le debe al huésped.
Ya basta, y los dos ahora
En mis estrados se sienten.
Hable el portugues, que en fin
Por de otra ley se le debe
Más honor.
(Ap.) Corrido estoy.
Ahora yo seré breve:
Alfonso de Portugal,
Rey famoso, á quien celebre
La fama en lenguas de bronce
A pesar de envidia y muerte,
Salud te envía, y te ruega
Que pues libertad no quiere
Fernando, como su vida
La ciudad de Ceuta cueste,
Que reduzcas su valor
Tarud.
Hoy á cuantos intereses
El más avaro codicie,
El más liberal desprecie;
Y que dará en plata y oro
Tanto precio como pueden
Valer dos ciudades. Esto
Te pide amigablemente;
Pero si no se le entregas,
Que ha de librarle promete
Por armas, á cuyo efecto
Ya sobre la espalda leve
Del mar ciudades fabrica
De mil armados bajeles;
Y jura que á sangre y fuego
Ha de librarle y vencerte,
Dejando aquesta campaña
Llena de sangre, de suerte,
Que cuando el sol se levante
Halle los matices verdes
Esmeraldas, y los pierda
Rubíes cuando se acueste.
Aunque como embajador
No me toca responderte,
En cuanto toca á mi Rey,
Puedo, cristiano, atreverme,
Porque ya es suyo este agravio,
Como hijo que obedece
Al Rey mi señor; y así
Decir de su parte puedes
A Don Alfonso, que venga,
Porque en término más breve
Que hay de la noche á la aurora,
Vea en púrpura caliente
Agonizar estos campos,
Tanto que los cielos piensen
Que se olvidaron de hacer
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Tarud.
D. Alf.
Rey.
D. Alf.
Otras flores que claveles.
Si fueras, moro, mi igual,
Pudiera ser que se viese
Reducida esta victoria
A dos jóvenes valientes;
Mas díle á tu Rey que salga
Si ganar fama pretende;
Que yo haré que salga el mio.
Casi has dicho que lo eres,
Y siendo así, Tarudante
Sabrá tambien responderte.
Pues en campaña te espero.
Yo haré que poco me esperes,
Porque soy rayo.
Yo viento.
Volcan soy que llamas vierte.
Hidra soy que fuego arroja.
Yo soy furia.
Yo soy muerte.
¿Que no te espantes de oirme?
¿Que no te mueras de verme?
Señores, vuestras Altezas,
Ya que los enojos pueden
Correr al sol las cortinas
Que le embozan y oscurecen,
Adviertan que en tierra mia
Campo aplazarse no puede
Sin mí; y así yo le niego,
Para que tiempo me quede
De serviros.
No recibo
Yo hospedaje ni mercedes
De quien recibo pesares.
Por Fernando vengo: el verle
Me obligó á llegar á Fez
Disfrazado desta suerte:
Á
Rey.
D. Alf.
Tarud.
Fénix.
Muley.
Ántes de entrar en tu corte
Supe que á esta quinta alegre
Asistias; y así vine
A hablarte, porque fin diese
La esperanza que me trajo;
Y pues tan mal me sucede,
Advierte, señor, que solo
La respuesta me detiene.
La respuesta, rey Alfonso,
Será compendiosa y breve:
Que si no me das á Ceuta,
No hayas miedo que le lleves.
Pues ya he venido por él,
Y he de llevarle: prevente
Para la guerra que aplazo.—
Embajador, ó quien eres,
Véamonos en la campaña.
¡Hoy toda el África tiemble! (Vase.)
ESCENA V.
EL REY, FÉNIX, MULEY, TARUDANTE.
Ya que no pude lograr
La fineza, hermosa Fénix,
De serviros como esclavo,
Logre al ménos la de verme
A vuestros piés. Dad la mano
A quien un alma os ofrece.
Vuestra Alteza, gran señor,
Finezas y honras no aumente
A quien le estima, pues sabe
Lo que á sí mismo se debe.
(Ap.) ¿Qué espera quien esto llega
Rey.
Tarud.
Rey.
Tarud.
Rey.
A ver y no se da muerte?
Ya que vuestra Alteza vino
A Fez impensadamente,
Perdone del hospedaje
La cortedad.
No consiente
Mi ausencia más dilacion
Que la de un plazo muy breve;
Y supuesto que venía
Mi embajador con poderes
Para llevar á mi esposa,
Como tú dispuesto tienes,
No, por haberlo yo sido,
Mi fineza desmerece
La brevedad de la dicha.
En todo, señor, me vences;
Y así por pagar la deuda,
Como porque se previenen
Tantas guerras, es razon
Que desocupado quede
Destos cuidados; y así
Volverte luégo conviene
Ántes que ocupen el paso
Las amenazadas huestes[8]
De Portugal.
Poco importa,
Porque yo vengo con gente
Y ejército numeroso,
Tal, que esos campos parecen
Más ciudades que desiertos,
Y volveré brevemente
Con ella á ser tu soldado.
Pues luégo es bien que se apreste
La jornada; pero en Fez
Será bien, Fénix, que entres
A alegrar á esa ciudad.
Muley.
Rey.
Muley.
D. Fern.
Muley.
Gran señor.
Prevente,
Que con la gente de guerra
Has de ir sirviendo á Fénix,
Hasta que quede segura,
Y con su esposo la dejes.
(Ap.) Esto sólo me faltaba,
Para que, estando yo ausente,
Aun le falte mi socorro
A Fernando, y no le quede
Esta pequeña esperanza. (Vanse.)
. . . . . . . . . . . . [9]
Una calle de Fez.
ESCENA VI.
DON JUAN, BRITO, y otros CAUTIVOS, que sacan á DON
FERNANDO, y le sientan en una estera.
Ponedme en aquesta parte,
Para que goce mejor
La luz que el cielo reparte.—
¡Oh inmenso, oh dulce Señor,
Qué de gracias debo darte!
Cuando como yo se vía
Job, el dia maldecia;
Mas era por el pecado
En que habia sido engendrado;
Pero yo bendigo el dia
Por la gracia que nos da
Brito.
D. Fern.
Caut. 1.º
D. Fern.
Caut. 2.º
Caut. 3.º
D. Fern.
D. Juan.
D. Fern.
D. Juan.
Dios en él; pues claro está,
Que cada hermoso arrebol
Y cada rayo del sol,
Lengua de fuego será
Con que le alabo y bendigo.
¿Estás bien, señor, así?
Mejor que merezco, amigo.
¡Qué de piedades aquí,
Oh Señor, usais conmigo!
Cuando acaban de sacarme
De un calabozo, me dais
Un sol para calentarme:
Liberal, Señor, estais.
Sabe el cielo, si quedarme
Y acompañaros quisiera;
Mas ya veis que nos espera
El trabajo.
Hijos, adios.
¡Qué pesar!
¡Qué ánsia tan fiera!
(Vanse los cautivos.)
¿Quedais conmigo los dos?
Yo tambien te he de dejar.
¿Qué haré yo sin tu favor?
Presto volveré, señor;
Que sólo voy á buscar
Algo que comas, porque
Despues que Muley se fué
De Fez, nos falta en el suelo
Todo el humano consuelo;
Pero con todo eso iré
A procurarle, si bien
Imposibles solicito,
Porque ya cuantos me ven,
Por no ir contra el edito,
D. Fern.
Celin.
Rey.
Tarud.
D. Fern.
Brito.
Que manda que no te den
Ni agua tampoco, ni á mí
Me venden nada, señor,
Por ver que te asisto á tí;
Que á tanto llega el rigor
De la suerte. Pero aquí
Gente viene. (Vase.)
¡Oh si pudiera
Mi voz mover á piedad
A alguno, porque siquiera
Un instante más viviera
Padeciendo!
ESCENA VII.
EL REY, TARUDANTE, FÉNIX, CELIN.—DON
FERNANDO, BRITO.
Gran señor,
Por una calle has venido,
Que es fuerza que visto seas
Del Infante y advertido.
(A Tarudante.) Acompañarte he querido,
Porque mi grandeza veas.
Siempre mis honras deseas...
Dadle de limosna hoy
A este pobre algun sustento:
Mirad que hombre humano soy,
Y que afligido y hambriento,
Muriendo de hambre estoy.
Hombres, doleos de mí,
Que una fiera de otra fiera
Se compadece.
Ya aquí
D. Fern.
Brito.
Rey.
Brito.
D. Fern.
Rey.
D. Fern.
Rey.
D. Fern.
No hay pedir de esa manera.
¿Cómo he de decir?
Así:
Moros, tened compasion,
Y algo que este pobre coma
Le dad en esta ocasion,
Por el santo zancarron
Del gran profeta Mahoma.
Que tenga fe en este estado,
Tan mísero y desdichado,
Más me ofende, más me infama.—
Maestre, Infante.
El Rey llama.
¿A mí? Brito, haste engañado:
Ni Infante ni Maestre soy,
El cadáver suyo sí;
Y pues ya en la tierra estoy,
Aunque Infante y Maestre fuí,
No es ese mi nombre hoy.
Pues no eres Maestre ni Infante,
Respóndeme por Fernando.
Ahora, aunque me levante
De la tierra, iré arrastrando
A besar tu pié.
Constante
Te muestras, á mi pesar.
¿Es humildad ó valor
Esta obediencia?
Es mostrar
Cuánto debe respetar
El esclavo á su señor.
Y pues que tu esclavo soy,
Y estoy en presencia tuya
Esta vez, tengo de hablarte:
Mi Rey y señor, escucha.
Rey te llamé, y aunque seas
De otra ley, es tan augusta
De los reyes la deidad,
Tan fuerte y tan absoluta,
Que engendra ánimo piadoso;
Y así es forzoso que acudas
A la sangre generosa
Con piedad y con cordura;
Que áun entre brutos y fieras
Este nombre es de tan suma
Autoridad, que la ley
De naturaleza ajusta
Obediencias; y así lêmos
En repúblicas incultas,
Al leon rey de las fieras,
Que cuando la frente arruga
De guedejas se corona,
Es piadoso, pues que nunca
Hizo presa en el rendido.
En las saladas espumas
Del mar el delfin, que es rey
De los peces, le dibujan
Escamas de plata y oro
Sobre la espalda cerúlea
Coronas, y ya se vió
De una tormenta importuna
Sacar los hombres á tierra,
Porque el mar no los consuma.
El águila caudalosa,
A quien copete de plumas
Riza el viento en sus esferas,
De cuantas aves saludan
Al sol es emperatriz,
Y con piedad noble y justa,
Porque brindado no beba
El hombre entre plata pura
La muerte, que en los cristales
Mezcló la ponzoña dura
Del áspid, con pico y alas
Los revuelve y los enturbia.
Aun entre plantas y piedras
Se dilata y se dibuja
Este imperio: la granada,
A quien coronan las puntas
De una corteza, en señal
De que es reina de las frutas,
Envenenada marchita
Los rubíes que la ilustran,
Y los convierte en topacios,
Color desmayada y mustia.
El diamante, á cuya vista
Ni áun el iman ejecuta
Su propiedad, que por rey
Esta obediencia le jura,
Tan noble es, que la traicion
Del dueño no disimula;
Y la dureza, imposible
De que buriles la pulan,
Se deshace entre sí misma,
Vuelta en cenizas menudas.
Pues si entre fieras y peces,
Plantas, piedras y aves, usa
Esta majestad de rey
De piedad, no será injusta
Entre los hombres, señor:
Porque el ser no te disculpa
De otra ley, que la crueldad
En cualquiera ley es una.
No quiero compadecerte
Con mis lástimas y angustias
Para que me des la vida,
Que mi voz no la procura;
Que bien sé que he de morir
De esta enfermedad que turba
Mis sentidos, que mis miembros
Discurre helada y caduca.
Bien sé que herido de muerte
Estoy, porque no pronuncia
Voz la lengua, cuyo aliento
No sea una espada aguda.
Bien sé al fin que soy mortal,
Y que no hay hora segura;
Y por eso dió una forma
Con una materia en una
Semejanza la razon
Al ataud y á la cuna.
Accion nuestra es natural,
Cuando recibir procura
Algo un hombre, alzar las manos
En esta manera juntas;
Mas cuando quiere arrojarlo,
De aquella misma accion usa,
Pues las vuelve boca abajo
Porque así las desocupa.
El mundo, cuando nacemos,
En señal de que nos busca,
En la cuna nos recibe,
Y en ella nos asegura
Boca arriba; pero cuando,
O con desden ó con furia,
Quiere arrojarnos de sí,
Vuelve las manos que junta,
Y aquel instrumento mismo
Forma esta materia muda;
Pues fué cuna boca arriba
Lo que boca abajo es tumba.
Tan cerca vivimos, pues,
De nuestra muerte, tan juntas
Tenemos, cuando nacemos,
El lecho como la cuna.
¿Qué aguarda quien esto oye?
Quien esto sabe, ¿qué busca?
Claro está que no será
La vida: no admite duda;
La muerte sí: esta te pido,
Porque los cielos me cumplan
Un deseo de morir
Por la fe; que, aunque presumas
Que esto es desesperacion,
Porque el vivir me disgusta,
No es sino afecto de dar
La vida en defensa justa
De la fe, y sacrificar
A Dios vida y alma juntas:
Y así aunque pida la muerte,
El afecto me disculpa.
Y si la piedad no puede
Vencerte, el rigor presuma
Obligarte. ¿Eres leon?
Pues ya será bien que rujas,
Y despedaces á quien
Te ofende, agravia é injuria.
¿Eres águila? Pues hiere
Con el pico y con las uñas
A quien tu nido deshace.
¿Eres delfin? Pues anuncia
Tormentas al marinero
Que el mar de este mundo sulca.
¿Eres árbol real? Pues muestra
Todas las ramas desnudas
A la violencia del tiempo,
Que ira de Dios ejecuta.
¿Eres diamante? Hecho polvos
Sé pues venenosa furia,
Y cánsate; porque yo,
Rey.
D. Fern.
Tarud.
D. Fern.
Fénix.
D. Fern.
Aunque más tormentos sufra,
Aunque más rigores vea,
Aunque llore más angustias,
Aunque más miserias pase,
Aunque halle más desventuras,
Aunque más hambre padezca,
Aunque mis carnes no cubran
Estas ropas, y aunque sea
Mi esfera esta estancia sucia,
Firme he de estar en mi fe;
Porque es el sol que me alumbra,
Porque es la luz que me guía,
Es el laurel que me ilustra.
No has de triunfar de la Iglesia;
De mí, si quieres, trïunfa:
Dios defenderá mi causa,
Pues yo defiendo la suya.
¿Posible es que en tales penas
Blasones y te consueles,
Siendo propias? ¿Qué condenas,
No me duelan, siendo ajenas,
Si tú de tí no te dueles?
Que pues tu muerte causó
Tu misma mano y yo no,
No esperes piedad de mí;
Ten tú lástima de tí,
Fernando, y tendréla yo. (Vase.)
(A Tarudante.) Señor, vuestra Majestad
Me valga.
¡Qué desventura! (Vase.)
(A Fénix.) Si es alma de la hermosura
Esa divina deidad,
Vos, señora, me amparad
Con el Rey.
¡Qué gran dolor!
¿Aun no me mirais?
Fénix.
D. Fern.
Fénix.
D. Fern.
Fénix.
D. Juan.
D. Fern.
D. Juan.
D. Fern.
D. Juan.
D. Fern.
¡Qué horror!
Haceis bien; que vuestros ojos
No son para ver enojos.
¡Qué lástima! ¡qué pavor!
Pues aunque no me mireis
Y ausentaros intenteis,
Señora, es bien que sepais,
Aunque tan bella os juzgais,
Que más que yo no valeis,
Y yo quizá valgo más.
Horror con tu voz me das,
Y con tu aliento me hieres.
¡Déjame, hombre! ¿qué me quieres?
Que no puedo sentir más. (Vase.)
ESCENA VIII.
DON JUAN, con un pan.—DON FERNANDO, BRITO.
Por alcanzar este pan
Que traerte, me han seguido
Los moros, y me han herido
Con los palos que me dan.
Esa es la herencia de Adan.
Tómale.
Amigo leal,
Tarde llegas, que mi mal
Es ya mortal.
Déme el cielo
En tantas penas consuelo.
Pero ¿qué mal no es mortal,
Si mortal el hombre es,
Y en este confuso abismo
La enfermedad de sí mismo
Le viene á matar despues?
Hombre, mira que no estés
Descuidado: la verdad
Sigue, que hay eternidad;
Y otra enfermedad no esperes
Que te avise, pues tú eres
Tu mayor enfermedad.
Pisando la tierra dura
De contínuo el hombre está,
Y cada paso que da
Es sobre su sepultura.
Triste ley, sentencia dura
Es saber que en cualquier caso
Cada paso (¡gran fracaso!)
Es para andar adelante,
Y Dios no es á hacer bastante,
Que no haya dado aquel paso.
Amigos, á mi fin llego:
Llevadme de aquí en los brazos.
D. Juan.
D. Fern.
D. Alf.
Serán los últimos lazos
De mi vida.
Lo que os ruego,
Noble Don Juan, es que luego
Que espire me desnudeis.
En la mazmorra hallaréis
De mi religion el manto,
Que le traje tiempo tanto;
Con este me enterraréis
Descubierto, si el Rey fiero
Ablanda la saña dura,
Dándome la sepultura;
Y señaladla; que espero,
Que aunque hoy cautivo muero,
Rescatado he de gozar
El sufragio del altar;
Que pues yo os he dado á vos
Tantas iglesias, mi Dios,
Alguna me habeis de dar.
(Llévanle en brazos.)
Playa distante de la ciudad de Fez.—Es de noche.
ESCENA IX.
DON ALFONSO, soldados con arcabuces.
Dejad á la inconstante
Playa azul esa máquina arrogante
De naves, que causando al cielo asombros,
El mar sustenta en sus nevados hombros:
D. Enr.
D. Alf.
D. Enr.
D. Alf.
Y en estos horizontes
Aborten gente los preñados montes
Del mar, siendo con máquinas de fuego
Cada bajel un edificio griego.
ESCENA X.
DON ENRIQUE.—Dichos.
Señor, tú no quisiste que saliera
Nuestra gente de Fez en la ribera,
Y este puesto escogiste
Para desembarcar: infeliz fuiste,
Porque por una parte
Marchando viene el numeroso Marte,
Cuyo ejército al viento desvanece,
Y los collados de los montes crece.
Tarudante conduce gente tanta,
Llevando á su mujer, felice Infanta
De Fez, hácia Marruecos...
Mas respondan las lenguas de los ecos.
Enrique, á eso he venido,
A esperarle á este paso; que no ha sido
Esta eleccion acaso; prevenida
Estaba, y la razon está entendida:
Si yo á desembarcar á Fez llegara,
Esta gente y la suya en ella hallara;
Y estando divididos,
Hoy con ménos poder están vencidos;
Y ántes que se prevengan,
Toca al arma.
Señor, advierte y mira
Que es sin tiempo esta guerra.
Ya mi ira
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookultra.com

Más contenido relacionado

PDF
Security on Rails 1st Edition Ben Poweski
PDF
Full Stack Serverless 1st Edition Nader Dabit
PDF
Introduccion a nodejs
PDF
Introduccion a nodejs_a_traves_de_koans_ebook
PDF
Lujan.pdf
PDF
Formacion Sociedad Globalizadora
PDF
Interfaces Web Adaptables al dispositivo empleando HTML5 y CSS3.pdf
PDF
Electrónica digital: DIseño e implementacion de la plataforma Boole-Weblab-De...
Security on Rails 1st Edition Ben Poweski
Full Stack Serverless 1st Edition Nader Dabit
Introduccion a nodejs
Introduccion a nodejs_a_traves_de_koans_ebook
Lujan.pdf
Formacion Sociedad Globalizadora
Interfaces Web Adaptables al dispositivo empleando HTML5 y CSS3.pdf
Electrónica digital: DIseño e implementacion de la plataforma Boole-Weblab-De...

Similar a Code in the Cloud 1st Edition Mark C. Chu-Carroll (20)

PDF
Practica 5
PDF
DESARROLLADOR DE APLICACIONES DE ESCRITORIO CON JDBC
DOCX
Analisis De Software
PDF
La red internet
PDF
Team viewer7 manual_remotecontrol_es
PDF
Configuración General servicios de Red windows Server
PDF
Manual smartsketch
PDF
Tutor Java Web
PDF
Manual fireworks8
PDF
(Ebook) macromedia flash 8 tutorial (es)
PDF
1 estudio-cloud_computing_retos_y_oportunidades_vdef
PDF
Cloud computing. retos y oportunidades
PDF
Maestrosdelweb guia-android
PDF
Maestrosdelweb guia-android
PDF
Mdw guia-android
PDF
Guía Android
PDF
Mdw guia-android-1.3
PDF
Mdw guia-android-1.3
Practica 5
DESARROLLADOR DE APLICACIONES DE ESCRITORIO CON JDBC
Analisis De Software
La red internet
Team viewer7 manual_remotecontrol_es
Configuración General servicios de Red windows Server
Manual smartsketch
Tutor Java Web
Manual fireworks8
(Ebook) macromedia flash 8 tutorial (es)
1 estudio-cloud_computing_retos_y_oportunidades_vdef
Cloud computing. retos y oportunidades
Maestrosdelweb guia-android
Maestrosdelweb guia-android
Mdw guia-android
Guía Android
Mdw guia-android-1.3
Mdw guia-android-1.3
Publicidad

Último (20)

PDF
Salvese Quien Pueda - Andres Oppenheimer Ccesa007.pdf
PDF
Guia de Tesis y Proyectos de Investigacion FS4 Ccesa007.pdf
PDF
Educación Artística y Desarrollo Humano - Howard Gardner Ccesa007.pdf
PDF
Unidad de Aprendizaje 5 de Matematica 1ro Secundaria Ccesa007.pdf
PDF
TOMO II - LITERATURA.pd plusenmas ultras
PDF
DI, TEA, TDAH.pdf guía se secuencias didacticas
DOCX
III Ciclo _ Plan Anual 2025.docx PARA ESTUDIANTES DE PRIMARIA
PDF
Conecta con la Motivacion - Brian Tracy Ccesa007.pdf
PDF
Unidad de Aprendizaje 5 de Educacion para el Trabajo EPT Ccesa007.pdf
PDF
biología es un libro sobre casi todo el tema de biología
PDF
IDH_Guatemala_2.pdfnjjjkeioooe ,l dkdldp ekooe
PDF
Habitos de Ricos - Juan Diego Gomez Ccesa007.pdf
DOCX
V UNIDAD - SEGUNDO GRADO. del mes de agosto
PDF
Tomo 1 de biologia gratis ultra plusenmas
DOCX
UNIDAD DE APRENDIZAJE 5 AGOSTO tradiciones
PDF
Crear o Morir - Andres Oppenheimer Ccesa007.pdf
PDF
Punto Critico - Brian Tracy Ccesa007.pdf
PDF
TRAUMA_Y_RECUPERACION consecuencias de la violencia JUDITH HERMAN
PPTX
caso clínico iam clinica y semiología l3.pptx
DOCX
V UNIDAD - PRIMER GRADO. del mes de agosto
Salvese Quien Pueda - Andres Oppenheimer Ccesa007.pdf
Guia de Tesis y Proyectos de Investigacion FS4 Ccesa007.pdf
Educación Artística y Desarrollo Humano - Howard Gardner Ccesa007.pdf
Unidad de Aprendizaje 5 de Matematica 1ro Secundaria Ccesa007.pdf
TOMO II - LITERATURA.pd plusenmas ultras
DI, TEA, TDAH.pdf guía se secuencias didacticas
III Ciclo _ Plan Anual 2025.docx PARA ESTUDIANTES DE PRIMARIA
Conecta con la Motivacion - Brian Tracy Ccesa007.pdf
Unidad de Aprendizaje 5 de Educacion para el Trabajo EPT Ccesa007.pdf
biología es un libro sobre casi todo el tema de biología
IDH_Guatemala_2.pdfnjjjkeioooe ,l dkdldp ekooe
Habitos de Ricos - Juan Diego Gomez Ccesa007.pdf
V UNIDAD - SEGUNDO GRADO. del mes de agosto
Tomo 1 de biologia gratis ultra plusenmas
UNIDAD DE APRENDIZAJE 5 AGOSTO tradiciones
Crear o Morir - Andres Oppenheimer Ccesa007.pdf
Punto Critico - Brian Tracy Ccesa007.pdf
TRAUMA_Y_RECUPERACION consecuencias de la violencia JUDITH HERMAN
caso clínico iam clinica y semiología l3.pptx
V UNIDAD - PRIMER GRADO. del mes de agosto
Publicidad

Code in the Cloud 1st Edition Mark C. Chu-Carroll

  • 1. Code in the Cloud 1st Edition Mark C. Chu- Carroll download https://ebookultra.com/download/code-in-the-cloud-1st-edition- mark-c-chu-carroll/ Explore and download more ebooks or textbooks at ebookultra.com
  • 2. We believe these products will be a great fit for you. Click the link to download now, or visit ebookultra.com to discover even more! Infrastructure as Code Managing Servers in the Cloud 1 (Early Release) Edition Kief Morris https://ebookultra.com/download/infrastructure-as-code-managing- servers-in-the-cloud-1-early-release-edition-kief-morris/ Breakers of the Code 1st Edition C. B. Archer https://ebookultra.com/download/breakers-of-the-code-1st-edition-c-b- archer/ Cloud Computing and Big Data 1st Edition C. Catlett https://ebookultra.com/download/cloud-computing-and-big-data-1st- edition-c-catlett/ Server Driven Web Apps with htmx Any Language Less Code Simpler Code 1st Edition R. Mark Volkmann https://ebookultra.com/download/server-driven-web-apps-with-htmx-any- language-less-code-simpler-code-1st-edition-r-mark-volkmann/
  • 3. Philosophy in The Twilight Zone 1st Edition Noel Carroll https://ebookultra.com/download/philosophy-in-the-twilight-zone-1st- edition-noel-carroll/ Interpreting the National Electrical Code Eighth Edition Truman C. Surbrook https://ebookultra.com/download/interpreting-the-national-electrical- code-eighth-edition-truman-c-surbrook/ Ontology and the Lexicon Chu https://ebookultra.com/download/ontology-and-the-lexicon-chu/ Speech Coding Algorithms Foundation and Evolution of Standardized Coders 1st Edition Wai C. Chu https://ebookultra.com/download/speech-coding-algorithms-foundation- and-evolution-of-standardized-coders-1st-edition-wai-c-chu/ NEC 2005 Handbook NFPA 70 National Electric Code International Electrical Code Series Tenth Edition Mark W. Earley https://ebookultra.com/download/nec-2005-handbook-nfpa-70-national- electric-code-international-electrical-code-series-tenth-edition-mark- w-earley/
  • 5. Code in the Cloud 1st Edition Mark C. Chu-Carroll Digital Instant Download Author(s): Mark C. Chu-Carroll ISBN(s): 1934356638 Edition: 1 File Details: PDF, 6.43 MB Year: 2011 Language: english
  • 7. What readers are saying about Code in the Cloud This is a great book if you want to learn about the cloud and how to use App Engine. It was nice to see examples in both Python and Java. Mark does an excellent job of explaining the technologies involved in a down-to-earth, less-hype–more-facts way that I found engaging. Very nice read indeed! Fred Daoud Author, Stripes: ...and Java Web Development Is Fun Again and Getting Started with Apache Click When you think about the distinction between essential and acciden- tal complexity in web application development, chores like acquiring server hardware, installing an operating system, and worrying about how well those infrastructure choices are going to serve your applica- tion’s needs down the road definitely fall into the latter group. Code in the Cloud explains how developers can use the services provided by the Google App Engine platform to write highly flexible and scalable web-based applications without worrying about a lot of the low-level deployment details that have plagued developers in the past. Lyle Johnson Senior Analyst, Sentar Inc. Compact, well-commented code, and clear explanations—what more could a new cloud developer want? Dorothea Salo University of Wisconsin–Madison
  • 8. Code in the Cloud Programming Google App Engine Mark C. Chu-Carroll The Pragmatic Bookshelf Raleigh, North Carolina Dallas, Texas
  • 9. Many of the designations used by manufacturers and sellers to distinguish their prod- ucts are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC. Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein. Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://www.pragprog.com. The team that produced this book includes: Editor: Colleen Toporek Indexing: Sara Lynn Eastler Copy edit: Kim Wimpsett Production: Janet Furlow Customer support: Ellie Callahan International: Juliet Benda Copyright © 2011 Pragmatic Programmers, LLC. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmit- ted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher. Printed in the United States of America. ISBN-10: 1-934356-63-8 ISBN-13: 978-1-934356-63-0 Printed on acid-free paper. P1.0 printing, April, 2011 Version: 2011-4-14
  • 10. Contents I Getting Started with Google App Engine 9 1 Introduction 10 1.1 What’s Cloud Computing? . . . . . . . . . . . . . . . 10 1.2 Cloud Computing Programming Systems . . . . . . 16 1.3 Acknowledgments . . . . . . . . . . . . . . . . . . . . 19 2 Getting Started 20 2.1 Setting Up a Google App Engine Account . . . . . . 20 2.2 Setting Up Your Development Environment . . . . . 22 2.3 Starting to Program in Python with App Engine . . 25 2.4 Monitoring Your Application . . . . . . . . . . . . . . 32 II Programming Google App Engine with Python 36 3 A First Real Cloud Application 37 3.1 The Basic Chat Application . . . . . . . . . . . . . . 37 3.2 The Basics of HTTP . . . . . . . . . . . . . . . . . . . 41 3.3 Mapping Chat into HTTP . . . . . . . . . . . . . . . . 45 4 Managing Data in the Cloud 53 4.1 Why Didn’t Chat Work? . . . . . . . . . . . . . . . . . 53 4.2 Making Chat Persistent . . . . . . . . . . . . . . . . . 56 5 Google App Engine Services for Login Authentication 65 5.1 Introducing the Users Service . . . . . . . . . . . . . 65 5.2 The Users Service . . . . . . . . . . . . . . . . . . . . 66 5.3 Integrating the Users Service into Chat . . . . . . . 67 6 Organizing Code: Separating UI and Logic 70 6.1 Getting Started with Templates . . . . . . . . . . . . 70 6.2 Building Related Views with Templates . . . . . . . 75 6.3 Multiple Chat Rooms . . . . . . . . . . . . . . . . . . 81
  • 11. CONTENTS 6 7 Making the UI Pretty: Templates and CSS 87 7.1 Introducing CSS . . . . . . . . . . . . . . . . . . . . . 88 7.2 Styling Text Using CSS . . . . . . . . . . . . . . . . . 89 7.3 Page Layouts Using CSS . . . . . . . . . . . . . . . . 94 7.4 Building Our Interface Using Flowed Layout . . . . 102 7.5 Including CSS Files in App Engine Applications . . 105 8 Getting Interactive 107 8.1 Interactive Web Services: The Basics . . . . . . . . . 107 8.2 The Model-View-Controller Design Pattern . . . . . 110 8.3 Talking to the Server without Disruption . . . . . . 113 8.4 References and Resources . . . . . . . . . . . . . . . 121 III Programming Google App Engine with Java 122 9 Google App Engine and Java 123 9.1 Introducing GWT . . . . . . . . . . . . . . . . . . . . 125 9.2 Getting Started with Java and GWT . . . . . . . . . 127 9.3 RPC in GWT . . . . . . . . . . . . . . . . . . . . . . . 135 9.4 Testing and Deploying with GWT . . . . . . . . . . . 140 10 Managing Server-Side Data 141 10.1 Data Persistence in Java . . . . . . . . . . . . . . . . 141 10.2 Storing Persistent Objects in GWT . . . . . . . . . . 145 10.3 Retrieving Persistent Objects in GWT . . . . . . . . . 149 10.4 Gluing the Client and the Server Together . . . . . . 151 10.5 References and Resources . . . . . . . . . . . . . . . 153 11 Building User Interfaces in Java 154 11.1 Why Use GWT? . . . . . . . . . . . . . . . . . . . . . 154 11.2 Building GWT UIs with Widgets . . . . . . . . . . . . 155 11.3 Making the UI Active: Handling Events . . . . . . . 162 11.4 Making the UI Active: Updating the Display . . . . . 167 11.5 Wrapping Up with GWT . . . . . . . . . . . . . . . . 169 11.6 References and Resources . . . . . . . . . . . . . . . 170 12 Building the Server Side of a Java Application 171 12.1 Filling in Gaps: Supporting Chat Rooms . . . . . . . 171 12.2 Proper Interactive Design: Being Incremental . . . . 176 12.3 Updating the Client . . . . . . . . . . . . . . . . . . . 184 12.4 Chat Administration . . . . . . . . . . . . . . . . . . 185 Report erratum this copy is (P1.0 printing, April, 2011) Download from Wow! eBook <www.wowebook.com>
  • 12. CONTENTS 7 12.5 Running and Deploying the Chat Application . . . . 187 12.6 Wrapping Up the Server Side . . . . . . . . . . . . . 189 IV Advanced Google App Engine 190 13 Advanced Datastore: Property Types 191 13.1 Building a Filesystem Service . . . . . . . . . . . . . 191 13.2 Modeling the Filesystem: A First Cut . . . . . . . . . 195 13.3 Property Types Reference . . . . . . . . . . . . . . . . 212 13.4 Wrapping Up Property Types . . . . . . . . . . . . . 215 14 Advanced Datastore: Queries and Indices 216 14.1 Indices and Queries in Datastore . . . . . . . . . . . 217 14.2 More Flexible Models . . . . . . . . . . . . . . . . . . 223 14.3 Transactions, Keys, and Entity Groups . . . . . . . 224 14.4 Policy and Consistency Models . . . . . . . . . . . . 226 14.5 Incremental Retrieval . . . . . . . . . . . . . . . . . . 230 15 Google App Engine Services 232 15.1 The Memcache Service . . . . . . . . . . . . . . . . . 233 15.2 Accessing Other Stuff: The URL Fetch Service . . . 238 15.3 Communicating with People: Mail and Chat Services 239 15.4 Sending and Receiving Email . . . . . . . . . . . . . 243 15.5 Wrapping Up Services . . . . . . . . . . . . . . . . . 246 16 Server Computing in the Cloud 248 16.1 Scheduling Jobs with App Engine Cron . . . . . . . 249 16.2 Running Jobs Dynamically Using the Task Queue . 253 16.3 Wrapping Up Server Computing . . . . . . . . . . . . 259 17 Security in App Engine Services 260 17.1 What Is Security? . . . . . . . . . . . . . . . . . . . . 260 17.2 Basic Security . . . . . . . . . . . . . . . . . . . . . . 261 17.3 Advanced Security . . . . . . . . . . . . . . . . . . . 269 18 Administering Your App Engine Deployment 277 18.1 Monitoring . . . . . . . . . . . . . . . . . . . . . . . . 277 18.2 Peeking at the Datastore . . . . . . . . . . . . . . . . 281 18.3 Logs and Debugging . . . . . . . . . . . . . . . . . . 282 18.4 Managing Your Application . . . . . . . . . . . . . . 284 18.5 Paying for What You Use . . . . . . . . . . . . . . . . 285 Report erratum this copy is (P1.0 printing, April, 2011) Download from Wow! eBook <www.wowebook.com>
  • 13. CONTENTS 8 19 Wrapping Up 287 19.1 Cloud Concepts . . . . . . . . . . . . . . . . . . . . . 287 19.2 Google App Engine Concepts . . . . . . . . . . . . . 288 19.3 Where to Go from Here . . . . . . . . . . . . . . . . . 290 19.4 References and Resources . . . . . . . . . . . . . . . 292 Index 293 Report erratum this copy is (P1.0 printing, April, 2011) Download from Wow! eBook <www.wowebook.com>
  • 14. Part I Getting Started with Google App Engine Download from Wow! eBook <www.wowebook.com>
  • 15. Chapter 1 Introduction Cloud computing is an innovative and exciting style of programming and using computers. It creates tremendous opportunities for software developers: cloud computing can provide an amazing new platform for building new kinds applications. In this chapter, we’ll look at the basic concepts: what cloud computing is, when and why you should use it, and what kinds of cloud-based services are available to you as an appli- cation developer. 1.1 What’s Cloud Computing? Before we look at how to write cloud programs with Google App Engine, let’s start at the very beginning and ask just what we mean by cloud computing? What is the cloud? How is it different from desktop comput- ing or old-fashioned client-server computing? And most importantly, why should you, as a software developer, care about the cloud? When should you use it, and what should you use it for? The Cloud Concept In the modern world of the Internet and the World Wide Web, there are thousands upon thousands of computers sitting in data centers, scattered around the world. We use those computers constantly—for chatting with other people, sending email, playing games, and reading and writing blogs. When we’re doing one of these everyday activities, we’re accessing a program running on a server, using our browser as a client. But where is the program actually running? Where is the data? Where are the servers? They’re somewhere out there, somewhere in some Download from Wow! eBook <www.wowebook.com>
  • 16. WHAT’S CLOUD COMPUTING? 11 data center, somewhere in the world. You don’t know where, and more importantly, you don’t care; there’s absolutely no reason for you to care. What matters to you is that you can get to the program and the data whenever you need to. Let’s look at a simple example. A few years ago, I started writing a blog. (The blog has since moved, but it’s still a good example.) When I got started, I used Google’s Blogger service to write it. Every day, I would open up my web browser, go to http://goodmath.blogspot.com/admin, and start writing. When I finished, I’d click on the Post button, and the blog post would appear to all of my readers. From my point of view, it just worked. All I needed was my web browser and the URL, and I could write my blog. Behind the scenes, Blogger is a complex piece of software run by Google in one of its data centers. It hosts hundreds of thousands of blogs, and those blogs are read by millions of users every day. When you look at it this way, it’s obvious that the software behind Blogger is running on lots of computers. How many? We don’t know. In fact, it’s probably not even a fixed number—when not many people are accessing it, it doesn’t need to be running on as many machines; when more people start using it, it needs more machines. The number of machines running it varies. But from the user’s point of view—whether that user is a blog author or a blog reader—none of that matters. Blogger is a service, and it works. When I want to write a post, I can go to Blogger and write it, and when people go to my blog’s web page, they can read it. That’s the fundamental idea of the cloud: programs and data are on a computer somewhere out there, and you neither know nor care where that computer is. Why call this collection of resources a cloud? A cloud is a huge collec- tion of tiny droplets of water. Some of those droplets fall on my yard, providing the trees and the lawn with water; some run off into the reser- voir from which my drinking water comes. And the clouds themselves grow from evaporated water, which comes from all over the place. All I want is enough water in my yard to keep the plants alive and enough in the reservoir so that I have something to drink. I don’t care which cloud brings the rain; it’s all the same to me. I don’t care where on earth that water came from. It’s all just water—the particular drops are pretty much exactly the same, and I can’t tell the difference. As long as I get enough, I’m happy. Report erratum this copy is (P1.0 printing, April, 2011) Download from Wow! eBook <www.wowebook.com>
  • 17. WHAT’S CLOUD COMPUTING? 12 So think about the various data centers around the world where compa- nies have swarms of computers—as clouds. Lots of the biggest players in network computing, including Google, Amazon, Microsoft, IBM, and Yahoo, all have thousands of machines connected to networks running all sorts of software. Each of those centers is a cloud, and each pro- cessor, each disk drive, is a droplet of water in that cloud. In the cloud world, when you write a program, you don’t know what computer it’s going to run on. You don’t know where the disks that store the data are, and you don’t need to care. You just need to know how many droplets you need. Cloud to the Developer Cloud computing is a fundamental change from how computers and software have worked in the past. Traditionally, if you wanted to run an application, you went out and bought a computer and software, set it up on your own premises, and ran your program. You needed to pick out which operating system you were going to run, handle the installation of your software, and maintain your computer—keeping track of software upgrades, security, backups, and so on. With cloud computing, you don’t do any of that. If you’re a user of the cloud, you buy access to the application you want and then connect to it from anywhere. Installing the software, maintaining the hardware and software where the application runs, making sure that the data is kept safe and secure—none of that is your concern. In the cloud, you buy software as a service. If you need more storage than a typical user, you buy extra storage from the service provider. If that means buying and installing a new disk drive, that’s up to the provider. You just buy storage-as-a-service from them: how they provide it is their problem. You tell them what you need—in both the physical sense (“I need 1TB of storage.”) and in less tangible quality-of-service senses (“I need to guar- antee that my storage is transactional, so that after I commit a change, data will never be lost.”). You tell them your requirements, and some cloud provider will sell you a service that meets those requirements. What this means is that when you’re developing for the cloud, instead of buying a computer and running software on it, you break things down to basic building blocks, buy those pieces from service providers, and put them together however you want to build a system. The building blocks are the resources you need to run a program or to perform a task. Resources include things like processing time, network Report erratum this copy is (P1.0 printing, April, 2011) Download from Wow! eBook <www.wowebook.com>
  • 18. WHAT’S CLOUD COMPUTING? 13 bandwidth, disk storage, and memory. As a user of the cloud, you don’t need to be concerned about where these resources are located. You know what you need, and you buy that from whoever can provide it to you most conveniently. For developers, cloud computing introduces an even bigger change. When you develop for the cloud, you’re not building a piece of software to sell to your customers—you’re building a service for your customers to use. Understanding that difference is crucial: you need to design your application around the idea that it’s a service you’re going to pro- vide to users, not a standalone application that they’re going to install on their computers. Your customers are going to choose a service based on the tasks they want to accomplish, so your application needs to be designed with the task in mind, and you must provide it in the most flexible way possible. For example, if you want to build a to-do list application for a desk- top computer, it’s a fairly straightforward process. There are lots of variations in how you can arrange the UI, but the basic idea of what you’re building is obvious. You would build one UI—after all, why would you need more than one? And you’d build it mainly for a single user. If you are developing this to-do list application for the cloud, though, you’d want multiple UIs: at the very least, you’d want one UI for people accessing your service using their desktop computer and one for people using a mobile browser on a cell phone. You’d probably want to provide an open interface that other people could use for building clients for other devices. And you’d need to design it for multiple users; if you put an application in the cloud, there’s only one program, but it can be used by lots of people. So you need to design it around the assumption that even if users never work together using your application, it’s still a multi-user system. For developers, the most exciting aspect of cloud computing is its scala- bility. When you’re developing in the cloud, you can write a simple pro- gram to be used by one or two people—and then, without ever changing a line of code, that program can scale up to support millions of users. The program is scale-neutral: you write it so it will work equally well for one dozen users or one million users. As you get more users, all you need to do is buy more resources—and your program will just work. You can start with a simple program running on one server somewhere in the cloud and scale up by adding resources until you’ve got millions of users. Report erratum this copy is (P1.0 printing, April, 2011) Download from Wow! eBook <www.wowebook.com>
  • 19. WHAT’S CLOUD COMPUTING? 14 Cloud versus Client-Server In many ways, the basic style of development for cloud-based software is similar to programming for client-server computing. Both are based on the idea that you don’t really run programs on your own computer. Your computer provides a window into an application, but it doesn’t run the application itself. Instead of running the program on your computer, all you do on your own computer is run some kind of user interface. The real program is running somewhere else on a computer called a server. You use the server because, for whatever reason, the resources necessary to run the program aren’t available on your local computer: it’s cheaper, faster, or more convenient to run the program somewhere else where the necessary resources are easy to obtain. The big difference between cloud and client-server development is in what you know: in traditional client-server systems, you might have a specific computer that is your server, and that’s where your stuff is running. The computer may not be sitting on your desk in front of you, but you know where it is. For example, when I was in college, one of the first big computers I used was a VAX 11/780 nicknamed “Gold.” Gold lived in the Rutgers university computing lab in Hill Center. I used Gold pretty much daily for at least a year before I actually got to see it. The data center had at least thirty other computers: several DEC 20s, a couple of Pyramids, an S/390, and a bunch of Suns. But of those machines, I specifically used Gold. Every program that I wrote, I wrote specifically to run on Gold, and that’s the only place that I could run it. In the cloud, you aren’t confined to a specific server. You have com- puting resources—that is, someone is renting you a certain amount of computation on some collection of computers somewhere. You don’t know where they are; you don’t know what kind of computers they are. You could have two massive machines with 32 processors each and 64 gigabytes of memory; or they could be 64 dinky little single-processor machines with 2 gigabytes of memory. The computers where you run your program could have great big disks of their own, or they could be diskless machines accessing storage on dedicated storage servers. To you, as a user of the cloud, that doesn’t matter. You’ve got the resources you pay for, and where they are makes no difference as long as you get what you need. Report erratum this copy is (P1.0 printing, April, 2011) Download from Wow! eBook <www.wowebook.com>
  • 20. WHAT’S CLOUD COMPUTING? 15 When to Develop for the Cloud So now you know what the cloud is. It’s a revolutionary way of thinking about computing; it’s a universe of servers that you can build an appli- cation on; it’s a world of services that you can build or that you can use to build other things. Now, the question is, when should you use it? You can write almost any application you want in the cloud. In fact, many people strongly believe that everything should be in the cloud— that there’s no longer any reason to develop applications for standalone personal computers. I don’t go quite that far: many applications are well suited to the cloud, but that doesn’t mean that it’s the ideal platform for everything. You can build anything as a service in the cloud, but it might be a lot harder than developing it as a standalone application. There are three kinds of applications that it makes sense to build in the cloud: Collaborative applications. If the application you’re building will be used by groups of people to work together, share data, communicate, or collaborate, then you really should build that application in the cloud. Collaboration is the cloud’s natural niche. Services. If you ask, “What does my application do?” and the most natural answer sounds like a service, then you’re looking at a cloud appli- cation. The difference between an application and a service can be subtle—you can describe almost anything as a service. The key question here is what’s the most natural description of it? If you want to describe the desktop iTunes application, you could say, “It lets people manage their music collections,” which does sound service-like. But it leaves out the key property of what the iTunes desktop application does: it manages a collection of music files on the users’ computers and lets them sync that music with their iPods using a serial cable. Described the latter way, it’s clear that it’s a desktop application, not a cloud application. On the other hand, if you take a look at something like eMusic, you’ll come to a different conclusion. eMusic is a subscription- based website that lets users browse an enormous collection of music and buy a certain number of songs per month. eMusic is clearly a service: it lets people search through a library of hun- dreds of thousands of musical tracks, providing them with the Report erratum this copy is (P1.0 printing, April, 2011) Download from Wow! eBook <www.wowebook.com>
  • 21. Random documents with unrelated content Scribd suggests to you:
  • 22. D. Fern. Fénix. D. Fern. Fénix. D. Fern. Fénix. D. Fern. Fénix. D. Fern. Fénix. D. Fern. Fénix. D. Fern. La ley De esclavo. ¿Quién la hizo? El Rey. ¿Por qué? Porque suyo soy. ¿Pues no te ha estimado hoy? Y tambien me ha aborrecido. ¿Un dia posible ha sido A desunir dos estrellas? Para presumir por ellas, Las flores habrán venido. Estas, que fueron pompa y alegría Despertando al albor de la mañana, A la tarde serán lástima vana, Durmiendo en brazos de la noche fria. Este matiz, que al cielo desafía, Iris listado de oro, nieve y grana, Será escarmiento de la vida humana: ¡Tanto se emprende en término de un dia! A florecer las rosas madrugaron, Y para envejecerse florecieron: Cuna y sepulcro en un boton hallaron. Tales los hombres sus fortunas vieron: En un dia nacieron y espiraron; Que pasados los siglos, horas fueron. Horror y miedo me has dado, Ni oirte ni verte quiero; Sé el desdichado primero De quien huye un desdichado. ¿Y las flores? Si has hallado Jeroglíficos en ellas, Deshacellas y rompellas Sólo sabrán mis rigores. ¿Qué culpa tienen las flores?
  • 23. Fénix. D. Fern. Fénix. D. Fern. Fénix. D. Fern. Fénix. D. Fern. Fénix. D. Fern. Fénix. Parecerse á las estrellas. ¿Ya no las quieres? Ninguna Estimo en su rosicler. ¿Cómo? Nace la mujer Sujeta á muerte y fortuna; Y en esta estrella importuna Tasada mi vida ví. ¿Flores con estrellas? Sí. Aunque sus rigores lloro, Esa propiedad ignoro. Escucha, sabráslo. Dí. Esos rasgos de luz, esas centellas Que cobran con amagos superiores Alimentos del sol en resplandores, Aquello viven que se duele dellas. Flores nocturnas son; aunque tan bellas, Efímeras padecen sus ardores; Pues si un dia es el siglo de las flores, Una noche es la edad de las estrellas. De esa, pues, primavera fugitiva Ya nuestro mal, ya nuestro bien se infiere: Registro es nuestro, ó muera el sol ó viva. ¿Qué duracion habrá que el hombre espere, O qué mudanza habrá, que no reciba De astro, que cada noche nace y muere? (Vanse Fénix, Zara y Rosa.) ESCENA XV. MULEY.—DON FERNANDO.
  • 24. Muley. D. Fern. Muley. D. Fern. Muley. A que se ausentase Fénix En esta parte esperé; Que el águila más amante Huye de la luz tal vez. ¿Estamos solos? Sí. Escucha. ¿Qué quieres, noble Muley? Que sepas que hay en el pecho De un moro lealtad y fe. No sé por dónde empezar A declararme, ni sé Si diga cuánto he sentido Este inconstante desden Del tiempo, este estrago injusto De la suerte, este cruel Ejemplo del mundo, y este De la fortuna vaiven. Pero á riesgo estoy, si aquí Hablar contigo me ven; Que tratarte sin respeto Es ya decreto del Rey. Y así, á mi dolor dejando La voz, que él podrá más bien Explicarse como esclavo, Vengo á arrojarme á esos piés. Yo lo soy tuyo, y así No vengo, Infante, á ofrecer Mi favor, sino á pagar Deuda que un tiempo cobré. La vida que tú me diste, Vengo á darte; que hacer bien Es tesoro que se guarda Para cuando es menester. Y porque el temor me tiene Con grillos de miedo al pié,
  • 25. Y está mi pecho y mi cuello Entre el cuchillo y cordel, Quiero, acortando discursos, Declararme de una vez. Y así digo, que esta noche Tendré en el mar un bajel Prevenido; en las troneras De las mazmorras pondré Instrumentos, que desarmen Las prisiones que teneis. Luégo, por parte de afuera, Los candados romperé: Tú con todos los cautivos, Que Fez encierra hoy en él, Vuelve á tu patria, seguro De que yo lo quedo en Fez; Pues es fácil el decir Que ellos pudieron romper La prision; y así los dos Habremos librado bien, Yo el honor y tú la vida; Pues es cierto que á saber El Rey mi intento, me diera Por traidor con justa ley, Que no sintiera el morir. Y porque son menester Para granjear voluntades Dineros, aquí se ve A estas joyas reducido Innumerable interes. Este es, Fernando, el rescate De mi prision, esta es La obligacion que te tengo; Que un esclavo noble y fiel Tan inmenso bien habia De pagar alguna vez.
  • 26. D. Fern. Muley. D. Fern. Muley. D. Fern. Rey. Muley. Rey. Muley. Rey. Muley. Rey. Agradecerte quisiera La libertad; pero el Rey Sale al jardin. ¿Hate visto Conmigo? No. Pues no des Que sospechar. Destos ramos Haré rústico cancel, Que me encubra miéntras pasa. (Escóndese.) ESCENA XVI. EL REY.—MULEY. (Ap. ¿Con tal secreto Muley Y Fernando? ¿Y irse el uno En el punto que me ve, Y disimular el otro? Algo hay aquí que temer. Sea cierto, ó no sea cierto, Mi temor procuraré Asegurar.) Mucho estimo... Gran señor, dáme tus piés. Hallarte aquí. ¿Qué me mandas? Mucho he sentido el no ver A Ceuta por mia. Conquista, Coronado de laurel, Sus muros; que á tu valor Mal se podrá defender. Con más doméstica guerra
  • 27. Muley. Rey. Muley. Rey. Muley. Rey. Muley. Se ha de rendir á mis piés. ¿De qué suerte? Desta suerte: Con abatir y poner A Fernando en tal estado, Que él mismo á Ceuta me dé. Sabrás, pues, Muley amigo, Que yo he llegado á temer Que del Maestre la persona No está muy segura en Fez. Los cautivos, que en estado Tan abatido le ven, Se lastiman, y recelo Que se amotinen por él. Fuera desto, siempre ha sido Poderoso el interes; Que las guardas con el oro Son fáciles de romper. (Ap. Yo quiero apoyar agora Que todo esto puede ser, Porque de mí no se tenga Sospecha.) Tú temes bien, Fuerza es que quieran librarle. Pues sólo un remedio hallé, Porque ninguno se atreva A atropellar mi poder. ¿Y es, señor? Muley, que tú Le guardes, y á cargo esté Tuyo; á tí no ha de torcerte Ni el temor ni el interes. Alcaide eres del Infante, Procura el guardarle bien; Porque en cualquiera ocasion Tú me has de dar cuenta dél. (Vase.) Sin duda alguna que oyó
  • 28. D. Fern. Muley. D. Fern. Muley. D. Fern. Nuestros conciertos el Rey. ¡Válgame Alá! ESCENA XVII. DON FERNANDO.—MULEY. ¿Qué te aflige? ¿Has escuchado? Muy bien. ¿Pues para qué me preguntas Qué me aflige, si me ves En tan ciega confusion, Y entre mi amigo y el Rey, El amistad y el honor Hoy en batalla se ven? Si soy contigo leal, He de ser traidor con él; Ingrato seré contigo, Si con él me juzgo fiel. ¿Qué he de hacer (¡valedme, cielos!), Pues al mismo que llegué A rendir la libertad, Me entrega, para que esté Seguro en mi confianza? ¿Qué he de hacer si ha echado el Rey Llave maestra al secreto? Mas para acertarlo bien, Te pido que me aconsejes: Díme tú qué debo hacer. Muley, amor y amistad En grado inferior se ven Con la lealtad y el honor. Nadie iguala con el Rey;
  • 29. Muley. D. Fern. Muley. El solo es igual consigo: Y así mi consejo es Que á él le sirvas y me faltes. Tu amigo soy; y porque Esté seguro tu honor, Yo me guardaré tambien; Y aunque otro llegue á ofrecerme Libertad, no acetaré La vida, porque tu honor Conmigo seguro esté. Fernando, no me aconsejas Tan leal como cortés. Sé que te debo la vida, Y que pagártela es bien; Y así lo que está tratado, Esta noche dispondré. Líbrate tú, que mi vida Se quedará á padecer Tu muerte: líbrate tú, Que nada temo despues. ¿Y será justo que yo Sea tirano y cruel Con quien conmigo es piadoso, Y mate al honor cruel Que á mí me está dando vida? No, y así te quiero hacer Juez de mi causa y mi vida: Aconséjame tambien. ¿Tomaré la libertad De quien queda á padecer Por mí? ¿Dejaré que sea Uno con su honor cruel, Por ser liberal conmigo? ¿Qué me aconsejas? No sé; Que no me atrevo á decir
  • 30. D. Fern. Sí ni no: el no, porque Me pesará que lo diga; Y el sí, porque echo de ver Si voy á decir que sí, Que no te aconsejo bien. Sí aconsejas, porque yo, Por mi Dios y por mi ley, Seré un príncipe constante En la esclavitud de Fez.
  • 31. Muley. Rey. Muley. Rey. Muley. Rey. Muley. Rey. Muley. JORNADA TERCERA. Sala de una quinta del rey moro. ESCENA PRIMERA. MULEY, EL REY. (Ap. Ya que socorrer no espero, Por tantas guardas del Rey, A Don Fernando, hacer quiero Sus ausencias, que esta es ley De un amigo verdadero.) Señor, pues yo te serví En tierra y mar, como sabes, Si en tu gracia merecí Lugar, en penas tan graves Atento me escucha. Dí. Fernando... No digas más. ¿Posible es que no me oirás? No, que diciendo Fernando, Ya me ofendes. ¿Cómo, ó cuándo? Como ocasion no me das De hacer lo que me pidieres, Cuando me ruegas por él. ¿Si soy su guarda, no quieres, Señor, que dé cuenta dél?
  • 32. Rey. Muley. Dí; pero piedad no esperes. Fernando, cuya importuna Suerte, sin piedad alguna Vive, á pesar de la fama, Tanto que el mundo le llama El monstruo de la fortuna, Examinando el rigor, Mejor dijera el poder De tu corona, señor, Hoy á tan mísero sér Le ha traido su valor, Que en un lugar arrojado, Tan humilde y desdichado, Que es indigno de tu oido, Enfermo, pobre y tullido, Piedad pide al que ha pasado; Porque como le mandaste Que en la mazmorra durmiese, Que en los baños trabajase, Que tus caballos curase Y nadie á comer le diese, A tal extremo llegó, Como era su natural Tan flaco, que se tulló; Y así la fuerza del mal Brío y majestad rindió. Pasando la noche fria En una mazmorra dura, Constante en su fe porfía; Y al salir la lumbre pura Del sol, que es padre del dia, Los cautivos (¡pena fiera!) En una mísera estera Le ponen en tal lugar, Que es, ¿dirélo? un muladar; Porque es su olor de manera,
  • 33. Rey. Que nadie puede sufrille Junto á su casa; y así Todos dan en despedílle, Y ha venido á estar allí Sin hablalle y sin oílle, Ni compadecerse dél. Sólo un criado y un fiel Caballero en pena extraña Le consuela y acompaña. Estos dos parten con él Su porcion, tan sin provecho, Que para uno solo es poca; Pues cuando los labios toca, Se suele pasar al pecho Sin que lo sepa la boca; Y áun á estos dos los castiga Tu gente, por la piedad Que al dueño á servir obliga; Mas no hay rigor ni crueldad, Por más que ya los persiga, Que dél los pueda apartar. Miéntras uno va á buscar De comer, el otro queda Con quien consolarse pueda De su desdicha y pesar. Acaba ya rigor tanto: Tén del Príncipe, señor, Puesto en tan fiero quebranto, Ya que no piedad, horror; Asombro, ya que no llanto. Bien está, Muley. ESCENA II. É
  • 34. Fénix. Rey. Fénix. Rey. Fénix. Rey. FÉNIX.—Dichos. Señor, Si ha merecido en tu amor Gracia alguna mi humildad, Hoy á vuestra Majestad, Vengo á pedir un favor. ¿Qué podré negarte á tí? Fernando el Maestre... Está bien; Ya no hay que pasar de ahí. Horror da á cuantos le ven En tal estado; de tí Sólo merecer quisiera... ¡Detente, Fénix, espera! ¿Quién á Fernando le obliga Para que su muerte siga, Para que infelice muera? Si por ser cruel y fiel A su fe, sufre castigo Tan dilatado y cruel, Él es el cruel consigo, Que yo no lo soy con él. ¿No está en su mano el salir De su miseria, y vivir? Pues eso en su mano está, Entregue á Ceuta, y saldrá De padecer y sentir Tantas penas y rigores. ESCENA III. CELIN.—Dichos.
  • 35. Celin. Fénix. Muley. Rey. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Licencia aguardan que des, Señor, dos embajadores: De Tarudante uno es, Y el otro del portugues Alfonso. (Ap.) ¿Hay penas mayores? Sin duda que por mí envía Tarudante. (Ap.) Hoy perdí, cielos, La esperanza que tenía. Mátenme amistad y celos, Todo lo perdí en un dia. Entren, pues. En este estrado (Vase Celin.) Conmigo te asienta, Fénix. (Siéntanse.) ESCENA IV. DON ALFONSO y TARUDANTE, cada uno por su parte. —Dichos. Generoso rey de Fez... Rey de Fez altivo y fuerte... Cuya fama... Cuya vida... Nunca muera... Viva siempre... (A Fénix.) Y tú de aquel sol aurora... Tú de aquel ocaso oriente... A pesar de siglos dures... A pesar de tiempos reines... Porque tengas... Porque goces... Felicidades... Laureles...
  • 36. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. Rey. Tarud. D. Alf. Altas dichas... Triunfos grandes... Pocos males... Muchos bienes... ¿Cómo miéntras hablo yo, Tú, cristiano, á hablar te atreves? Porque nadie habla primero Que yo, donde yo estuviere. A mí, por ser de nacion Alarbe, el lugar me deben Primero; que los extraños Donde hay propios, no prefieren. Donde saben cortesía, Sí hacen; pues vemos siempre Que dan en cualquiera parte El mejor lugar al huésped. Cuando esa razon lo fuera, Aun no pudiera vencerme; Porque el primero lugar Sólo se le debe al huésped. Ya basta, y los dos ahora En mis estrados se sienten. Hable el portugues, que en fin Por de otra ley se le debe Más honor. (Ap.) Corrido estoy. Ahora yo seré breve: Alfonso de Portugal, Rey famoso, á quien celebre La fama en lenguas de bronce A pesar de envidia y muerte, Salud te envía, y te ruega Que pues libertad no quiere Fernando, como su vida La ciudad de Ceuta cueste, Que reduzcas su valor
  • 37. Tarud. Hoy á cuantos intereses El más avaro codicie, El más liberal desprecie; Y que dará en plata y oro Tanto precio como pueden Valer dos ciudades. Esto Te pide amigablemente; Pero si no se le entregas, Que ha de librarle promete Por armas, á cuyo efecto Ya sobre la espalda leve Del mar ciudades fabrica De mil armados bajeles; Y jura que á sangre y fuego Ha de librarle y vencerte, Dejando aquesta campaña Llena de sangre, de suerte, Que cuando el sol se levante Halle los matices verdes Esmeraldas, y los pierda Rubíes cuando se acueste. Aunque como embajador No me toca responderte, En cuanto toca á mi Rey, Puedo, cristiano, atreverme, Porque ya es suyo este agravio, Como hijo que obedece Al Rey mi señor; y así Decir de su parte puedes A Don Alfonso, que venga, Porque en término más breve Que hay de la noche á la aurora, Vea en púrpura caliente Agonizar estos campos, Tanto que los cielos piensen Que se olvidaron de hacer
  • 38. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Tarud. D. Alf. Rey. D. Alf. Otras flores que claveles. Si fueras, moro, mi igual, Pudiera ser que se viese Reducida esta victoria A dos jóvenes valientes; Mas díle á tu Rey que salga Si ganar fama pretende; Que yo haré que salga el mio. Casi has dicho que lo eres, Y siendo así, Tarudante Sabrá tambien responderte. Pues en campaña te espero. Yo haré que poco me esperes, Porque soy rayo. Yo viento. Volcan soy que llamas vierte. Hidra soy que fuego arroja. Yo soy furia. Yo soy muerte. ¿Que no te espantes de oirme? ¿Que no te mueras de verme? Señores, vuestras Altezas, Ya que los enojos pueden Correr al sol las cortinas Que le embozan y oscurecen, Adviertan que en tierra mia Campo aplazarse no puede Sin mí; y así yo le niego, Para que tiempo me quede De serviros. No recibo Yo hospedaje ni mercedes De quien recibo pesares. Por Fernando vengo: el verle Me obligó á llegar á Fez Disfrazado desta suerte: Á
  • 39. Rey. D. Alf. Tarud. Fénix. Muley. Ántes de entrar en tu corte Supe que á esta quinta alegre Asistias; y así vine A hablarte, porque fin diese La esperanza que me trajo; Y pues tan mal me sucede, Advierte, señor, que solo La respuesta me detiene. La respuesta, rey Alfonso, Será compendiosa y breve: Que si no me das á Ceuta, No hayas miedo que le lleves. Pues ya he venido por él, Y he de llevarle: prevente Para la guerra que aplazo.— Embajador, ó quien eres, Véamonos en la campaña. ¡Hoy toda el África tiemble! (Vase.) ESCENA V. EL REY, FÉNIX, MULEY, TARUDANTE. Ya que no pude lograr La fineza, hermosa Fénix, De serviros como esclavo, Logre al ménos la de verme A vuestros piés. Dad la mano A quien un alma os ofrece. Vuestra Alteza, gran señor, Finezas y honras no aumente A quien le estima, pues sabe Lo que á sí mismo se debe. (Ap.) ¿Qué espera quien esto llega
  • 40. Rey. Tarud. Rey. Tarud. Rey. A ver y no se da muerte? Ya que vuestra Alteza vino A Fez impensadamente, Perdone del hospedaje La cortedad. No consiente Mi ausencia más dilacion Que la de un plazo muy breve; Y supuesto que venía Mi embajador con poderes Para llevar á mi esposa, Como tú dispuesto tienes, No, por haberlo yo sido, Mi fineza desmerece La brevedad de la dicha. En todo, señor, me vences; Y así por pagar la deuda, Como porque se previenen Tantas guerras, es razon Que desocupado quede Destos cuidados; y así Volverte luégo conviene Ántes que ocupen el paso Las amenazadas huestes[8] De Portugal. Poco importa, Porque yo vengo con gente Y ejército numeroso, Tal, que esos campos parecen Más ciudades que desiertos, Y volveré brevemente Con ella á ser tu soldado. Pues luégo es bien que se apreste La jornada; pero en Fez Será bien, Fénix, que entres A alegrar á esa ciudad.
  • 41. Muley. Rey. Muley. D. Fern. Muley. Gran señor. Prevente, Que con la gente de guerra Has de ir sirviendo á Fénix, Hasta que quede segura, Y con su esposo la dejes. (Ap.) Esto sólo me faltaba, Para que, estando yo ausente, Aun le falte mi socorro A Fernando, y no le quede Esta pequeña esperanza. (Vanse.) . . . . . . . . . . . . [9] Una calle de Fez. ESCENA VI. DON JUAN, BRITO, y otros CAUTIVOS, que sacan á DON FERNANDO, y le sientan en una estera. Ponedme en aquesta parte, Para que goce mejor La luz que el cielo reparte.— ¡Oh inmenso, oh dulce Señor, Qué de gracias debo darte! Cuando como yo se vía Job, el dia maldecia; Mas era por el pecado En que habia sido engendrado; Pero yo bendigo el dia Por la gracia que nos da
  • 42. Brito. D. Fern. Caut. 1.º D. Fern. Caut. 2.º Caut. 3.º D. Fern. D. Juan. D. Fern. D. Juan. Dios en él; pues claro está, Que cada hermoso arrebol Y cada rayo del sol, Lengua de fuego será Con que le alabo y bendigo. ¿Estás bien, señor, así? Mejor que merezco, amigo. ¡Qué de piedades aquí, Oh Señor, usais conmigo! Cuando acaban de sacarme De un calabozo, me dais Un sol para calentarme: Liberal, Señor, estais. Sabe el cielo, si quedarme Y acompañaros quisiera; Mas ya veis que nos espera El trabajo. Hijos, adios. ¡Qué pesar! ¡Qué ánsia tan fiera! (Vanse los cautivos.) ¿Quedais conmigo los dos? Yo tambien te he de dejar. ¿Qué haré yo sin tu favor? Presto volveré, señor; Que sólo voy á buscar Algo que comas, porque Despues que Muley se fué De Fez, nos falta en el suelo Todo el humano consuelo; Pero con todo eso iré A procurarle, si bien Imposibles solicito, Porque ya cuantos me ven, Por no ir contra el edito,
  • 43. D. Fern. Celin. Rey. Tarud. D. Fern. Brito. Que manda que no te den Ni agua tampoco, ni á mí Me venden nada, señor, Por ver que te asisto á tí; Que á tanto llega el rigor De la suerte. Pero aquí Gente viene. (Vase.) ¡Oh si pudiera Mi voz mover á piedad A alguno, porque siquiera Un instante más viviera Padeciendo! ESCENA VII. EL REY, TARUDANTE, FÉNIX, CELIN.—DON FERNANDO, BRITO. Gran señor, Por una calle has venido, Que es fuerza que visto seas Del Infante y advertido. (A Tarudante.) Acompañarte he querido, Porque mi grandeza veas. Siempre mis honras deseas... Dadle de limosna hoy A este pobre algun sustento: Mirad que hombre humano soy, Y que afligido y hambriento, Muriendo de hambre estoy. Hombres, doleos de mí, Que una fiera de otra fiera Se compadece. Ya aquí
  • 44. D. Fern. Brito. Rey. Brito. D. Fern. Rey. D. Fern. Rey. D. Fern. No hay pedir de esa manera. ¿Cómo he de decir? Así: Moros, tened compasion, Y algo que este pobre coma Le dad en esta ocasion, Por el santo zancarron Del gran profeta Mahoma. Que tenga fe en este estado, Tan mísero y desdichado, Más me ofende, más me infama.— Maestre, Infante. El Rey llama. ¿A mí? Brito, haste engañado: Ni Infante ni Maestre soy, El cadáver suyo sí; Y pues ya en la tierra estoy, Aunque Infante y Maestre fuí, No es ese mi nombre hoy. Pues no eres Maestre ni Infante, Respóndeme por Fernando. Ahora, aunque me levante De la tierra, iré arrastrando A besar tu pié. Constante Te muestras, á mi pesar. ¿Es humildad ó valor Esta obediencia? Es mostrar Cuánto debe respetar El esclavo á su señor. Y pues que tu esclavo soy, Y estoy en presencia tuya Esta vez, tengo de hablarte: Mi Rey y señor, escucha. Rey te llamé, y aunque seas
  • 45. De otra ley, es tan augusta De los reyes la deidad, Tan fuerte y tan absoluta, Que engendra ánimo piadoso; Y así es forzoso que acudas A la sangre generosa Con piedad y con cordura; Que áun entre brutos y fieras Este nombre es de tan suma Autoridad, que la ley De naturaleza ajusta Obediencias; y así lêmos En repúblicas incultas, Al leon rey de las fieras, Que cuando la frente arruga De guedejas se corona, Es piadoso, pues que nunca Hizo presa en el rendido. En las saladas espumas Del mar el delfin, que es rey De los peces, le dibujan Escamas de plata y oro Sobre la espalda cerúlea Coronas, y ya se vió De una tormenta importuna Sacar los hombres á tierra, Porque el mar no los consuma. El águila caudalosa, A quien copete de plumas Riza el viento en sus esferas, De cuantas aves saludan Al sol es emperatriz, Y con piedad noble y justa, Porque brindado no beba El hombre entre plata pura La muerte, que en los cristales
  • 46. Mezcló la ponzoña dura Del áspid, con pico y alas Los revuelve y los enturbia. Aun entre plantas y piedras Se dilata y se dibuja Este imperio: la granada, A quien coronan las puntas De una corteza, en señal De que es reina de las frutas, Envenenada marchita Los rubíes que la ilustran, Y los convierte en topacios, Color desmayada y mustia. El diamante, á cuya vista Ni áun el iman ejecuta Su propiedad, que por rey Esta obediencia le jura, Tan noble es, que la traicion Del dueño no disimula; Y la dureza, imposible De que buriles la pulan, Se deshace entre sí misma, Vuelta en cenizas menudas. Pues si entre fieras y peces, Plantas, piedras y aves, usa Esta majestad de rey De piedad, no será injusta Entre los hombres, señor: Porque el ser no te disculpa De otra ley, que la crueldad En cualquiera ley es una. No quiero compadecerte Con mis lástimas y angustias Para que me des la vida, Que mi voz no la procura; Que bien sé que he de morir
  • 47. De esta enfermedad que turba Mis sentidos, que mis miembros Discurre helada y caduca. Bien sé que herido de muerte Estoy, porque no pronuncia Voz la lengua, cuyo aliento No sea una espada aguda. Bien sé al fin que soy mortal, Y que no hay hora segura; Y por eso dió una forma Con una materia en una Semejanza la razon Al ataud y á la cuna. Accion nuestra es natural, Cuando recibir procura Algo un hombre, alzar las manos En esta manera juntas; Mas cuando quiere arrojarlo, De aquella misma accion usa, Pues las vuelve boca abajo Porque así las desocupa. El mundo, cuando nacemos, En señal de que nos busca, En la cuna nos recibe, Y en ella nos asegura Boca arriba; pero cuando, O con desden ó con furia, Quiere arrojarnos de sí, Vuelve las manos que junta, Y aquel instrumento mismo Forma esta materia muda; Pues fué cuna boca arriba Lo que boca abajo es tumba. Tan cerca vivimos, pues, De nuestra muerte, tan juntas Tenemos, cuando nacemos,
  • 48. El lecho como la cuna. ¿Qué aguarda quien esto oye? Quien esto sabe, ¿qué busca? Claro está que no será La vida: no admite duda; La muerte sí: esta te pido, Porque los cielos me cumplan Un deseo de morir Por la fe; que, aunque presumas Que esto es desesperacion, Porque el vivir me disgusta, No es sino afecto de dar La vida en defensa justa De la fe, y sacrificar A Dios vida y alma juntas: Y así aunque pida la muerte, El afecto me disculpa. Y si la piedad no puede Vencerte, el rigor presuma Obligarte. ¿Eres leon? Pues ya será bien que rujas, Y despedaces á quien Te ofende, agravia é injuria. ¿Eres águila? Pues hiere Con el pico y con las uñas A quien tu nido deshace. ¿Eres delfin? Pues anuncia Tormentas al marinero Que el mar de este mundo sulca. ¿Eres árbol real? Pues muestra Todas las ramas desnudas A la violencia del tiempo, Que ira de Dios ejecuta. ¿Eres diamante? Hecho polvos Sé pues venenosa furia, Y cánsate; porque yo,
  • 49. Rey. D. Fern. Tarud. D. Fern. Fénix. D. Fern. Aunque más tormentos sufra, Aunque más rigores vea, Aunque llore más angustias, Aunque más miserias pase, Aunque halle más desventuras, Aunque más hambre padezca, Aunque mis carnes no cubran Estas ropas, y aunque sea Mi esfera esta estancia sucia, Firme he de estar en mi fe; Porque es el sol que me alumbra, Porque es la luz que me guía, Es el laurel que me ilustra. No has de triunfar de la Iglesia; De mí, si quieres, trïunfa: Dios defenderá mi causa, Pues yo defiendo la suya. ¿Posible es que en tales penas Blasones y te consueles, Siendo propias? ¿Qué condenas, No me duelan, siendo ajenas, Si tú de tí no te dueles? Que pues tu muerte causó Tu misma mano y yo no, No esperes piedad de mí; Ten tú lástima de tí, Fernando, y tendréla yo. (Vase.) (A Tarudante.) Señor, vuestra Majestad Me valga. ¡Qué desventura! (Vase.) (A Fénix.) Si es alma de la hermosura Esa divina deidad, Vos, señora, me amparad Con el Rey. ¡Qué gran dolor! ¿Aun no me mirais?
  • 50. Fénix. D. Fern. Fénix. D. Fern. Fénix. D. Juan. D. Fern. D. Juan. D. Fern. D. Juan. D. Fern. ¡Qué horror! Haceis bien; que vuestros ojos No son para ver enojos. ¡Qué lástima! ¡qué pavor! Pues aunque no me mireis Y ausentaros intenteis, Señora, es bien que sepais, Aunque tan bella os juzgais, Que más que yo no valeis, Y yo quizá valgo más. Horror con tu voz me das, Y con tu aliento me hieres. ¡Déjame, hombre! ¿qué me quieres? Que no puedo sentir más. (Vase.) ESCENA VIII. DON JUAN, con un pan.—DON FERNANDO, BRITO. Por alcanzar este pan Que traerte, me han seguido Los moros, y me han herido Con los palos que me dan. Esa es la herencia de Adan. Tómale. Amigo leal, Tarde llegas, que mi mal Es ya mortal. Déme el cielo En tantas penas consuelo. Pero ¿qué mal no es mortal, Si mortal el hombre es, Y en este confuso abismo La enfermedad de sí mismo
  • 51. Le viene á matar despues? Hombre, mira que no estés Descuidado: la verdad Sigue, que hay eternidad; Y otra enfermedad no esperes Que te avise, pues tú eres Tu mayor enfermedad. Pisando la tierra dura De contínuo el hombre está, Y cada paso que da Es sobre su sepultura. Triste ley, sentencia dura Es saber que en cualquier caso Cada paso (¡gran fracaso!) Es para andar adelante, Y Dios no es á hacer bastante, Que no haya dado aquel paso. Amigos, á mi fin llego: Llevadme de aquí en los brazos.
  • 52. D. Juan. D. Fern. D. Alf. Serán los últimos lazos De mi vida. Lo que os ruego, Noble Don Juan, es que luego Que espire me desnudeis. En la mazmorra hallaréis De mi religion el manto, Que le traje tiempo tanto; Con este me enterraréis Descubierto, si el Rey fiero Ablanda la saña dura, Dándome la sepultura; Y señaladla; que espero, Que aunque hoy cautivo muero, Rescatado he de gozar El sufragio del altar; Que pues yo os he dado á vos Tantas iglesias, mi Dios, Alguna me habeis de dar. (Llévanle en brazos.) Playa distante de la ciudad de Fez.—Es de noche. ESCENA IX. DON ALFONSO, soldados con arcabuces. Dejad á la inconstante Playa azul esa máquina arrogante De naves, que causando al cielo asombros, El mar sustenta en sus nevados hombros:
  • 53. D. Enr. D. Alf. D. Enr. D. Alf. Y en estos horizontes Aborten gente los preñados montes Del mar, siendo con máquinas de fuego Cada bajel un edificio griego. ESCENA X. DON ENRIQUE.—Dichos. Señor, tú no quisiste que saliera Nuestra gente de Fez en la ribera, Y este puesto escogiste Para desembarcar: infeliz fuiste, Porque por una parte Marchando viene el numeroso Marte, Cuyo ejército al viento desvanece, Y los collados de los montes crece. Tarudante conduce gente tanta, Llevando á su mujer, felice Infanta De Fez, hácia Marruecos... Mas respondan las lenguas de los ecos. Enrique, á eso he venido, A esperarle á este paso; que no ha sido Esta eleccion acaso; prevenida Estaba, y la razon está entendida: Si yo á desembarcar á Fez llegara, Esta gente y la suya en ella hallara; Y estando divididos, Hoy con ménos poder están vencidos; Y ántes que se prevengan, Toca al arma. Señor, advierte y mira Que es sin tiempo esta guerra. Ya mi ira
  • 54. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookultra.com