text stringlengths 454 608k | url stringlengths 17 896 | dump stringclasses 91
values | source stringclasses 1
value | word_count int64 101 114k | flesch_reading_ease float64 50 104 |
|---|---|---|---|---|---|
Swap widgets in place, without destroying them in layout.
Hey,
Is it possible to swap two or more widgets in place inside a layout, any layout?
For example I have a vertical layout, with 2 widgets, I need to swap their places. If there wasn't a layout, I would just moved those widgets in each other coordinates. widget1->move(x,y);
Is there a similar "move" command for layouts, where I can move widgets by rows and not by coordinates?
Kind Regards
Raivis
There is an "example using QML.":
I don't want to use QML. That's why I posted here in Desktop section.
Soory, I forgot to mention, that I want it to be old win32 style. :)
Ok, And how would you like to trigger the "swap"? You won't have the nice movements like you do in QML. It will be instantaneously e.g. when you click a button the widgets are swapped. Is that what you want?
I know, I have two video feeds shown on those widgets. Like you said, I just want to swap them instantly. So is it possible?
I've not done it before, but I think it is possible.
Just curious, why do you want that ? Can you explain some more about what your program is supposed to do? What kind of widgets do you want to use?
I'll test it out tomorrow. Now it's time to get some sleep.
I have two Video embedded plain QWidgets.
And a vertical layout, which expands according to the size of Main window.
Each widget is different size. To be more precise I need to swap those QWidget places, and one of them to reduce size, and the other to enlarge.
I think it will be easier to show it with picture.
!!
The red border represents, the layout
And those gray squares - QWidgets, which I want to swap, after click on a button, or the widget itself.
I just want to remind once more, I don't want to delete them or hide them. I just want to simply move them.
Thank you, sleep well, I'm off to bed as well.
Haven't tackled the resizing issue, but with only two items, swapping the items may be as simple as calling setDirection() on your layout.
For example (pardon my rough code. I just threw this together):
widget.h
@
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QHBoxLayout>
#include <QLabel>
class Widget : public QWidget
{
Q_OBJECT
public:
Widget(QWidget *parent = 0);
protected slots:
void doSwap();
private:
QHBoxLayout *swapLayout;
QLabel *item1;
QLabel *item2;
};
#endif // WIDGET_H
@
widget.cpp:
@
#include "widget.h"
#include <QVBoxLayout>
#include <QPushButton>
#include <QLabel>
Widget::Widget(QWidget *parent) : QWidget(parent)
{
QVBoxLayout *vlayout = new QVBoxLayout(this);
vlayout->setSpacing(10);
swapLayout = new QHBoxLayout();
swapLayout->setSpacing(10);
item1 = new QLabel();
item1->setStyleSheet("background: red");
item1->setText("Item 1");
item1->setAlignment(Qt::AlignCenter);
swapLayout->addWidget(item1);
item2 = new QLabel();
item2->setStyleSheet("background: yellow");
item2->setText("Item 2");
item2->setAlignment(Qt::AlignCenter);
swapLayout->addWidget(item2);
vlayout->addLayout(swapLayout);
QPushButton *swapbutton = new QPushButton();
swapbutton->setText("Swap");
vlayout->addWidget(swapbutton);
connect(swapbutton, SIGNAL(clicked()), this, SLOT(doSwap()));
}
void Widget::doSwap()
{
if (swapLayout->direction() == QBoxLayout::LeftToRight) {
swapLayout->setDirection(QBoxLayout::RightToLeft);
} else {
swapLayout->setDirection(QBoxLayout::LeftToRight);
}
}
@
and a standard-issue main.cpp:
@
#include <QApplication>
#include "widget.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget w;
w.resize(300,300);
w.show();
return a.exec();
}
@
Nice work, mlong!
Seems there is Qt coding happening all around the clock. ;)
About the sizes: with mlong's solution, you could play with maximum sizes in the if then else block.
Is there anything else in the white zone on the right? If there is this could complicate things.
Thanks, your solution is great, but later I'll need to use 3 or more widgets. That's why I wanted to swap their place in layout's row.
And this solution will work only for two widgets.
Best Regards
Raivis
You could just remove them from the layout and re-add them in the correct positions and with the right sizing? From your mockup it seems to be implied that you're doing some kind of manual sizing on those widgets, is that correct?
If you do it with remove re-add, using a grid layout makes it easier, as it allows empty cells. AFAIK box layouts remove emptzy cells.
Exactly, I'm manually resizing them, but I don't want to remove those widgets and re-add, that's why I'm asking for another solution.
I have a video player embedded in those widgets from a LAN camera, I don't want to stop and start the stream.
If it's impossible I'll just start thinking of algorithm which aligns those widgets in main window, without using layouts, but pure coordinates.
But it would be nice, if it were possible to just swap them in layout.
You don't delete nor hide the widgets. You just remove them from the layout and readd them.
[quote author="Eddy" date="1311913479"]Nice work, mlong!
Seems there is Qt coding happening all around the clock. ;)
[/quote]
Wasn't any big deal... you guys are the slackers that went to bed mid-afternoon! ;-)
Anyway... author="mlong" date="1311946567"]]
Yes. Use
QLayout::count + itemAt to get the i-th item in a layout;
QLayoutItem::widget to know 1) if it's a widget 2) which widget is that item wrapping
QLayout::takeAt to remove the item from the layout
an addItem overload (depending on the layout you're using) to readd it back in another position.
You could also delete the QLayoutItem and create another one (remember that they don't own the widget they wrap).
Ah, very good. Thanks a lot! That makes sense. | https://forum.qt.io/topic/8049/swap-widgets-in-place-without-destroying-them-in-layout | CC-MAIN-2022-40 | refinedweb | 961 | 67.35 |
.
Definition at line 30 of file THnSparse_Internal.h.
#include <THnSparse_Internal.h>
Definition at line 37 of file THnSparse_Internal.h.
(Default) initialize a chunk.
Takes ownership of cont (~THnSparseArrayChunk deletes it), and create an ArrayF for errors if "errors" is true.
Definition at line 427 of file THnSparse.cxx.
Destructor.
Definition at line 440 of file THnSparse.cxx.
Create a new bin in this chunk.
Definition at line 450 of file THnSparse.cxx.
Definition at line 52 of file THnSparse_Internal.h.
Definition at line 58 of file THnSparse_Internal.h.
Check whether bin at idx batches idxbuf.
If we don't store indexes we trust the caller that it does match, see comment in THnSparseCompactBinCoord::GetHash().
Definition at line 63 of file THnSparse_Internal.h.
Turn on support of errors.
Definition at line 480 of file THnSparse.cxx.
Bin content.
Definition at line 48 of file THnSparse_Internal.h.
! Size of the allocated coordinate buffer; -1 means none or fCoordinatesSize
Definition at line 44 of file THnSparse_Internal.h.
[fCoordinatesSize] compact bin coordinate buffer
Definition at line 47 of file THnSparse_Internal.h.
Size of the bin coordinate buffer.
Definition at line 46 of file THnSparse_Internal.h.
Size of a single bin coordinate.
Definition at line 45 of file THnSparse_Internal.h.
Bin errors.
Definition at line 49 of file THnSparse_Internal.h. | https://root.cern.ch/doc/master/classTHnSparseArrayChunk.html | CC-MAIN-2021-49 | refinedweb | 215 | 54.29 |
This action might not be possible to undo. Are you sure you want to continue?
Specializarea LIMBA ŞI LITERATURA ENGLEZĂ Forma de învăţământ ID - semestrul III
SEVENTEENTH AND EIGHTEENTH CENTURY BRITISH LITERATURE
Cornelia MACSINIUC
2006
Ministerul Educaţiei şi Cercetării Proiectul pentru Învăţământul Rural
LIMBA ŞI LITERATURA ENGLEZĂ
Seventeenth and Eighteenth Century British Literature
Cornelia MACSINIUC
2006
© 2006
Ministerul Educaţiei şi Cercetării Proiectul pentru Învăţământul Rural Nici o parte a acestei lucrări nu poate fi reprodusă fără acordul scris al Ministerului Educaţiei şi Cercetării
ISBN 10 973-0-04576-3; ISBN 13 978-973-0-04576-5.
Contents
CONTENTS
Introduction 1
1.1. 1.1.1. 1.1.2. 1.1.3. 1.1.4. 1.2. 1.3. 1.4. 1.4.1. 1.4.2. 1.4.3. 1.4.4. 1.5. 1.5.1. 1
The seventeenth and eighteenth centuries: intellectual and literary background
Unit objectives
9 10 10 10 11 12 12 13 15 16 17 18 19 19 21 21 23 24 24 28 30 30 31 32 32 33 33 35 36 37 37 38 39 40 41 43 43 44 46 46 47 48 i
2
2.1. 2.1.1. 2.1.2. 2.2. 2.2.1. 2.2.2. 2.2.3. 2.2.4. 2.2.5. 2.2.6. 2.2.7. 2.2.8. 2.2.9. 2.2.10. 2.2.11. 2.2.12. 2.3. 2.3.1.
The late Renaissance and the Baroque
Unit objectives The emergence of the baroque sensibility The late Renaissance: characteristics of the baroque sensibility Baroque features of late Renaissance drama and poetry Shakespeare’s genius. His later plays The baroque spirit of Shakespeare’s great tragedies Hamlet: a revenge play Renaissance man and the baroque sensibility in Hamlet Hamlet: the philosopher vs.
Proiectul pentru Învăţământul Rural
1.1.2.4.1.3.4.1.4. 3.5. 2. 3. 3.1.2. 48 49 50 52 53 54 54 56 56 57 58 59 61 62 63 63 64 64 66 66 67 67 68 69 70 72 72 74 75 77 78 79 81 82 83 83 84 85 86 87 88 89 89 89 90 90 92 93 95 95 96 3 3.3.2. 3.3. 4. 2. 3. 2. 4. 3. 3. 4.3. 4.3. 4. 3. 2. 3. 4.2.4. 3.3.5.4.Contents 2.1.3.8. 3.5.1. 3.1. 1 Solutions and suggestions for SAQs Further reading 4 4.2.2..2. 3. 4. ii The Restoration and the Augustan Age Unit objectives Restoration drama Restoration theatre – a form of Court entertainment Dominant forms in Restoration drama Restoration comedy and its character types William Congreve.2.1.1. the “author of all ill” Milton’s depiction of Adam and Eve Summary Key words Glossary Gallery of personalities SAA No.2.4.1.5.1.3.3. 3.5.3.2.2.3. 2.3. 3.4.7.2.2.4. 3.1. a master of satirical comedy of manners The rise of sentimental comedy English literary Neoclassicism Great Augustan writers: John Dryden and Alexander Pope Principles of Neoclassic literary poetics Proiectul pentru Învăţământul Rural .3.5. The Works of John Milton Unit objectives Milton.5. 3. 4.6. 2.4.3.4.6.
2. 5.4. 5. 4.3.Contents 4. 5. 5.3.2.3. 5.6.3.4. 5.4. 5.4.5. 5. 4. 5.1. 5. The Age of the Enlightenment: the rise of the novel Unit objectives.4.3.8.4.1. 5. 5.6.2.1.5.3.2.1.4.3.2.3. 5. 5. 4.4.4. 4. Proiectul pentru Învăţământul Rural .3.6.4. 4.1.4. 4. 5. 4.2.4. 5. Gulliver.2.3.2.4.1.1.2.4. “The Spectator’s Club” Augustan satire John Dryden Alexander Pope Jonathan Swift The structure of Gulliver’s Travels Lilliput and Brobdingnag: satire and utopia The fourth voyage.3. 5. 5.7.4.1. 4. 5.5.2. Nature and Reason The Augustan ideal of style “To divert and instruct” – the imperative of Augustan literature The periodical essay The Tatler and The Spectator.4.4. 5.5.2.1. 4.2.4. 4.5. 5.2.3.1.2.2. the frustrated idealist The importance of Gulliver’s Travels Summary Key words Glossary Gallery of personalities Solutions and suggestions for SAQs Further reading 96 98 98 98 100 103 103 103 105 105 107 107 110 110 111 111 113 115 116 117 118 118 118 119 121 123 123 124 125 127 128 128 129 130 132 132 133 134 134 135 136 136 136 137 139 139 140 142 142 143 iii 5 5.4.7. 5.3. 4.3. 4. 5. 5.4.2.2.
6. 6.2.4.1. 6.4.4.4. 6. 6.4. 6.1. 2 Solutions and suggestions for SAQs Further reading 144 145 146 148 149 150 150 151 151 153 153 154 154 155 156 158 158 159 161 161 162 163 166 166 167 168 170 171 171 173 173 174 176 177 216 6 6. English pre-Romantic poetry Unit objectives.4. The Task William Blake – the visionary artist Blake as a pre-Romantic poet Blake. 6.2. 3 Solutions and suggestions for SAQs Further reading Reader in seventeenth and eighteenth century literature Selected bibliography iv Proiectul pentru Învăţământul Rural .4.4.1. 6. 6.2.1. 6.Contents Gallery of personalities SAA No. 6. 6.4. 6.2. 6.2. 6.3.3.4.3.6. The Seasons William Cowper. 6.3.2.5.7.3.1.2.1.1. 6.2. 6.2.1.3. the Romantic visionary The theme of childhood in Songs of Innocence Ironic implications in Songs of Innocence The fall from Innocence: Songs of Experience Knowledge in the world of Experience The double vision in Blake’s Songs Summary Key words Glossary Gallery of personalities SAA No.
such as was presented in your Cultural Studies course. and on certain texts – will hopefully help you to overcome the relatively great temporal and cultural distance separating us from those centuries. How this course can help you The study of this course will widen your perspective on English literature and its evolution.Introduction INTRODUCTION 1. What this course is about This course is a brief introduction to English literature in the 17th and 18th centuries. and will highlight the contributions of their most representative literary personalities. Before starting your study. by encouraging your response to particular texts. It will thus contribute to the consolidation of your knowledge and understanding of British culture and civilisation. Fielding. but also to examine more closely particular texts by the most important authors (Shakespeare. Defoe. You are expected and urged to bring to the understanding of this extended literary period the knowledge acquired in your previous study. Milton. Blake. the study of the present course will more efficiently contribute to your professional becoming. It will familiarise you with the defining features of the literary trends and doctrines of these two centuries. among others). Literature is always an important testimony to the evolution of this spirit. but also an intimate acquaintance with the spirit of that culture and civilisation. Swift.” at helping you refine your perception of literary phenomena and categories. Course objectives As already mentioned. this course will give you a minimum of contextual detail. and to the enrichment of your grasp of the English language. a carrier of values. You will be able to build a general picture of the main literary achievements of this period. and an “agent” in the cultural dynamics in a country. In this way. Proiectul pentru Învăţământul Rural 1 . this course aims at enlarging your understanding of British culture and civilisation. 3. it would be helpful if you refreshed your acquaintance with the basic historical and cultural framework of the 17th and 18th centuries. Being concerned with aspects of literary history. 2. The double focus of the course – on general aspects of a particular period or doctrine. You must bear in mind that the teaching of a foreign language does not presuppose only a good command of its grammatical structures and vocabulary. It also aims at developing your “reading competence.
g. The solutions and suggestions for SAQs are provided in a separate section.g. the Restoration.lIntroduction This complex aim presupposes your development of certain specific competences. By the end of your study of this course. a list of key words. the Baroque. Each unit. is structured around a series of tasks that you must accomplish – the self-assessing questions (the SAQs). forming a chronological survey of the major literary developments in the 17th and 18th centuries. in a given text. you should therefore be able to: define the distinctive features. Neoclassicism. in its turn. Besides them. the Enlightenment • identify elements of continuity and discontinuity between these periods and movements • define the main features of an aesthetic-literary doctrine or type of literary sensibility (e. thematic and formal structure in the works of various authors. characterisation. a unit contains a series of “auxiliary” sections: a Summary. preRomanticism) • identify such features in the work of a particular author or in a particular text (e. or establish what links Fielding’s novels to literary Neoclassicism. 2 Proiectul pentru Învăţământul Rural . or what makes Blake a Romantic poet) • identify. Course content and structure This course is structured in six units of study. Some of the units also contain an assignment that you have to do and send to your tutor. as part of your overall assessment. a Glossary. the characteristic attitudes and concerns of such cultural-historical-literary movements or periods as the Renaissance. the values of a particular culturalhistorical or literary age • distinguish the proportion of originality and conformity to a tradition in a particular work or a given text • specify the contribution of the studied authors and their works to the evolution of literary forms and styles • describe and compare particularities of style. the Augustan Age. identify the features of the baroque sensibility in Shakespeare’s tragedies. • 4. and a Gallery of personalities.
• Unit 4 (The Restoration and the Augustan Age) deals with four major aspects: the comedy of manners during the age of the Restoration. the periodical essay of the 18th century as an important contribution to Augustan literature. Defoe.1. with main focus on Jonathan Swift. but also to your independent thinking and to your imagination. The main focus in this unit is on the imaginative structure and thematic interest of Milton’s masterpiece. engage you actively and in diverse ways in the process of study. • Unit 6 (English pre-Romantic poetry) introduces you to the poetry of sensibility of the 18th century as the illustration of an important literary tendency. H. the epic poem Paradise Lost. You will get acquainted with the contributions of four major novelists – D. S. The self-assessment questions (SAQs) The self-assessment questions in each unit have the role of helping you to structure and organise your study. The variety of these learning tasks will. and to draw your own conclusions. the literary doctrine of Neoclassicism. The major authors considered in this unit are Shakespeare and the poets John Donne and Andrew Marvell. • Unit 3 (The works of John Milton) emphasises Milton’s Christian humanism. and with the evolution of this genre. and insists on William Blake as both a pre-Romantic and Romantic poet. Sterne –. The SAQs encourage you to see your course work as more than a simple effort of memory (although the importance of memory in the process of learning must not be underrated). as well as major representatives. Richardson. and Augustan satire. with an emphasis on the evolution of genres and styles and their main representatives. The units of learning Unit 1 (The seventeenth and eighteenth centuries: intellectual and literary background) offers a general picture of the literary scene and its intellectual-cultural context.Introduction 4. hopefully. • Unit 5 (The Age of the Enlightenment: the rise of the novel) presents the main concerns and the typology of the novel as a dominant genre in the 18th century. They appeal not only to your memory. These tasks will guide you in the process of ordering your knowledge. and they will enable you to work with it in a specific context. • Unit 2 (The late Renaissance and the Baroque) deals with the emergence of the baroque sensibility in English late Renaissance literature. The unit surveys characteristic preRomantic themes and motifs. Fielding and L.2. The most common SAQs in this course will require you to: Proiectul pentru Învăţământul Rural 3 . • 4.
• A self-assessed question (SAQ) is signalled in the course text by this icon accompanying a textbox. The estimated length of your answers will be indicated as number of words / number of lines. after you have identified them in/after a provided short description • match a given literary fragment with a given paraphrase. in the literary text you were asked to work on. state its theme • comment on / interpret a given fragment. line. with the typological definition of a work.lIntroduction answer questions about the theme. narrative technique. Solutions and suggestions for SAQs You can check your answers to each SAQ by going to this section. fragment) • complete sentences. match incomplete statements so as to reconstruct an idea or a description • identify true/false sentences. etc. at the end of the unit. summarise its argument. A line in your textboxes is estimated to contain ten words on the average. characterisation. 4. if the case may be. and you are advised to read those instructions carefully and to follow them. symbolic elements. Do not get discouraged if some of your answers should not come near the suggestions offered at the end. etc. the title of a work. the independent intellectual effort that you are encouraged to put into your learning. an author’s work. Remember that what counts most is the process of thinking that leads you to a particular answer. You are required to solve these SAQs in the blank spaces provided for each of them in textboxes. etc. Try to analyse your errors and to become aware of everything you have missed in the instructions of the SAQ. so as to re-describe certain important aspects about a literary period or a particular writer’s work • fill in blanks with the features of a certain literary movement or style. You are strongly advised to resist the temptation of consulting this section before you have actually tried to do the exercises yourself. and. You are given detailed instructions about what is expected from you. 4 Proiectul pentru Învăţământul Rural . so as to obtain synthetic reformulations or rephrasings of relevant details about a literary period.. stylistic features. You are also given instructions about how to proceed if your answers differ significantly from the ones given in the section Solutions and suggestions for SAQs (see below). of a certain work or a provided fragment • explain the relevance or significance of a certain item (phrase. • paraphrase a given fragment from a studied literary work.3.
• Further reading. you will be sometimes returned to the Glossary of a previous unit to reinforce or refresh your understanding of them.4. These auxiliary sections are: the Summary and a list of key words. if necessary or desired. the notion of heroic couplet is explained in subchapter 1. but the phrase of which that word is part. which contains titles that should not be very hard to find in libraries. if you wish to supplement or clarify your knowledge • Proiectul pentru Învăţământul Rural 5 .3. for the Great Chain of Being*. the term Enlightenment. The materials indicated in the Further reading section and in the Selective bibliography (see below) offer you supplementary information. an asterisk must be understood to mark not just the word it is attached to. You may also be directed back to a certain subchapter in a previous unit. which will enable you to review and focus your knowledge. which is explained in the Glossary in Unit 1. when this notion is used again in Units 4 or 6. Some terms may recur in several units. in order to make sure you remember exactly what a term refers to.3. the Glossaries will send you back to 1. The terms included in the Glossary are marked by an asterisk (*) in the text of the unit. which includes basic information about the life and work of the mentioned personalities. • the Gallery of personalities (in the alphabetical order of the last names). not just Being. in which terms or phrases that have been considered difficult or unfamiliar to you are explained. with the pages where you may find relevant information. in Unit 1. you will look up the whole phrase in the Glossary. at the end. to organise it around the most important issues • the Glossary (in alphabetical order). other instruments meant to assist your study. Most of the books included there are available in any University library. For instance. whose Glossaries will send you back to the Glossary in Unit 1. which indicates a minimal bibliography for each unit.Introduction 4. • the Selective bibliography at the end of the course. For example. Sometimes. Thus.1. Auxiliary sections Each unit contains. will also appear in Units 5 and 6.1. You may ask your tutor to help you with the access to those sources.
The table below represents the place. don’t hesitate to use a good dictionary. while SAA no. especially the poetry texts. or misleadingly familiar to you are explained either in English or in Romanian. Assessment and evaluation Besides the self-assessment questions included in each unit. which contains the selection of texts you need in order to accomplish some of the course tasks. in which the words and phrases supposed to be unknown. the course contains three send-away assignments (SAAs). In any case. this should not take you too much time. 5. As we are dealing with 17th and 18th century literature. the number of tasks. and the weight of each assignment: 6 Proiectul pentru Învăţământul Rural . and make sure you understand its general meaning or basic ideas. try to read each fragment more than once. These first two SAAs will therefore consist in more than one task. The written test that you will sit at the end of the semester will add the other 60%.2 will cover units 4 and 5. before you start solving the task. This is why the same word may appear with different explanations/translations in several glossaries. The Reader The course is accompanied by a Reader. The given explanation or translation into Romanian applies only to the respective context. A send-away assignment (SAA) is signalled in the text by the icon accompanying this textbox. and 6. or one word may be given an explanation/translation different from the one you might be familiar with. If you should find these lexical notes insufficient for your understanding of a particular text. The cumulated weight of these SAAs in your final grade is 40%.5. As the texts are not very long. 1 will assess your knowledge of units 2 and 3. difficult.lIntroduction 4. which will enable your tutor to assess your performance in the course work. 5. The Reader provides you with little glossaries for each text. SAA no. The three SAAs are placed at the end of units 3. some of these texts might seem difficult to you.
You may. the tutor will take into account: • the degree to which your answer respects the formulated requirement. so pay special attention to the instructions for each task (30%). 2. If your level of proficiency is lower. 3. Most of the time. however. Note that a typewritten paper is likely to ease your tutor’s work. • the coherence.Introduction Unit Number of tasks and their weight in each SAA Weight of each SAA in the final assessment SAA no. and consistence of your ideas (40%) • the accuracy of your grammar (20%) • the accuracy of your spelling (10%) Each assignment must be completed and sent to the tutor in the allotted study week (see Your study schedule below). theoretically. Your study schedule This course is devised for 42 hours of study. Proiectul pentru Învăţământul Rural 7 . to go through each unit in approximately 4 hours. This is more likely to happen when you are required to work on literary texts. find your own rhythm and divide your study time into several sessions. your course work may take you more time. 1. 50% 50% 50% 30% 20% 100% 10% 20% 10% 40% In the assessment of each assignment. You can reserve two weeks for each unit of learning – which means that you are expected. half of the answer is already contained in the question. make sure you understand what is being asked of you in each assignment. clarity. 6. 1. 28 are meant for individual study of the course material (the solving of the SAQs included).1 SAA no. As in the case of the SAQs. If you have no possibility to type your assignment.3 3 5 6 2 3 1 1. whose reading may take you some extra time. Your ability to identify and use the knowledge required by a particular situation is part of what is assessed in any test. 6 hours are allotted to your tutorial meetings. Of these hours. 2. at least take care that your handwriting should be fully legible.2 SAA no. and 8 hours to the completion of your SAAs. Plan your study by taking into account that a semester has 14 weeks.
as the course provides you with the solutions and suggestions for SAQs at the end of each unit.1 2 Planning your course work is important as it will enable you to send your assignments to the tutor in due time. together. A provisional study schedule may look like this: Week Unit Number of study hours Assignment Number of hours for the SAAs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Introduction Unit 1 Unit 2 Unit 3 Unit 4 Unit 5 Unit 6 Revision 2 4 4 4 4 4 4 2 28 SAA no. list of key words. representative authors.lIntroduction The first and the last week should be reserved for the Introduction and. 5. glossary. whose content follows a chronological line. The course contains several auxiliary sections (summary. but which also focus on dominant genres and on outstanding. and 6. which you will find in the Reader accompanying the coursebook. of the evolution of literary genres. Each unit includes a series of self-assessing tasks (SAQs). forms and styles. 8 Proiectul pentru Învăţământul Rural . More information about the subjects in each unit is available in the selective bibliography which concludes the coursebook. a revision of the course material. It is structured in six units of study. Summary This course offers you an overview of the literary periods and trends. there are SAAs. and gallery of personalities). At the end of Units 3. You have the possibility to monitor your work by verifying your answers. Many of these SAQs require your response to a literary text. respectively.2 SAA no. along the 17th and 18th centuries in England. which you must write and send to your tutor. which will help you to organise and focus your knowledge. The three assignments will count. while the final written test will represent 60 % in your overall evaluation. according to a pre-established schedule.3 3 3 8 SAA no. as well as a list of suggested further reading. as 40% of the final grade.
1. 1. 1.3.1.1.4.4.The seventeenth and eighteenth centuries: intellectual and literary background UNIT 1 THE SEVENTEENTH AND EIGHTEENTH CENTURIES: INTELLECTUAL AND LITERARY BACKGROUND Unit Outline 1 1.4. 1. Unit objectives The seventeenth and eighteenth centuries: intellectual and literary background 10 10 10 10 11 12 12 13 15 16 17 18 19 19 21 21 23 24 24 28 30 30 Proiectul pentru Învăţământul Rural 9 .2.4.3.1.5. 1. 1. 1. 1. 1. 1.1.4. 1.4.2.2.1.1.5.1.4. 1. 1.3. 1.
a powerful flourishing nation. marked the entrance into modernity. The growing critical spirit enthroned a rationalistic attitude in all spheres of culture. The end of “high Renaissance” (the flourishing of the Elizabethan* Age) and the “late Renaissance”. social and economic life. cultural and literary aspects ♦ establish elements of continuity and discontinuity along the two centuries ♦ explain the process of literary “modernisation” along these two centuries through the evolution of styles and the dynamic of genres ♦ place various poetic. at the end of this period.The seventeenth and eighteenth centuries: intellectual and literary background By the end of this unit you should be able to: ♦ define the most important tendencies in the evolution of intellectual attitudes in the seventeenth and eighteenth centuries ♦ establish connections between the historical and intellectual context and the literary scene ♦ describe the major divisions of this long period according to historical. obscurantism and intolerance. seen as extending up to the Restoration* (1660) were periods of gradual but irreversible changes in modes of thought. as well as the faith in progress. in which the progress of England to modernity was steady in all fields. the year of the Glorious Revolution*. 1. science. The intellectual scene Along the two centuries. The Renaissance and the Enlightenment The seventeenth and eighteenth centuries constitute a complex period. The victory of Reason over dogmatism. literature. dramatic and prose genres and their main representatives in their proper literary-historical context within the seventeenth and eighteenth centuries Unit objectives 1. radical changes occurred in intellectual habits and preoccupations. of philosophical empiricism* determined to a great extent the attitudes to man in his relationship to society. of the Enlightenment. philosophy. The gradual achievement of political stability. attitudes and practices. the arts – all fields of human endeavour went through crucial transformations during the 17th century. as the Enlightenment is often described. which in England is in fact considered to have started in 1688. Culturally the two centuries correspond to two movements whose basic tendency was the emancipation of man: the Renaissance* and the Enlightenment*.1. mentalities. nature and divinity during the Age of Reason. religion. 10 Proiectul pentru Învăţământul Rural . The rise.1.1. in the latter part of the 17th century. Political. colonial expansion and an extraordinary economic development made England. The completion of this transition was to take place during the next age.
had important philosophical and theological implications: the universe was now conceived as a perfect mechanism. and it was essentially optimistic. the capacity of distinguishing right from wrong. In his work Novum Organum (1620) he explicitly states that “The true and lawful goal of the sciences is simply this. This new faith – Deism. a religious movement which aimed at reviving the Evangelical spirit and the ideal of Christian life. It was to be counter-balanced by the Evangelical Revival*. which could not offer spiritual comfort to the large masses of the poor and uneducated. in a systematic effort. The moral philosophy of the Deists argued that man was innately good.” 1. or Natural Religion –. John Locke Proiectul pentru Învăţământul Rural 11 .The seventeenth and eighteenth centuries: intellectual and literary background Francis Bacon It is also during these two centuries that modern science was born.2. to “overcome the mysteries of all the works of Nature” and to apply that knowledge “for the benefit of human life. Deism attempted to give a rational foundation to religious thought. Engaging in a variety of original scientific experiments. in 1662. that human life be enriched by new discoveries and powers. and which encouraged emotional effusion as a way of achieving communion with God. manifest in its rationally and experimentally discernible laws. in particular. working according to impersonal laws which testified to the supreme intelligence of the Creator. under the patronage of Charles II. His well-known maxim “Knowledge is Power” points to the utilitarian conception of the role of science.1. when The Royal Society “for the improving of Natural Knowledge” was founded. the “universal Architect.” God was seen as the prime cause of a harmonious universe. endowed with a sixth sense: the moral sense. One of the most ardent promoters of the new scientific spirit was Francis Bacon* (1561-1626). to reconcile Reason and Faith. The optimism of the Deists extended to human nature. Deists believed that the admirable order of the universe. Reason and faith in the Age of the Enlightenment The rationalism of the Renaissance and Enlightenment thought determined a reconsideration of the relation between Nature and Divinity and a new vision of the universe. The Royal Society endeavoured. combined the traditional confidence in the divine infinite wisdom with the intellectual spirit of the age. initiated by Isaac Newton and John Locke*. The scientific discoveries of Sir Isaac Newton*. a reaction against mysticism and obscurantism. which was left to develop by itself on the basis of these perfect laws. It was a highly intellectualised religious approach. It was a rational alternative to religious dogmatism. was an evidence of the creator’s good will.” This idea will be echoed several decades later.
when he declared: ”The proper study of mankind is Man. It was a general dedication to the cause of progress. The Royal Society was an institution concerned with the spreading of Neoclassical principles in art and literature.1. T F 2. 1. 1.1. appropriately. The Enlightenment continued the Renaissance faith in man’s perfectibility and sought for man’s emancipation both as an individual and as a social being. the awareness of the complex interdependencies in a modern civilisation made it necessary to reconcile the individual pursuit of happiness and freedom with the general wellbeing. T F 12 Proiectul pentru Învăţământul Rural . in the latter part of the Age of the Enlightenment.” The whole century was preoccupied with the idea of man’s happiness and of the improvement of man’s condition on earth. for each sentence. but also affective and instinctual. The Deist notion of innate virtue came to be connected with man’s capacity for feeling. The Enlightenment: an age of progress On the whole. T F 5. SAQ 1 The following exercise will help you revise some of the more important aspects concerning the intellectual and cultural background of the 17th and 18th centuries. Individual and social good was the object of all endeavours in this age. in his philosophical poem An Essay on Man (1733). and which prepared the way for the Romantic Age*. the central concern of the Enlightenment. which may be defined as the Age of Sensibility. The cult of Reason thus gave way to the cult of Feeling. to superstition and obscurantism. Read the statements below and identify the true ones. T F 4.4. The development of modern science and the rise of philosophical empiricism are major aspects of the process of intellectual modernisation in England in the 17th and 18th centuries. T F 3. The emergence of Deism was a reaction to religious dogmatism. the Enlightenment. From the Age of Reason to the Age of Feeling This infusion of emotionalism in spiritual life may be seen as the sign of a certain evolution in the temper of the 18th century. which made Enlightenment England a model of civilisation for the Western world. with its belief in the perfectibility of man. The interest in the constitution and workings of the human mind awakened the awareness that man’s response to reality was not only rational. Circle T (true) or F (false). The poet Alexander Pope indicated. The growing spirit of individualism. The Deist image of God as the “Universal Architect” reveals a rationalist-mechanicist conception of the universe.The seventeenth and eighteenth centuries: intellectual and literary background 1. continued the project of the Renaissance.3.
symmetry. and the literary field was no longer confined to the learned. The study and imitation of the great Latin and Greek authors and the concern with literary tradition as a reliable source of models made literature highly conventional. Jacobean* and Caroline* of the “high” and late Renaissance literature points not only to a temporal delimitation. the social diversification and the “unfixing” of the strictly hierarchical order of the Renaissance led gradually towards a “democratisation” of literature. to 1.2. but also to the close connection between the dominant literary values of those ages and Court life. There was a general care for discipline and refinement in composition. the decrease in the power of the Crown. including readers of more modest education. An overview of the literary scene in the 17th and 18th centuries From a literary point of view. with little or no classical knowledge. The Age of the Enlightenment excluded completely the interest in human feeling and emotion. for proportion.1. The absolute authority of the monarch made the Court the Influence of Court centre of intellectual and literary life. at the end of the unit. After 1688. Numerous treatises on literary art established norms and precepts. A new interest in rhetoric animated authors to pursue eloquence by a lavish use of figures of speech and the display of wit*. the great ages of the Renaissance and of the Enlightenment may be further divided according to various criteria.” T F Check your answers in the section Solutions and suggestions for SAQs. when the literary audience becomes more diversified. in one way or another. but also the ultimate arbiter life on literature in matters of literary and artistic fashions. for instance. and both writers and audiences were.1. and the accepted patterns and conventions were touchstones for literary virtuosity and originality. The Court was not only the catalyst of the emerging national feeling. T F 7. It was the main focus of literary attention. The abundance of classical Proiectul pentru Învăţământul Rural 13 .1. that the notion of reading public emerges now. and exalted Reason as the only defining human faculty. T F 8. It is significant. If you have failed to identify any of the sentences correctly as true or false. This is mainly connected with the rise of the middle classes and the growth of their cultural importance. 1. in the orbit of the crown. The 18th century is called sometimes The Age of Common Man.4. Alexander Pope pointed out the humanistic orientation of the Enlightenment in his maxim “The proper study of mankind is man. The Evangelical Revival shared with Deism the attempt to give a rational foundation to religious faith. The division into Elizabethan. read again subchapters. You may also need to revise some of the terms explained in the Glossary. with their Literature in the Age of Common Man cultivated taste.The seventeenth and eighteenth centuries: intellectual and literary background 6. The literature of the Renaissance was under the sign of the classical revival*. regularity.
The great French classical authors of the 17th century (Boileau. This led to the emergence Neoclassicism* in England. …the Augustan Age. Racine. The comparative merit of ancient and modern standards of literary excellence and learning became a central issue of critical debate. but also to the influence of the French authors of the great classical century – the age of Louis XIV. 2. Molière. English Neoclassicism must be linked not only to the survival of the Renaissance humanism. Complete each sentence in the provided space. …on literary taste and fashions during the Renaissance. This reflects. a. SAQ 2 Read the partial statements below and match them. in which the declining phase of the Renaissance was characterised by a return to the classics. so as to obtain complete sentences describing aspects of the general literary picture of the 17th and 18th centuries. a new consciousness of the relationship between literary tradition and modernity. when the merits of the “Ancients” and the “Moderns” became the object of comparison. 14 Proiectul pentru Învăţământul Rural . A significant aspect of Augustan literature is the development and importance of literary criticism. Pierre Corneille. during the Augustan Age*. Molière)…… d. …… c. Much of Renaissance literature. but they were resumed during the Restoration*. The relationship between tradition and modernity became a matter of literary consciousness during…… 1. the “Sun King” –: Nicolas Boileau. above all. England’s intellectual and literary exchanges with Catholic France had been suspended during the Civil War*. on the model of the French controversy known as the “Quarrel of the Ancients and the Moderns. Jean Racine. The mid-seventeenth century was an age of transition. Corneille.The seventeenth and eighteenth centuries: intellectual and literary background The Augustan Age: literary Neoclassicism allusions demonstrated the author’s erudition and required from the readers familiarity with classical learning. with its highly conventional forms and rhetorical style. The Court was the main source of influence…… b.” started in the late 17th century.
for instance. and it made extensive use of wit. in a variety of poetical forms: philosophical poems. In parallel. Apart from the classical poetic forms that survived into the Restoration and the Augustan Age. at the end of the unit. A remarkable poetic development in the first half of the 17th century was the metaphysical poetry (John Donne. the sonnet* – dominated Renaissance poetry. James Thomson. A “metaphysical” strain exists in Shakespeare’s final period of creation. The evolution of poetic forms The lyric.2. 1. in its various forms – the song*. which departed from the artificiality and poetry conventionalism of most Elizabethan poetry.g. by the Romantic poets. The most Renaissance lyric enduring poetic achievements of the early 17th century is the forms sequence of Shakespeare’s Sonnets (1609). Its name refers to a certain Metaphysical expressive strategy. It favoured conciseness. The common vehicle for it was the heroic couplet – two rhyming The Augustan heroic lines containing a complete statement. you need to revise subchapter 1. and the Puritan Andrew Marvell must also be included here. They approached other themes besides love: e. the blank verse* – on the model of Milton in his great Blank verse epic* Paradise Lost (1667) – was extensively used in the 18th century. It appealed both to the intellect and to the emotions. Its perfect mastery is illustrated by works like Pope’s didactic poem An Essay on Criticism (1711). …influenced English literary Neoclassicism. original or translated epics.3. Proiectul pentru Învăţământul Rural 15 . Check your answers by looking in the section Solutions and suggestions for SAQs. or meditative-descriptive poems like James Thomson’s The Seasons (1726-1730) or William Cowper’s The Task (1785). the ode*. The sonnet fell into disuse during the late Renaissance and it was revived only towards the end of the 18th century. or religion and politics – John Milton. The heroic couplet was the perfect verse couplet structure of the Age of Reason. …addressed itself to learned readers. concentration. Thomas Gray and William Collins (in the latter). the verse satire emerged as a novelty at the end of the 17th century and flourished during the next – John Dryden and Alexander Pope being its unequalled masters. religious faith – John Donne. or his philosophical poem An Essay on Man (1733). the pastoral* lyric. which are illustrative of a pre-Romantic* cross-current. John Dryden (in the former). combining classical restraint with force of argument and expressive clarity. Robert Herrick). Other lyric forms endured: the ode. George Herbert. continued to be used throughout the 17th and 18th centuries: John Milton. acquainted with the great classical authors and works.The seventeenth and eighteenth centuries: intellectual and literary background 3. conveyed by means of a rich variety of rhetorical effects. but English poets varied the highly conventional form of this kind of poem. 4. If you have failed to make the right match. tight logical coherence and striking imagery. Andrew Marvell. Thomas Carew. The chief model for The sonnet sequence Renaissance soneteers was Petrarch* and his love sonnets to Laura. Alexander Pope.
together with their most outstanding representatives. comparable perhaps only with the rise of the novel in the next century. SAQ 3 Which are the most popular kinds of poems in the 17th and 18th centuries? Mention at least six of them. at the end of the unit. a brilliant constellation of playwrights founded a dramatic tradition which represents the best and most original expression of the nation’s creative genius. It was the only form of literature which. the verse satires of Dryden and Pope (Unit 4). revise subchapter 1. a new appreciation of older poetic forms.3. we shall look more closely at some of the most representative poetic works of these two centuries: the metaphysical poetry of Donne and Marvell (Unit 2). and the “poetry of sensibility” which announced the coming of the Romantic Age (Unit 6). some of them of popular origin (the song. In the following units of this course. enjoyed a widely popular appeal. Drama in the 17th and 18th centuries The Renaissance was the Golden Age of English drama. The flourishing of English drama during the Renaissance is a unique phenomenon. through its representation on stage.The seventeenth and eighteenth centuries: intellectual and literary background Towards the end of the century. in the space left below. If there should be major differences between them. 16 Proiectul pentru Învăţământul Rural .4. In little more than half a century (1580-1642). the ballad) and the increasing hostility to the artificiality and conventionalism of Augustan poetic diction* heralded the shift in taste which marked the beginning of Romanticism. 1. Compare your answer with the one provided in the section Solutions and suggestions for SAQs.
while others changed. A particular type of protagonist became fashionable in revenge tragedies: the villain. 1. John Ford (‘Tis Pity She’s a Whore. Unlike Senecan plays. but the spirit of the great tradition was never recaptured. sensational and macabre. with his exploration of the darkness of strange passions. 17 Revenge tragedy The villain in revenge tragedy Proiectul pentru Învăţământul Rural . The great age of English drama ended abruptly in 1642. 1607). exploiting excessively morbid ingredients like incest.The seventeenth and eighteenth centuries: intellectual and literary background Contemporary reconstruction of a Jacobean playhouse The play-house. and this “unholy alliance” between crown and stage increased the intransigence of the Puritans. The dramatic genres popular during the Renaissance were extremely diverse: tragedy and comedy with their varieties. 1614). Some dramatic forms went out of fashion. sometimes he rights the wrong done to another. is the most gifted. tragi-comedy. The great acting companies were under the patronage of the king. pastoral drama. Shakespeare’s Hamlet (1601) is the finest illustration of this kind of tragedy. They were generally. but destroys himself along with his enemies. drama witnessed a decline. daring and wit. masque*. In such plays. murder. On the whole. each variety of spectator responding to the performance according to his/her education and imagination. as well as John Webster’s heroine in The White Devil. play-houses were reopened. who usually appears as a ghost on the stage. and the rhetorical manner. Thomas Middleton (Women Beware Women. where bloody deeds were only evoked through an efficient rhetoric of the dramatic discourse.4. was a miniature of the English society. Milton’s Satan. etc. Masters of this genre were the Jacobean dramatists Cyril Tourneur (The Revenger’s Tragedy. 1605-6). treachery. Renaissance playwrights borrowed the five-act structure. the fundamentally evil hero/heroine. historical drama. inspired by the plays of the Roman Stoic Seneca*. 1612) and especially John Webster (The Duchess of Malfi. built around the theme of revenge. and in the 18th century it was replaced by the novel in popularity. rape. In 1660. with the restoration of monarchy. the sensational plot. Jacobean and Caroline plays usually represented atrocities on stage. The type of the villain is the descendant of the Devil in the mediaeval Mystery plays* and a forerunner of the arch-villain in English literature. Of the Caroline playwrights. They saw the theatre as a source of moral corruption through the “idle” pleasure that it offered. to accommodate the tastes of a new public.1. or Vittoria Corombona (1612) are among the most accomplished portrayals of the villain in drama. insanity. 1633). with its audience arranged according to rank. fascinating through unbounded ambition. in Paradise Lost. the wronged hero plans revenge. From Senecan tragedy. Shakespeare’s protagonist in Richard III (1592-3) and Lady Macbeth (Macbeth. Jacobean tragedy One of the most widespread forms of tragedy was the revenge tragedy. when the Puritans* closed the theatres.
in miniature. 1. 18 Proiectul pentru Învăţământul Rural . The Alchemist (1610) and Bartholomew Fair (1614) are social comedies of city life. though each in a different way. identifying the four true ones.4. T F 5. circle the appropriate letter: T (true) or F (false). The English play-house during the Renaissance accommodated a diverse audience. whose fall from eminence marks the destruction of an order. dealing with middle or lower class life and concentrating on personal and domestic maters – unlike “grand” tragedy. His best plays. T F Check your answers by looking in the section Solutions and suggestions for SAQs. T F 7. the satirical comedy. T F 2. in Paradise Lost. at the end of the unit. The Jacobean and Caroline authors of revenge tragedies had Seneca as their model. Renaissance tragedy had four acts – a structure borrowed from Seneca. T F 6. centred on the theme of love. Epicoene. Milton’s Satan. read the following statements. read again subchapters 1. T F 4. as in Shakespeare’s Troilus and Cressida (1601-2) or The Winter’s Tale (1610-11). Volpone (1606).The seventeenth and eighteenth centuries: intellectual and literary background A distinct type in late Renaissance drama is domestic tragedy. If you have failed to identify the true statements. with its noble characters. Comedy in the early 17th century In the field of comedy. as in All’s Well That Ends Well (1602-3) or Measure for Measure (1604-5). or at least tinged with bitterness. but.4. a genre which will survive into the 18th century. The mixture of serious and comic elements results in tragicomedy. Ben Jonson* illustrates another form. and 1. T F 3. SAQ 4 For a revision of some important features of Renaissance English drama. the hierarchy of English society. or The Silent Woman (1609).2. The hero of revenge tragedy often destroys himself in his desire to right a wrong done to him or to another. Shakespeare and Ben Jonson are the great masters. For each sentence. intended to correct vices and follies by denouncing them.4. reminds of the fascinating villain-heroes of the Renaissance revenge tragedies by his extraordinary ambition and boldness. Shakespeare’s Hamlet is a classic example of domestic tragedy. or in Philaster (1609) by John Fletcher and Francis Beaumont. his comedies become darker. Shakespeare’s Elizabethan phase included a number of exquisite romantic comedies.1. in the last period of creation. reflecting. Seneca’s tragedies inspired Jacobean and Caroline authors in the representation of atrocities on stage. 1.
Oliver Goldsmith (The GoodNatured Man. or The Life and Death of Tom Thumb the Great (1731). It lacked the latter’s liveliness and brilliance. Henry Fielding). with idealised heroes and heroines divided between love and honour or duty. Heroic drama The comedy of manners 1. George Villiers. The main representatives – the Restoration Wits* – were courtiers and aristocrats who assumed the role of leaders of fashion and taste.3. a stylish and sophisticated world. and Richard Brinsely Sheridan (The Rivals. with their grandiose declamations and artificial conception of heroism. A more representative achievement of the Restoration is the comedy of manners. were a passing extravagance. Restoration comedy presented an elegant society.The seventeenth and eighteenth centuries: intellectual and literary background 1. 1775. but serious drama declined during the 18th century. Duke of Buckingham. too. In The Rehearsal (1671). which ridiculed them through exaggerated imitation. mocks at certain theatrical conventions. who demanded models of virtue and decency. for instance. John Gay. The feeling that some dramatic forms were out of their time and were maintained artificially led to the emergence of a burlesque* kind of comedy. but whose aim was not so much to correct manners as to entertain.4. Heroic plays. and it denounced puritanical virtue as hypocrisy. Tragedy was replaced in popular taste by a form that stood in sharp contrast with the unheroic spirit of the age: heroic drama. 1669-70). Drama during the Restoration period Restoration drama developed in an age of scepticism and cynicism. She Stoops to Conquer. 1773). or The Mistakes of a Night. The best achievement in this genre belongs to John Dryden (The Indian Emperor. 1768.4. but also of French and Spanish romantic novels of adventure. satirises heroic tragedy and so does Henry Fielding in his successful parody The Tragedy of Tragedies. but it appealed to a wide middle class public. The Conquest of Granada. The School for Scandal.g. There were a few attempts to revive classical tragedy or domestic tragedy. 1722). in his satirical play The Beggar’s Opera (1728). Sentimental drama and burlesque comedy in the 18th century The drama of sensibility – with sentimental comedy as its dominant type – emerged as a reaction to the Restoration comedy. Alexander Pope) and in the novel (e.4. 1777).g. which continued the realistic spirit of the earlier satirical plays. The most representative works of this kind belong to Richard Steele (The Conscious Lovers. The painful intensity of Renaissance tragedy did no longer move the hearts of audiences that either were too frivolous or whose mind had been subtly influenced by Puritan morality. Proiectul pentru Învăţământul Rural 19 . of pleasure-seeking and relaxation after the strict moral code imposed to the nation by the Puritans. Richard Cumberland (The Brothers. these plays built a world of high passion and incredible bravery. 1665. Under the influence of French tragedies. 1769). This parodic spirit was not confined to drama: the mockheroic style* was also used in poetry (e.
we shall focus on William Shakespeare’s later plays. Two moments in the evolution of English drama will be further detailed in this course: in Unit 2. 20 Proiectul pentru Învăţământul Rural . at the end of the unit. Compare your answer with the one provided in the section Solutions and suggestions for SAQs. together with their most outstanding representatives.4. and in Unit 4 you will be acquainted with more features of Restoration comedy.4.2.4. to 1. If there should be major differences between them.The seventeenth and eighteenth centuries: intellectual and literary background SAQ 5 What are the main varieties of comedy during the 17th and 18th centuries? Mention at least five of them in the space below. revise subchapters 1.
contributing essentially to the forging of a more straightforward and simple style. as the growing complexity of life increased the need for social and intellectual communication. John Locke Proiectul pentru Învăţământul Rural 21 . gave way to an ideal of prose style more suited to the Age of Common Man. Here. The rhetorical extravagance and ingenuity which had still dominated the early 17th century (not only in prose). The development of an aphoristic style*. The Pilgrim’s Progress Among the prose forms widely used for intellectual argument. displaying a variety of styles. blending concision with wit.The seventeenth and eighteenth centuries: intellectual and literary background 1. prepared the English language for a variety of uses: in scientific. weaknesses. religious writings are particularly important. with its illustration to simplicity and natural flow of common speech. struggles and William Blake: aspirations. English as an instrument of literary and intellectual communication still competed with classical Latin. Francis Bacon was the first notable writer to plead for – and to illustrate – a prose style more suited for intellectual argument. More and more. 1612. prose works written in English displayed a highly rhetorical style. deliberately artificial and intricate. influenced immensely Bunyan’s the language of prose. Later in the century. another Latin influence began to mould English prose style: that of Seneca and Tacitus*. The English translation of the Bible – the “Authorised Version” of 1611. Gradually. Francis Bacon’s Essays (1597. Influence of Latin on prose style The prose of intellectual argument 1.1.5. accomplished under the patronage of James I – established a model of English whose beauty. Journalism as a form of prose writing emerged during the Civil War and flourished during the 18th century. the virtues of common speech permeated the language of all kinds of writings. Varieties of prose writing in the 17th and 18th centuries Of the literary forms that contributed significantly to the development of English prose. wealth and freshness greatly influenced the language of prose. he describes the Christian soul’s search for salvation in the form of an allegorical journey along the path of life. A different vein in religious writing is illustrated by the Puritan John Bunyan (1628-1688) and his extremely popular book The Pilgrim’s Progress (1678). the essay* proved the most flexible. suitable for conveying “the knowledge of things” and intelligible to the average Englishman. Thomas Hobbes* and John Locke also insisted on the necessity of a language at once flexible and precise. the universal language of the Renaissance. on clarity and rationality. in political tracts and pamphlets.5. Under the influence of Latin – especially of Cicero* –. The evolution of prose style At the beginning of the 17th century. 1625) are prose classics in English literature. This allegorical expression of Puritan faith. The language of prose tended to become plain and transparent. with its trials. in which rhetorical figures were subordinated to rational lucidity. Sermons were a widely popular form of prose-writing. a precious and highly ornate language. temptations. philosophical and theological writings.
with its explorations of the complexities of human mind and character. a prose genre whose model was provided by the Greek writer Theophrastus*. Samuel Purchas). Grace Abounding to the Chief of Sinners. in An Essay Concerning Human Understanding (1690). In the 17th century.” 1642) are the most outstanding representatives of this genre. To these must be added the character. Like drama. whose purpose was didactic or satirical. the biography as an emerging prose genre. pamphlets* (e. with his Life of John Donne among other works of this kind – 1670). Joseph Hall inaugurated the English tradition of this genre. Samuel Pepys). Robert Burton (The Anatomy of Melancholy. letters. which analyses the constitution of human society. but its impressive intellectual architecture is achieved in a simple. the spiritual autobiography and the “character” were literary expressions of the growing interest in human individuality. Human character as portrayed in their essays was at the same time typical and individualised. aphoristic style. The character as a prose genre influenced Richard Steele and Joseph Addison in their periodical essays. unadorned style. 1632 – the most virulent Puritan attack on the theatre. Anatomies were monuments of learning.g. inclusive character is displayed by Thomas Hobbes’s Leviathan (1651). diaries (John Evelyn. 1644 – a famous defense of the freedom of the press). delighting in speculation and building the knowledge they explored into an elaborate structure. The same encyclopaedic. exhausting the subjects they dealt with. 1666). Milton’s Areopagitica. another form of prose writing which displayed divergent tendencies in style was the anatomy. the great literary achievement of the 18th century. biographies (Izaak Walton. etc. “The Religion of a Doctor. “Characters” were miniature portraits of human types. with Characters of Virtue and Vices (1608). William Prynne’s Histriomastix. executed in a witty. 22 Proiectul pentru Învăţământul Rural . A variety of other prose genres developed during the 17th century: historical and geographical accounts (Walter Raleigh.The seventeenth and eighteenth centuries: intellectual and literary background Frontispiece to Leviathan provides another example of this prose form – this time in booklength – as a vehicle for analysis of ideas and intellectual demonstration. of remarkable precision and force. 1621) and Sir Thomas Browne (Religio Medici. spiritual biographies (John Bunyan. This kind of approach had a considerable influence on the realistic novel. which anticipates the prose of the Neoclassical period.
Culturally. Summary This unit has offered you a brief introduction to the intellectual and literary developments of the 17th and 18th centuries. the growing scepticism and critical spirit enthroned a rationalistic attitude in all spheres of culture..5. and 1. Compare your answer with the one provided in the section Solutions and suggestions for SAQs. since both place Man and the improvement of his condition at the centre of their concerns. Within these two centuries. the progress from the old order of the feudal world to the modern age was completed. obscurantism and intolerance. in a paragraph of no more than 7 lines / 70 words. A steady process of economic development and imperial expansion made England the world’s greatest power. at the end of the unit.The seventeenth and eighteenth centuries: intellectual and literary background SAQ 6 In what direction did English prose style tend to develop along the 17th and 18th centuries? Answer in the space below. roughly. The following units will detail some aspects concerning the development of prose in the two centuries: in Unit 4. Within these two centuries. This was a period of great changes at all levels of life in England. as well as the faith in progress. these two centuries correspond. between which there is continuity.1. If there should be major differences between them. modern science was born. more carefully. you will learn more about the periodical essay. read again subchapters 1.5. while Unit 5 will deal entirely with the novel in the 18th century. marked the entrance into Proiectul pentru Învăţământul Rural 23 . intellectual habits and preoccupations changed radically: philosophic thought became secular. to the great movements of the Renaissance and the Enlightenment. The victory of Reason over dogmatism. the image of the universe was changed.
part of the process of modernisation that the Age of Reason came to acknowledge its own limits. often by means of paradox. noble and heroic characters. used to express observations of general truth. and a major influence on their aesthetic ideal. which are reduced to the comically trivial. The Great Latin writers of that age – Horace. Proiectul pentru Învăţământul Rural • • 24 .D. of the time of emperor Caesar Augustus (27 B. elevated style. in a caricatural spirit. however. from a system of genres and styles dominated by classical influences to a more “democratic” tendency. From a literary point of view. The birth of the novel is the most significant literary development of this “Age of Common Man.C. It is. burlesque: the exaggerated imitation. blank verse: unrhymed verse. drama and prose in the 17th and 18th centuries has been meant to offer you a general idea of the literary background of this extremely diverse and dynamic period. Augustan Age: a phrase designating the period of English Neoclassicism (extending from the Restoration to the latter half of the 18th century) by analogy with the golden age of Latin literature. and the emergence of the Age of Feeling prepared the way to the Romantic sensibility.The seventeenth and eighteenth centuries: intellectual and literary background modernity. predominantly middle-class. Ovid. Virgil – were revered models for the English Augustan writers.). with new genres accessible to a more inclusive reading public.-14 A. Key words • • • • • • • • • • • • • • • • The Renaissance The Enlightenment The Restoration The Age of Reason The Age of Common Man The Age of Feeling The Augustan Age Neoclassicism modernity tradition change emancipation progress poetry drama prose Glossary • • aphoristic style: (from Greek aphorismos: definition) a style characterised by condensation and precision. a slow transition took place.” The short review of the dominant forms of poetry. of serious action.
The founders of English empiricism were Thomas Hobbes (1588-1679) and John Locke (1632-1704). or from history. social and moral thought.C. • epic: long narrative poem celebrating the achievements of heroic personages. The founder of the revival of classical learning was Petrarch (see note below). characterised by anti-dogmatism and the cult of reason as the supreme guiding principle in human action. social contract. Montesquieu. David Hume (Britain). individual liberty. when it was restored. • Enlightenment: ideological and cultural movement in the 18th century in Europe and America. Thomas Jefferson. The open conflict between king and Parliament set the whole nation to war. Thomas Paine (the United States) are among the great representatives of this movement. legend. The subjects and heroes are taken either from myth. Concepts like human rights. It is one of the most flexible and adaptable prose forms. anti-obscurantism. humanism. In a broader sense. until 1660. civil rights. the conviction that reality is ordered according to laws that are accessible to human reason).The seventeenth and eighteenth centuries: intellectual and literary background Caroline: (from Latin Carolus) related to the reign of Charles I Stuart (1625-1642) • Civil War (1642-1649): the pivotal event of the 17th century. pragmatism. • Elizabethan: related to the reign of Elizabeth I (1558-1603). state church) as a reaction against the Proiectul pentru Învăţământul Rural 25 • . John Locke. • classical revival: the intellectual. separation of powers were central to Enlightenment political. reconciling a materialist account of reality with a rationalist attitude (i.): “Man is the measure of all things”. by the promotion of intellectual emancipation and the belief in social and moral progress. Tolerance. it evokes an attitude to life which stresses the individual’s dignity. anti-fanaticism. Thinkers like Thomas Hobbes. the humanism of the Renaissance refers to a view of life which we find summarised in the maxim of the Greek philosopher Protagoras (480-410 B.e. the folk tradition. widely used in all ages. artistic and literary life of the Renaissance was defined by a revived interest in the classical culture and its ideals. in which personal opinions and observations are presented in a formal or informal manner. Diderot (France). • empiricism: a philosophical orientation which established the primacy of experience in the process of knowledge. Rousseau. and by the search for a model of society in which man’s rights and duties should be exercised in freedom. • Evangelical Revival: a trend which started within the Anglican Church (the official. and contributed to the intellectual preparation of the French Revolution (1789). worth and capacity for self-accomplishment. which began as an educational programme (the humanities – humaniora) propagating those values in Greek and Latin culture which could be harmonised with Christian values. illustrating the close link between religion and politics in English history. rejection of arbitrary authority and of absolutism are some of the characteristic attitudes of this age. This return to the Ancients is the foundation of Renaissance humanism. • essay: a prose composition of varying length. The victory of the Parliamentary forces led to the abolition of monarchy in 1649. Voltaire. natural law.
spectacular scenic effects. restraint. and it was often a device of parody and of burlesque. mystery plays: early popular forms of English drama (13th to 16th century) developed out of the Liturgy of the Church and enacting biblical events.The seventeenth and eighteenth centuries: intellectual and literary background • • • • • • • • • excessive rationalism in matters of faith. who was a Catholic. and soon developed into a distinct religious orientation. This religious orientation developed into a church: the Methodist Church. singing and dancing. to its need for clarity and its aspiration to universality. an idea. masque: courtly entertainment in dramatic form.) and the Latin poet Horace (658 B. In English literature. sumptuous costumes and settings. idealising shepherd life and creating a nostalgic image of a peaceful. the marginal sections of society. The Greek poet Pindar (522-442 B. and corresponded to the rationalistic spirit of the 18th century. expressing lofty sentiments and thoughts regarding an event. The most famous author of masques in the 17th century (when the genre flourished) was Ben Jonson. involving elaborate dialogue. Glorious Revolution: in 1688. The accession of William III (of Orange) and his wife Mary (James’s Protestant daughter) marked the beginning of constitutional monarchy in England (monarchic power was limited and the Parliament’s prerogatives increased). but also in Proiectul pentru Învăţământul Rural 26 . with an elaborate stanza structure and a dignified. whose authors were deeply revered and were recommended as models. decorative art. and harmony of classical art. pamphlet: a short prose work on a subject (often political or religious) that the author defends polemically. who collaborated with the equally famous architect and stage designer Inigo Jones. founded by John Wesley in the 1740s. uncorrupted life. The origins of pastoral are in the work of the Greek poet Theocritus (316-260 B. Its conventions may be found not only in lyric poetry. The actors used masks and personified pastoral or mythological figures. often of an allegorical nature. a person or an object. pastoral: a literary composition on a rural theme. The basis of this kind of faith was the Gospel (the New Testament) and its revealed truth.C. solemn style. It was used in order to make a trivial subject seem dignified and impressive.). painting and sculpture. simple. from the Creation to the Ascension. Neoclassicism flourished in the latter half of the 18th century and the beginning of the 19th. was forced to leave the throne and fled to France. in harmony with nature. Neoclassicism: an aesthetic doctrine inspired from classical Antiquity (especially Latin). The term also refers to the form in which such a work was published: a booklet with paper covers. In architecture.C. James II Stuart. encouraging a personal experience of conversion. It addressed itself to the poor. mock-heroic style: a style mocking the serious grandeur of the epic. ode: an extended lyric poem. the Neoclassic period is taken to cover almost a century (16601780). Jacobean: (from Latin Jacobus) related to the reign of James I Stuart (1603-1625). of spiritual regeneration by grace. Neoclassicism meant a return to the purity.C.) are the great ancient models for English writers.
effort. Francis Bacon (England). implied the idea that the language of poetry is different in quality from ordinary language. 27 Proiectul pentru Învăţământul Rural . Prominent figures of the Renaissance are Petrarch. Restoration Wits: the generic name for the Restoration dramatists. Their beliefs and convictions. Romantic: the Romantic Age in England is usually considered to extend from the end of the 18th century to the 1830s. centred on integrity. Restoration: historically. Cervantes (Spain). selected according to genre and subject. its limits are less well defined. Sir Charles Sedley. It refers to the particular kind of language – vocabulary. Lope de Vega. 1492). It is sometimes seen as extending to the end of the 17th century. Philip Sidney. Duke of Buckingham. Tasso (Italy). Leonardo da Vinci. “The poetry of sensibility” is another generic term for these pre-Romantic tendencies. poetic diction: a term that. who rejected the authority of the English Church because. in the 16th and 17th centuries. consisting in a tremendous development and transformation in all spheres. The most outstanding of the Restoration Wits (or Court Wits) were George Villiers. The Puritans insisted on man’s duty of actively serving God and on his responsibility towards his own conscience. which was to play an essential role in the rise of capitalism. Puritans: members of a Protestant religious group. the sense of purpose. Machiavelli. They propagated a doctrine of spiritual equality and cultivated a stern morality. by Columbus. Pico della Mirandola. From a literary point of view. which was the ultimate authority in the interpretation of God’s word in the Holy Scriptures. William Wycherley. Ariosto. in their view. style – used by a poet.g. It was characterised by a remarkable flourishing of arts and literature. pre-Romantic: the term is sometimes used to refer to the literary tendencies which accompanied the rise of the cult of Feeling in the 18th century. John Vanbrugh. Thomas More. for the Neoclassic writers. and brilliant accomplishments in scholarship and science. thus. favoured the growth of individualism. it was the period of Charles II’s reign (1660-1685). Raphael. Renaissance: cultural movement which started in Italy in the 14th century and spread to Europe in the 15th and 16th centuries. on the enlargement of his knowledge of himself and of nature. It is the period of transition from the Middle Ages and the feudal order to early capitalism. when monarchy was re-established in England after the Puritan rule (1649-1660). Shakespeare. Edmund Spenser. it overlaps with the Augustan Age. industry. of the rebirth of learning. Sir George Etherege. tone. The Renaissance was the age of the great geographical discoveries (e. it had not fully reformed itself. romance or the novel. Desiderius Erasmus (Holland). “Wit” designates here the person who displays liveliness and brilliance of spirit. of the expansion of education. of America. It placed emphasis on the individual’s spiritual autonomy and creative potential. Boccaccio. and of the awakening of the reformist spirit. and they continued to be used in the 18th century. which opened the modern era. especially their work ethics.The seventeenth and eighteenth centuries: intellectual and literary background • • • • • • • drama.
In mediaeval and Renaissance physiology and pathology. Gallery of personalities • Bacon. Sometimes. Renaissance dramatists used songs in their plays to create a particular atmosphere. Astrophil and Stella. choleric and melancholic – were seen as the result of the dominance of one of these humours. The New Atlantis (published in 1627). the belief in the spiritual correspondence between man and nature. Jonson. surprising associations. with or without musical accompaniment. in the 17th century it came to mean fancy or liveliness of thought and imagination. Edmund Spenser. the founder of modern rationalist materialism. the emphasis on the spontaneity of poetic inspiration are also among distinctive features of Romanticism.C. 1591. 1591-1595). and black bile – or melancholy) were believed to determine a person’s disposition and character.The seventeenth and eighteenth centuries: intellectual and literary background • • • Romanticism is a European cultural and literary movement. His literary work includes a series of essays on a wide variety of subjects. philosopher and writer.e. phlegmatic. the capacity or talent of making unexpected. phlegm. Marcus Tullius (106-43 B. The assertion of the self.): Roman statesman. Cicero. wit: intellectual brilliance and ingenuity. During the Renaissance. as well as an unfinished utopia. and a writer. it meant intelligence or wisdom. The four traditional temperaments – sanguine. which emerged in Britain in the context of the sympathy with the struggle of the American colonies for independence from British domination (1775-1781). This theory had a great influence on the conception of character in the 16th and 17th century comedy. two fine examples of comedy of humours. according to a dominating inclination or passion. in which the characters act. Amoretti. sonnet: a poem consisting of 14 lines. His famous political speeches and writings Proiectul pentru Învăţământul Rural • • 28 . Francis (1561-1626): the most influential thinker of the English Renaissance. orator. The tradition survived into the 18th century. poet and scholar. The Romantic spirit is usually associated with the championship of progressive social and political causes. one of the most influential literary voices of his age. and with the French Revolution (1789). Ben (1572-1637): dramatist. independently of circumstances. the quality of a writing that displays this capacity. with Every Man in His Humour (1598) and Every Man Out of His Humour (1599). in which he anticipates many of the later conquests of modern science. the promoter of the new scientific spirit. The sonnet sequence/cycle was frequently used during the Renaissance (Sir Philip Sidney. He started his literary career as a playwright. song: a poem composed for singing. the four “humours” (i. fluids) of the body (blood. and a firm believer in man’s creative potential. with various rhyme patterns. yellow bile – or choler. Romanticism reacted against the rationalist empiricism of the Enlightenment by an intense idealism and the cult of Imagination as man’s supreme faculty of the mind. He was also an eminent statesman.
chief figure of the scientific revolution of the 17th century. Locke studied medicine. the “body politic” created in perfect analogy with the “body natural” of “that rational and most excellent work of nature. He laid the foundations of the differential calculus. that determines man to surrender part of his natural rights to the authority of a civil government. but he was interested in a variety of intellectual fields: philosophy. or the Matter.D. whose conceptions were profoundly influenced by the development of physics and mathematics. Theophrastus (372-287 B. the latter. It is fear of death. for instance. Locke.): Greek philosopher and naturalist. author.): Roman philosopher. and his political doctrine inspired the American constitution. the instinct of self-preservation. Tacitus. Lucius Annaeus (4 B. and man’s agreement to submit to a governing authority is an expression of that freedom.D. greatly influenced by Hobbes. For Hobbes. His political philosophy.C. and Hobbes describes this generalised state of war by the famous formula “homo homini lupus” (“man is wolf to man”). Ecclesiastical and Civil (1651).” A fundamental problem for Hobbes is that of the foundation of the social and political order. Form and Power of a Commonwealth. astronomer and philosopher. must guarantee man’s natural right to liberty and life. Hobbes applies rationalist-materialist principles to the explanation of human nature and society. of the first treatise of ancient philosophy. John (1632-1704): considered the “father” of English empiricism. Hobbes. Publius Cornelius (55-120 A. Locke insists on the mutual obligations of the individual and the instituted authority. mathematician. Proiectul pentru Învăţământul Rural 29 . economics. writer and statesman.-65 A. Man. Thomas (1588-1679): materialist philosopher. humanity in the state of nature is driven by aggressive competition. unlike that of Hobbes. ethics. besides the Characters.C. Petrarch: Francesco Petrarca (1304-1374). Newton. whose concise and trenchant style inspired 17th century English prose writers. studied the mechanics of planetary motion and formulated the law of gravitation. politics. religion. the laws and regulations of human society imitate the laws of nature: the “great Leviathan” is the State. Italian poet and humanist. insists on man’s perfect freedom in the state of nature. Both Hobbes and Locke can be seen as the initiators of the “social contract” theory. which was central to Enlightenment thought. made important discoveries in the field of optics. Isaac (1642-1727): English physicist.): Roman historian and statesman. According to him. Locke was a firm supporter of the Glorious Revolution and of constitutional monarchy. in a kind of social contract. the initiator of the revival of the study of ancient Greek and Latin literature. Seneca. In his work of moral and political philosophy Leviathan.The seventeenth and eighteenth centuries: intellectual and literary background • • • • • • • on rhetoric and style provided a model of eloquence in prose.
Blake the ode: Marvell. Herbert. there was a tendency towards simplicity. John Gay Further reading 1. Dryden. Sir George Sedley. English Literature and Civilisation. 5.T. Dryden. Goldsmith. Editura Universităţii Suceava. . Thomson. 2. 1983 (pp. c. d. Fletcher and Beaumont satirical comedy: Ben Jonson.T. Milton.The seventeenth and eighteenth centuries: intellectual and literary background Solutions and suggestions for SAQs SAQ 1 1. 3. Gray the epic: Milton metaphysical poetry: Donne. Herrick. concision and plainness: from the highly ornate.4. 7-49) 3. 5. Editura Universităţii Suceava. 115-141) 30 Proiectul pentru Învăţământul Rural . 6. 2003 (pp.T. Sheridan sentimental comedy: Steele. 3.F SAQ 5 • • • • • • • SAQ 6 In general. Cumberland burlesque comedy: George Villiers.F. Luminiţa Elena.F. Marvell. From Beowulf to Paradise Lost.T.3.T. Pope. Pope. The Literature of the Beginnings.2. Collins. Carew.T SAQ 2 a. Goldsmith. William Wycherley. John Vanbrugh). from a highly rhetorical style to forms of expression which aspired to the plainness of common speech. even extravagant style of the Renaissance to the simple elegance.F. Ioan-Aurel (ed. Pope didactic poems: Pope philosophical poems: Pope descriptive-meditative poems: Thomson. Cowper romantic comedy: Shakespeare dark comedy: Shakespeare tragi-comedy: Shakespeare. The Renaissance and the Restoration Period.T. Macsiniuc. the sonnet: Shakespeare. Sir George Etherege. 2003 (pp. Donne.). Fielding. Cowley. The English Eighteenth Century. Bucureşti: Editura Didactică şi Pedagogică. 6. artificial. 8. 4. 7. Preda.1 SAQ 3 • • • • • • • • • SAQ 4 1. precision. The Novel in Its Beginnings. Goldsmith comedy of manners: the “Restoration Wits” (George Villiers. Cornelia. 9-32) 2. Turcu. clarity and straightforwardness of the Augustan style. Milton the pastoral: Milton. Marvell satire: Dryden. b. 4.F. Duke of Buckingham.T.T. 2.
1. 2.3. 2. 2. 2. 2. 2. 2.2. 2. 2. His later plays The baroque spirit of Shakespeare’s great tragedies Hamlet: a revenge play Renaissance man and the baroque sensibility in Hamlet Hamlet: the philosopher vs.3.3. 2. 2.4.11. 2.5.3.3.8.2.5.2.6.3. 2.6.2.1.2.3.4. 2.2. 2.The late Renaissance and the Baroque UNIT 2 THE LATE RENAISSANCE AND THE BAROQUE Unit Outline 2 2.2.10.2.3.2. 2.2. 2.2.2.7. 2.2. 2.3.2.1. 32 32 32 33 33 35 36 37 37 38 39 40 40 43 43 44 46 46 47 48 48 49 50 52 53 54 54 56 56 57 58 59 61 Proiectul pentru Învăţământul Rural 31 . 2. Unit objectives The late Renaissance and the Baroque The emergence of the baroque sensibility The late Renaissance: characteristics of the baroque sensibility Baroque features of late Renaissance drama and poetry Shakespeare’s genius. 2.2.3. 2.8.12. 2. 2.1.9.1.1.7.3.2.
Elizabethan England also witnessed an explosion of creative energies in the field of letters and arts. The spirit that dominated this age was typical of the Renaissance. with its sense of confidence and optimism. The emergence of the baroque sensibility The early and high Renaissance* in England developed under the Tudor monarchs*. The vision of a harmonious. The former expansiveness. Christopher Marlowe*. the enormous vitality nourished by the trust in man’s powers – these are general features of the high Renaissance spirit that found their expression in literature as well. well-ordered universe. idealism and confidence gave way to a growing sense of disorder and violence. In the late Renaissance. anxiety and even pessimism.The late Renaissance and the Baroque By the end of this unit you should be able to: ♦ define the characteristic aspects of the baroque sensibility ♦ compare the Renaissance and the baroque visions on man and the universe ♦ compare aspects of Renaissance and baroque literary taste in the 17th century ♦ explain the baroque character of the main themes and motifs in Shakespeare’s tragedies ♦ identify patterns of symbolism and imagery in the studied plays by Shakespeare ♦ describe the main features of metaphysical poetry ♦ explain what a metaphysical conceit is ♦ analyse the use of conceits in poems by John Donne and Andrew Marvell ♦ point out the elements of baroque sensibility in the poetry of Donne and Marvell Unit objectives 2. the sense of tradition as a guarantee for order. Increasingly prosperous and powerful owing to colonial expansion and economic progress. Renaissance England reached the climax in its flourishing.1. to scepticism. High Renaissance English literature has its most accomplished expression in Shakespeare’s work. but the outstanding achievements of writers like Thomas Kyd*. Philip Sydney*. this spirit declined under the pressure of certain historical events* and cultural tendencies. during whose reign England developed into a strong. stable and modern state. Under Queen Elizabeth I. and Edmund Spenser* complete the literary picture of the glorious Elizabethan Age. The Elizabethan age: the English high Renaissance Features of the high Renaissance spirit 32 Proiectul pentru Învăţământul Rural . to the perception of man as a bundle of contradictions and the view of the universe as threatened by instability.
on which the “show” of life must end.1. The Renaissance celebrated Nature and life with its joys. Even the Elizabethan dramatists cultivated elements which announced the Baroque.2. St. the tragic divisions in man’s soul. Paul’s Cathedral in London (16751708): an example of baroque architecture 2. its sense of form. with the tendency of breaking proportions. The Baroque displays attraction to obscurity and melancholy. The unexpected. a tendency commonly associated with the baroque is represented by the Metaphysical Poets of the 17th century. capable of rendering its 33 Revenge tragedy Metaphysical poetry Proiectul pentru Învăţământul Rural . but also to pomp. Characteristic of the baroque spirit are the sense of ethical relativism and the exploration of the borderline between truth and illusion. for excess. the spectacular and the sumptuous. and not properly forming a “school. the extensive use of paradox.1. or the world as stage. The Jacobean and Caroline drama* is essentially baroque. destroyed by the monstrous excess of their ambition. Shakespeare’s early comedies and history plays* are Elizabethan in spirit. sensualism and mysticism. nothing reflects better its emergence than drama. the difficult – often irregular – rhythms. The best examples are Thomas Kyd’s revenge tragedy.” these poets distinguish themselves by the ingenuity with which they force the limits of language. and. and Christopher Marlowe’s characters. The baroque vision of experience of the Metaphysical Poets required a new kind of poetic language. proportion and symmetry. of confusing or transgressing limits. in literature. of man’s limitations and the inevitability of death. the paradoxes and contrasts which make up man’s mixed nature. contrasts with the baroque taste for the extravagant. life and death. In lyric poetry. Characteristic baroque themes were those of life as dream and life as theatre. with its abundance of bloody deaths. reason and superstition. The Renaissance cult of rational order. irony and ambiguity. Baroque features of late Renaissance drama and poetry The essence of the baroque sensibility is conflict and tension. wisdom and madness.1. ornamental rhetoric and preference for convention and artifice. they are the supreme dramatic achievement of late Renaissance. both in its themes and motifs.The late Renaissance and the Baroque 2. and in its dramatic conception. refinement and cruelty. Although very diverse. the concentration of expression in their poems stand in contrast with the Elizabethan smooth and orderly patterns of versification. grandeur. striking imagery. splendour. to the macabre. the Baroque displayed a sharp consciousness of life’s ephemerality. but his great tragedies belong not only chronologically to the Jacobean age: as embodiments of the baroque spirit. The late Renaissance: characteristics of the baroque sensibility The baroque* sensibility that emerged during the late Renaissance registered with particular acuteness the conflicts and turbulences in man’s existence.
as expressions of the baroque spirit of the age. read again the preceding subchapters. Metaphysical poetry blends passion and reason. Othello and Macbeth) and his last romance play. R: celebration of life’s joys B: 3. respectively. If there should be major differences. with the two most relevant accomplishments of the late Renaissance English literature: William Shakespeare’s great tragedies (Hamlet. The Tempest. classical balance.The late Renaissance and the Baroque complexities. you will be acquainted. exuberance B: Compare your answers to those provided in the section Solutions and suggestions for SAQs. sense of form B: 4. complicated feeling and analytical detachment. SAQ 1 Fill in the spaces left below with those features of the Baroque (B) which contrast with the following features of the high Renaissance (R): 1. In the following two subchapters. R: confidence. King Lear. at the end of this unit. 34 Proiectul pentru Învăţământul Rural . R: cult for order and symmetry. as well as some of the metaphysical poems of John Donne and Andrew Marvell. R: vision of the world as harmonious and well-ordered B: 2. optimism. and it is appealing simultaneously to the sensibility and the intellect of the reader.
and a culmination of its literary art. The richness and profundity of his comprehensive creation establish him as a universal genius. In Shakespeare’s whole work. but in the creation of characters and the exploration of their mind and heart. Othello (1604). Shakespeare modulates the language in each play. They are always credible. sometimes even trivial. Shakespeare seems to propose an alternative to the stormy and bloody worlds of his great 35 William Shakespeare (1564-1616) Language in Shakespeare’s plays The second period of creation: the great tragedies Proiectul pentru Învăţământul Rural . devotion. gratitude and ingratitude. and French. etc. Italian. It ranges from the sublime accents of pure poetry. Shakespeare had a natural instinct for the stage. motifs and imagery.The late Renaissance and the Baroque 2. jealousy. The beginning of the 17th century is also the beginning of his second phase (1600-1608). medieval and contemporary sources – English. and experiences are given dramatic shape in his plays: love. all of them are re-workings and adaptations of subjects taken from a variety of ancient. These plays may be seen as strongly influenced by the emerging baroque sensibility in their themes. envy. language. hate. but his enduring preeminence has been insured by his extraordinary insight into human nature. in plain. conflicts. friendship. in which every character – major or minor – has a consistent individuality and is animated by passions. Shakespeare’s whole work is a synthesis of the concerns and convictions of the Renaissance. all mastered with supreme art. romantic or trivial. where the lyrical and dramatic elements are in perfect fusion. search for truth. His characters emerge from the dramatic situation with an unsurpassed force of conviction. and the range of his subjects is extremely diverse. craftsmen or servants. loyalty and betrayal. states of mind. among other features. aspirations and interests. rendered accurately in their poetic truth. Shakespeare’s genius. as well as in the tragic grandeur of the inner conflicts that they portray. struggle for power. in the great blank verse* soliloquies*. or periods of creation. from the variety of his work. when his artistic maturity and depth of vision produced his four monumental tragedies: Hamlet (1601). irrespective of the register in which they are conceived – tragic or comic. moral attitudes. transcending the artistic hierarchy of his age and consecrating him as always “our contemporary. and a perfect adequacy of the language to the character’s moral nature and to the dramatised experience or emotion. A whole human universe inhabits Shakespeare’s plays. A wide range of feelings. His later plays Shakespeare’s greatness as a dramatist comes.” Shakespeare’s work is conventionally divided into several phases. King Lear and Macbeth (1605). which brought him enormous success during his lifetime. to the prose speech of simple folk.2. He was not original in the use of his subjects: with a few exceptions. sublime or burlesque. there is an astonishing variety of styles and registers. In his last period of creation (1608-1611). His inventiveness and imagination were invested not in the intrigues. He was a master of every contemporary dramatic form. so that it displays a similar variety. According to the dramatic necessity. his deep understanding of humanity.
but he adds to it philosophical and ethical implications of the deepest significance. What does Shakespeare’s greatness consist in. The baroque spirit of Shakespeare’s tragedies Shakespeare’s tragedies preserve the pattern of the “fall of princes”*. In these plays. read again the preceding subchapter. If they should differ significantly. the downfall of the tragic hero is accompanied by the destruction of a natural order. in no more than 4 lines / 40 words each: 1. but they deal. How does Shakespeare’s dramatic vision in his last plays differ from that of the tragedies of his second period of creation? Compare your answers with those offered in the section Solutions and suggestions for SAQs. by the chaos arising from the corruption and collapse of values. He is concerned here with the paradoxes in the relationship between reality and appearance. with the restoration of order. with the human endeavour to understand if suffering is part of the 36 Proiectul pentru Învăţământul Rural . with innocence and vitality triumphing over evil and death. common in the Renaissance. with the consequences of imperfect knowledge and self-blindness. of which The Tempest (1611) is the crowning achievement. with the effects of evil on innocence. basically. with the sense of hope overcoming spiritual desolation. between truth and falsehood. His romance plays. 2. at the end of the unit.2. are also tributary to the spirit of the Baroque. The issues that are explored dramatically in Shakespeare’s later tragedies reflect the spirit of uncertainty and increasing scepticism of a baroque age. as far as his approach to character is concerned? 2. SAQ 2 Answer the following questions.The late Renaissance and the Baroque The last period: the romance plays tragedies.1.
Hamlet: a revenge play In Hamlet. takes over the rule of Denmark. In order to find confirmation for the ghost’s story. In another scene. which represents a similar scene of murder. has drowned herself. Hamlet arranges a play to be performed at court. and continually delays the act of revenge. Hamlet learns that Ophelia. but refrains from doing it as the latter was in prayer. a courtier. rejected by Hamlet in spite of their mutual affection. who suspects him of aspiring to take his throne. old king Hamlet. the play ends on a note of hope. he kills Polonius. and with the immense burden of revenge. who was now the new king and who had married Gertrude. accepts Claudius’s treacherous plan of killing Hamlet during a duel. the widow queen. in the confusions of the final scene.3. Claudius. Polonius is the father of beautiful Ophelia. absorbed more and more by his consciousness of the paradoxes of his difficult task of exposing the truth. all the main protagonists find their death. During the play. young prince Hamlet learns from the ghost of his recently dead father. In spite of this bloody outcome. Upon his return to Denmark from his university studies. mistaking him for Claudius. but the plot escapes their control and. Confronted with the moral corruption around him. It is in these four great tragedies that Shakespeare gives the full proof of his artistic genius.2. bringing in the prospect of renewal and of the restoration of order. Hamlet feels all his certainties destroyed. Hamlet hides his terrible grief behind the mask of madness. Laertes. Claudius’s guilty conscience betrays him. Back to the castle. required by his dead father. generous and brilliantly intelligent. brave. as he now sees in her only another embodiment of woman’s frailty. The enlargement of meaning through consistent patterns of imagery running throughout each play. Sent on a diplomatic mission to England. the first in this series of masterpieces. Renaissance man and the baroque sensibility Hamlet has been seen as the embodiment of the ideal Renaissance prince – refined and cultivated. when Fortinbras.2. the Norwegian prince and glorious military hero.The late Renaissance and the Baroque natural order of things or if it betrays the indifference of Nature – or God – towards man. that he had actually been poisoned by his brother. 2. Her brother. Shakespeare deals with his great tragic themes in the frame of a revenge tragedy. sensitive and idealistic. Sir Laurence Olivier in Hamlet (1948) 2. Young Hamlet is thus confronted with the horrors of fratricide and incest. Hamlet escapes a criminal plot set up by Claudius. the intensity of poetic expression – especially in the soliloquies – are features that rank these plays highest in the whole history of the genre. His Proiectul pentru Învăţământul Rural 37 . he has the occasion to kill Claudius.2. the masterful treatment of highly complex characters. At one point. who had really gone mad. with a poisoned sword.
4. his obsessive quest for truth and certainty. 2. 38 Proiectul pentru Învăţământul Rural .1. from the Reader contains a short meditation on man and the universe. If they should differ significantly. the balance and confidence of the Renaissance man have been replaced by scepticism and mistrust. the man of action Hamlet’s penetrating spirit has discerned a reality of human nature that he had not suspected. In Hamlet’s tormented soul. What is the essence of this divided view? Formulate your answer in the space left below.2. at the end of the unit. read again the preceding subchapter. SAQ 3 Text 2. as well as the indicated fragment. revealing Hamlet’s dualistic vision. Madness becomes the refuge of the sensitive conscience from moral chaos. Compare your answer with the suggestions offered in the section Solutions and suggestions for SAQs. which is only partly dissimulated. His effort to see beyond the veil of illusion. in no more than 10 lines / 100 words. is eminently a philosopher’s effort. and this makes him now aware of the ironies and ambiguities inherent in the discrepancy between what is and what seems. It allows the hero to take distance from the corrupt order of the “prison” that Denmark has become for him.The late Renaissance and the Baroque new consciousness that “something’s rotten in Denmark” plunges him into a nightmare. and this may explain his indefinite postponing of the revenge. in which all the values on which he had relied have lost their meaning. The sign of this confusion is the typically baroque motif of Hamlet’s madness. Hamlet: the philosopher vs.
the Earl of Gloucester. which helps him endure his suffering. Lear’s own madness. Lear strives to understand the roots of evil. marks in fact a growth in his moral understanding. the quest for higher meanings. in reality.The late Renaissance and the Baroque The delay of Hamlet’s revenge his incapacity to act. of setting right again the “time” which is “out of joint. are skilfully brought together and create a new ironic dimension in the play. Tragically. as his father has been deceived by his other son Edmund. which has been interpreted in innumerable ways. after his eyes have been put out for having helped Lear. who deprive him of all prerogatives and turn him out of their castles. exiled Lear wanders in a terrible storm in the company of Edgar. which is that of restoring a lost order. another “fall of princes” tragedy. and. His intellectual energies are now concentrated in his search for the meaning of the ultimate questions of life and death. through paradox. He is also accompanied by the faithful Earl of Kent in disguise and by the Court Fool. Cordelia. King Lear: the madness of tragic grief King Lear. to believe him a traitor and usurper. is closely linked. These explorations become more important than the technical matter of revenge. which would not undo the past. like Lear’s daughter Cordelia. Lear becomes the victim of the ingratitude of his two elder daughters. Shakespeare develops the theme of evil by contrasting the natural order of the moral universe with the chaos produced by the 39 Storm and madness Proiectul pentru Învăţământul Rural . who is disguised as a lunatic beggar. an outburst of violence which evokes to Lear the cruelty of his daughters.” 2. and he is thus reunited with his son without knowing it. The storm outside matches the storm in Lear’s hurt soul. whom he disinherits. Edgar. which hide much wisdom under the appearance of playful nonsense. to the themes of knowledge and self-knowledge. starts with a folk tale motif: old Lear plans to leave his kingdom to his three daughters if he is pleased with their declarations of love. on the other hand.2. of human suffering. Hamlet feels overwhelmed by the real task that he is called to fulfil. he is wondering: “Is there a cause in nature that makes these hard hearts?” Edgar’s disguised madness. as in Hamlet. both of them prove to be the loyal. The storm scenes in the play contain the highest symbolic concentration. Hamlet’s introspective. is also an exile from his own family. and the Fool’s comments. son of Lear’s loyal supporter. there is madness in nature itself. if there is a purpose for its existence in the world of man. like that of blindness. of truth and illusion. questioning side is exacerbated by the irruption of evil in a universe that he had thought well-ordered. unconditionally loving ones. a bastard. The earl of Gloucester joins them. Edgar. Maddened with grief. Goneril and Reagan.5. The motif of madness. Disappointed by the reticence of his youngest daughter. is the victim of a staged play of appearances.
To be or to seem: Othello Evil coming from those who are naturally closest to us is intolerable. Othello kills her and takes his own life when her innocence is proved to him. painted by James Graham (early 17th century) 40 Proiectul pentru Învăţământul Rural .2. and its outburst is always accompanied by the awakening of the tragic hero’s consciousness of the divorce between seeming and being. evil succeeds precisely because of the perfection of Desdemona’s purity and Othello’s trusting nature. Othello. Scene from Othello. essence. As a result of Iago’s manipulations. is led by Iago to believe his wife. Claudius’s fratricide and the cruelty of Lear’s daughters are transgressions which turn the tragic hero’s world upside down.6. Evil is that which destroys Nature. With his mind poisoned by a false evidence of Desdemona’s infidelity. a brave and honest general of the Venetian republic. In Othello. and the tragic disaster shows how the play of appearances can dissolve firm moral opposites like truth/lie. Shakespeare gives a special intensity to this theme by dealing with evil in the context of the most natural of human relationships: kinship (relations by blood or by marriage). unfaithful. the bond of a love marriage is the frame in which Shakespeare explores the theme of evil in connection with that of appearance vs. and this destroys his confidence in a moral order. faithfulness/betrayal. 2.The late Renaissance and the Baroque Evil as destruction of the “natural” order unnatural acts which violate this order. The noble protagonist. acting against it. In Othello. Desdemona. Othello is thrown into the terrible agony of suspecting that beauty and innocence might disguise corruption. innocence/guilt.
“Our country sinks beneath the yoke. underlining the theme of knowledge. The evil reverberates in the whole land: in the words of Malcolm. Macbeth. The theme of evil is dramatised as a crime against the bonds of blood. Macbeth: the tragedy of “diseased” conscience In Macbeth.2. The effects of this sacrilege against Nature are devastating. to 2. is manipulated into confusion about truth and falsehood. ____________________ 4. ____________________ 3. The protagonist. ____________________ 2. but. paradoxically. one of Duncan’s sons. arranging the murder of all those who might threaten his power. a brave and worthy general in Duncan’s army. kinsman and guest.7. invaded by “horrible imaginings” and hallucinations. kills the sleeping king and takes the throne.2. Read them carefully and fill in the indicated space with the right title(s).The late Renaissance and the Baroque SAQ 4 Each of the following sentences refers to one or several of the three tragedies mentioned so far. innocence and corruption. the horror of evil is amplified by the fact that the protagonist’s crime is committed against Duncan as his king. since it accompanies the hero’s revelation of the discrepancy between appearance and reality. The baroque motif of madness is. 1. There is “no sweet oblivious antidote” to cure Lady Macbeth’s “diseased” mind either. The hero’s exacerbated introspective tendency makes him postpone action. it bleeds.2. illusion and truth. and each new day a gash / Is added to her wounds. who has a trusting nature. at the instigation of his wife. and she is destroyed by the unbearable Proiectul pentru Învăţământul Rural 41 . The storm scenes intensify symbolically the hero’s tragic sense of confusion. at the end of the unit. Macbeth’s conscience soon starts accusing him. you need to revise subchapters 2. disorder.6. ____________________ Check your answers by looking in the section Solutions and suggestions for SAQs. ____________________ 5. Persuaded by his wife to hasten the fulfillment. If any of your solutions should not correspond. 2. / It weeps. which constitutes a violation of the natural (therefore moral) order. and unmotivated violence and cruelty. Macbeth’s ambitions are inflamed by the prediction of three witches that he shall be king of Scotland.2. he multiples his crimes.” The imagery* of disease is extended to the protagonist’s conscience.
read the fragment once more. His words to Lady Macbeth render his first thoughts after the murder. / Macbeth does murder sleep.” heard immediately after he has committed the murder? What does sleep represent for Macbeth here? Answer in the space left below. who ends up by losing the belief in any meaning of life. and he meets his punishment in the final battle. SAQ 5 In Act II. extracted from this scene.The late Renaissance and the Baroque burden of sin. reveals how soon the abominable crime has begun to work on his spirit. Shakespeare’s shortest and most poetic tragedy reveals the incalculable effects of the darkness with which destiny may cloud the moral conscience of a noble hero. from the Reader. in no more than 120 words / 12 lines. If there should be significant differences. Macbeth joins his wife after he has killed Duncan. in which he fights to the end with the same determination that had brought him the glory of a hero at the beginning of the play. Text 2. scene 2. How can we interpret Macbeth’s hallucination about the voice crying “Sleep no more. in the section Solutions and suggestions for SAQs. from which the ultimate relief is suicide. 42 Proiectul pentru Învăţământul Rural . Compare your answer with the one offered at the end of the unit.2. Macbeth’s heroic strength of will enables him to survive the terrible inner torments.
owing to the improbability of the action. It is also in these last plays that Shakespeare’s dramatic imagination relies to a greater extent on symbolism. and The Tempest – are described either as tragi-comedies or as romance plays. marvelous. on which he lives alone with his daughter. The Winter’s Tale.2. The Tempest (1611). They may also be described as romance plays. the master of an island. and Sebastian. while for physical labour he uses Caliban. One of these sub-plots involves the courtiers: Antonio persuades Sebastian to kill his sleeping brother. but his plan is prevented by Ariel’s music. the long journey. the last expression of Shakespeare’s mature genius. the theme of loss and recovery. separated from each other in various parts of the island and all believing the others dead. duke of Milan.g. their plots contain characteristic ingredients like dangers which are finally avoided. or tension and suspense followed by happy reversals – features that make them tragi-comedies. Miranda. He had long studied the arts of magic. Alonzo. Shakespeare’s last plays Shakespeare’s four plays belonging to his last period of creation (1608-1611) – Pericles. His acts of magic are fulfilled through Ariel. 43 John William Waterhouse: Miranda –The Tempest (1916) Proiectul pentru Învăţământul Rural . of exile and return). They mix serious and comic action.8. has turned him into a slave. as well as other passengers. Sebastian and Ferdinand – Alonzo’s brother and son. a storm wrecks the ship carrying Antonio.9. respectively –. In a plot-line that parallels and parodies the latter. the shipwreck. who. the pronounced elements of the supernatural. The plot of The Tempest Of these four plays. Prospero is the former and legitimate duke of Milan. these plays offer patterns of reconciliation and positive solutions to life’s contradictions. king of Naples. We soon find out that the storm and shipwreck have been magically provoked by Prospero. a drunken servant. After the tragedies. the choice of a remote setting. and his supernatural powers have given him control over both the natural elements and the spirits. a creature whose beastly nature is beyond Prospero’s attempt of educating him. Another sub-plot brings together Ferdinand and Miranda. myth. 2. involving the shipwrecked characters. his faithful spiritservant. Cymbeline. In its opening scene.2. the jester. Alonzo. the sense of a benevolent providential design. Trinculo. to take his throne. Three lines of action develop. magic. Caliban hates and fears Prospero. by his powers. usurped by his brother Antonio and forced into exile twelve years before. the fairy-tale atmosphere. is considered the finest.The late Renaissance and the Baroque 2. are encouraged by Caliban to kill Prospero and take over the rule of the island. and certain themes and motifs (e. who instantly fall in love with each other.
he regains his authority and learns again the arts of power.10. Prospero. to master himself. or of the wickedness of the servant turning against his master.” “on whose nature / Nurture [i. He forgives his treacherous brother and those involved in his usurpation. Caliban Innocence vs. to break his staff (symbol of supernatural power) and to drown his book (symbol of supernatural knowledge). Prospero’s project acquires a wider dimension through the union of Ferdinand and Miranda. On the island. who now repent. the personification of Prospero’s imagination. one of Shakespeare’s most fascinating creations. represents pure spirit. The power of innocence to redeem evil and restore order and the values of humanity is another important theme. “neglecting worldly ends. Evil is not absent in The Tempest: there are echoes of Shakespeare’s previous plays in the motif of the usurping brother planning murder.2. and to return to the world in his full humanity. at the end. who reveals himself to them as “the wronged duke of Milan. the control of intelligence over nature. evil Elizabeth Green – Ariel: The Tempest (1922) 44 Proiectul pentru Învăţământul Rural . Major themes An important theme in The Tempest is that of the nature of power. whose youth and innocence are the premises for the undoing of the wrongs of the past. now.” he had also failed to see his brother’s true character. Ariel is commanded to bring all the characters before Prospero. In the final act. he learns. for the emergence of a regenerated world. At the opposite pole. Prospero plans a safe return to Naples for the wedding of Miranda and Ferdinand. While Caliban and the plotting courtiers and servants demonstrate that both nature and society are capable of corruption. 2. education] can never stick. His act of forgiveness is the highest demonstration of princely power. influenced by Ariel.The late Renaissance and the Baroque Prospero’s initial plan had been revenge. assumes a certain responsibility for his own dethronement: absorbed in his studies.” who can be controlled only by the art of magic. a “thing of darkness. and it is significant that this act is accompanied by his decision to abandon his magic. The theme of power Ariel vs.e. more importantly. he has a change of heart and sees in the union of the lovers a possibility of reconciliation and of a new beginning. but. in Ferdinand and Miranda civilisation and nature are united in their most innocent forms. The grossest instincts of human nature and a fundamental viciousness are symbolically embodied in the grotesque figure of Caliban. Ariel.” claiming his throne. the scholar-magician. and then to Milan.
Prospero reminds Caliban that he did his best to raise him from his animal condition.4. of the role of language in acquiring knowledge. Act I. for instance. by teaching him to speak. scene 2. Proiectul pentru Învăţământul Rural 45 . Full of resentment. If there should be major differences. extracted from The Tempest.. Caliban answers that the only benefit of being able to speak is that he can now curse Prospero. Compare your answer with the one offered at the end of the unit. in the section Solutions and suggestions for SAQs. Here. more carefully. What implications can you find in their exchange of replies? You may think.The late Renaissance and the Baroque SAQ 6 Read Text 2. or in developing self-identity. Formulate your answer in 150 words / 15 lines. read the fragment again.
the association of life with the insubstantiality and briefness of a theatre show. and it is constantly associated with the magic actions of Ariel. of performance. is frequent in Shakespeare’s plays. but an important symbolic ingredient in its major events. manipulates the characters and prescribes the ending. order and harmony. and prevents the wicked plots of both the courtiers and the drunken servants. The play-metaphor The action in The Tempest is practically managed by Prospero. suggests the victory of life over death and of spirit over the elemental power of nature. In opposition with the convulsions and dangers of the tempest. the same features as those of the Renaissance aesthetic ideal: beauty. It is through the perfection of Ariel’s art that Prospero re-establishes the moral law in the world to which he can now return. This emphasis on spectacle and its power to reveal truths by its illusion constitutes a baroque element in The Tempest. The sea-journey and shipwreck are the symbols of a “sea change”*. Shakespeare’s last masterpiece seems to suggest that if life is transient like a theatre performance.12. Symbols in The Tempest Several symbolic elements contribute to the treatment of the themes in The Tempest.2. The playmetaphor.11.2.The late Renaissance and the Baroque 2. and it even contains (like Hamlet) a play within the play: a masque* performed as a celebration of Ferdinand and Miranda’s engagement. sublimating its primitive energies. Even Caliban seems to be responsive to the “sounds and sweet airs” of the island. Music is not only a necessary element in the spectacular quality of The Tempest. The title itself points to the importance of the symbolism of the sea-journey. Prospero also needs “some heavenly music” to accomplish the final act of his plan. The miraculous survival of the ship’s passengers. The whole play insists on the idea of spectacle. whose magic art controls every incident. It is through music that he calms down the fury of the waters. which “delight and hurt not. a profound spiritual transformation and growth. then at least man should strive to discern in it. music suggests harmony and the power of the spirit to purify human nature.” The sea-journey Music 2. Another pervading symbol is that of music. Ariel – illustration to the 1873 edition of The Works of Shakespeare 46 Proiectul pentru Învăţământul Rural . or to impose upon it. comforts Ferdinand’s despair when he thinks his father dead.
Their styles are different. Prospero had lost his power as the duke of Milan because his studies distanced him from the immediate world which he was supposed to rule.2. You must find them among the following statements. If any of your choices should be wrong. T F 5. Two essential symbolic elements contribute to the development of the theme of regeneration: the sea-journey and music.The late Renaissance and the Baroque SAQ 7 Let us remember a few things about The Tempest. in his own way. Proiectul pentru Învăţământul Rural 47 . was first intended to bring discredit on them. at the end of the unit. T F 2.3. T F 6. Prospero intends to use his magic power and supernatural knowledge in his regained authority as duke of Milan.2. applied to certain poets of the early and mid-seventeenth century. The betrayal of his brother and the plotting of the courtiers on the island were severely punished by Prospero. T F 4. T F 7. Circle appropriately T (true) or F (false) for each sentence. of which three are false.” and many disliked its cultivated difficulty. The metaphysical poets The term metaphysical. T F Make sure your answers are right by looking in the section Solutions and suggestions for SAQs. 1. and this makes them both masters of metaphysical wit. John Donne and Andrew Marvell illustrate best the baroque sensibility of the 17th century in their themes and expressive strategies. except that of terrifying him. combines an outstanding intellectual brilliance with lyric grace. revise subchapters2. A baroque feature of The Tempest is the emphasis on the theatrical quality of the action. staged and managed by Prospero through his magic art. 2.12. but each of them. The power of music has no effect on Caliban. T F 3. Ferdinand and Miranda represent the innocent young generation capable of renewing Prospero’s former world.9 to 2. The contemporaries referred to their poetry as “strong lines.
Samuel Johnson* was to describe (in 1779) the kind of wit which characterised a metaphysical conceit as discordia concors*. the poet was able to reconcile contradictory states of mind and feeling. By means of conceits. In spite of its logical.” A new kind of poetry emerged. writers had to face a new exigency. The impression is that this experience. Dr. hidden. There is always a connection between the abstract and the concrete. but also his reason. The metaphysical conceit The poetic device by which such opposites are brought together and reconciled is the conceit. Proiectul pentru Învăţământul Rural Discordia concors 48 . or discovery of occult [i. by the ingenuity with which they forced the perception of similarity in the most unexpected elements. Starting with the last decade of the 16th century. from a most ordinary circumstance. a metaphor or an analogy. a cold intellectual exercise. as “a combination of dissimilar images. but metaphysical conceits were far-fetched* comparisons. and almost always such a poem starts from a very personal situation. linked. and which blended expressive conciseness with density of meaning. As extended comparisons.3. and the emotions involved. to bring not only his imagination and emotion into play. all metaphysical poets are self-conscious and analytic. which was in fact the expression of a new spiritual context. which is developed through the exploitation of an image in all its possible implications.2. with patterns of rhythms closer to those of spoken language than to the requirements of literary tradition. which helps the poet to develop his subject. a demand for “more matter and less words. Irrespective of the kind of experience they endeavour to render. This is an elaborate figurative device. Characteristics of metaphysical poetry Metaphysical poetry displayed a new quality of writing. which starts from a comparison. argumentative quality. secret] resemblances in things apparently unlike. The main features of metaphysical poetry are concentration and logical coherence. united] by violence together. is contemplated from a certain distance. The reader is expected to approach such a poem with an active mind. that the poet detaches himself from his own feelings in order to better understand and analyse them.” as “the most heterogeneous ideas yoked [i. regardless of the subject of the poem. and to unify diverse and even discordant aspects of inner and outer reality into a single experience.e.” Conceits were effective instruments in developing an argument and in rendering complication and subtlety of thought. meant to surprise and delight the reader by their wit*.e.The late Renaissance and the Baroque 2. as well as in ordering and mastering intense emotion. A poem in this tradition is usually focused on an idea or line of argument. often extended by the use of hyperbole* or oxymoron*. “More matter and less words” 2. a metaphysical poem is not a piece of abstract thinking. conceits were abundant in Elizabethan dramatic and lyrical poetry. and a blend of the commonplace and the sublime. The thought goes hand in hand with the feeling.1.3.
and both are explored in the whole richness and variety of their possible experiences. at the end of the unit. In the treatment of both themes. and the same realistic force. the two most outstanding representatives of this poetic trend in the 17th century. in poems belonging to John Donne and Andrew Marvell.The late Renaissance and the Baroque SAQ 8 Order the main aspects describing metaphysical poetry into four essential features. the same blend of ingenious reasoning and intense passion. pastoral* conventions. Donne displays the same sophisticated wit. revise subchapters 2. Use the space left below. Proiectul pentru Învăţământul Rural 49 . its decorative use of classical mythology. and which confers dramatic realism to his poems. and created a style which had the vigour and liveliness of colloquial speech. and allegory.2. Two important themes in his poetic work are love and faith. If they should differ considerably. and a highly original one. In the following subchapters.3. He rejected the regular versification of Elizabethan poetry .3. and 2. 2.3.3. ♦ ♦ ♦ ♦ Compare your answers with those provided in the section Solutions and suggestions for SAQs. Each answer should not exceed 2 lines / 20 words.1. you will look at some famous examples of metaphysical conceits. Themes in John Donne’s poetry John Donne is one of the most influential poets of the 17th century.
A famous poem celebrating shared love is A Valediction*: Forbidding Mourning. sometimes presenting woman as inconstant and unfaithful. he pleads that she should abandon the intransigence of the chaste. sometimes speaking frankly of his erotic desire. but. from cynicism and playfulness to passionate sincerity and the celebration of both physical love and spiritual union. He also suggests sometimes that physical union. are however harmless to man. though greater. shocking the reader by the unexpected analogy developed in the central conceit (the flea as symbolic marriage bed). His approach of the theme of love is more “realistic”: he often glorifies sexuality and the body as important aspects in the experience of love.3. which. Their superior love is founded on spiritual union and is not dependent on physical presence for its survival. in which the lover tries to persuade his mistress not to cry at his imminent departure.” their separation must be seen in analogy with cosmic disturbances (“the trepidation of the spheres”). dealing with profound personal feeling and emotion from the distance of intellectual argument.” In fact. The poem celebrates the stability and comfort of a secure relationship. Crying over their separation would bring to mind an analogy with earthly disasters (“sigh-tempests. unattainable lady and enjoy the pleasures of sensuality. as this would be a triple “sin. and all that the faithful lover could hope for were symbolic rewards and favours for his constancy and humble submission. their love being so great and “refined.The late Renaissance and the Baroque 2. Donne’s love poems In his love poems. in which their blood is now mixed. The various comparisons and analogies by which he describes their love function as arguments in his plea. Donne changes this conventional vision of love. beautiful. and often emphasising the need for mutual love. according to which woman was always an unattainable ideal. Another powerful example of Donne’s use of logical argument in a poem about love is The Flea. His love poetry is revolutionary in its rejection of the Petrarchan* conventions of courtly love*. in which the speaker brings all his argumentative skill in support of his attempt to convince the woman to accept physical intimacy.” “tear-floods”). may afford an experience of the transcendental. he resorts to the extravagant identification of a flea that has bitten both of them with their “marriage bed” and a “marriage temple. Chaste. These are conceits which illustrate the preference of the metaphysical poets for analogies between the macrocosm and the (human) microcosm.4. Donne is highly playful in this poem. superior – woman was an object of never fulfilled desire. Mingling the trivial with the mystical sublime. when accompanied by genuine feeling. carrying the lover’s witty arguments to their logical extremes. This is a seduction poem. and he seems to amuse himself. Donne adopts a wide range of tones and attitudes. Donne’s rejection of the Petrarchan tradition A Valediction: Forbidding Mourning The Flea: seduction and wit 50 Proiectul pentru Învăţământul Rural .” He tries to persuade his mistress not to kill the flea.
Proiectul pentru Învăţământul Rural 51 . Compare your answer with the one provided in the section Solutions and suggestions for SAQs.. he develops one of his most famous conceits.2. Formulate your answer in the space left below. which explains what a metaphysical conceit is. as well. in the Reader).3. Read the poem again. you need to revise subchapter 2. Explain the surprising analogy that he makes in order to speak about mutual love. in no more than 18 lines / 180 words. paying special attention to the last three stanzas.The late Renaissance and the Baroque SAQ 9 Read Donne’s poem (Text 2. at the end of the unit.6. Here. If they should differ significantly.
in which the poet’s desire to abandon himself to God’s love is rendered through paradoxical images. resurrection and salvation. on death. one of Donne’s nineteen Holy Sonnets. comparable to that of Shakespeare. between the need for permanence and the need for variety. in which the poet expresses his deep need for a close relationship with God. as if suggesting that the experience of erotic union is the only way of understanding our relationship with God. He fights against his own sense of sin and guilt. Batter My Heart Portrait of John Donne (1572-1631) (author unknown) 52 Proiectul pentru Învăţământul Rural .5. Tension and paradox are also explored in his religious poems. in which the delight in witty logical argumentation. for the divine saving grace. Satan. between idealised passion and erotic desire. of loyalty and betrayal. gives this sonnet a particular dramatic intensity. If love is often a holy mystery for Donne.3. which parallel those in his love poetry. clashes with the poet’s scepticism that the mystery of faith can be penetrated intellectually. These poems usually display contrary impulses. In Batter My Heart. which makes him a prisoner of God’s enemy. Actually.The late Renaissance and the Baroque 2. Donne’s focus is on his deep sense of sin. The most eloquent example is the sonnet Batter My Heart. in his religious poems the mystery of faith is often explored in erotic terms. paradoxical aspects of the experience of love. on the paradoxes of freedom and captivity. this need is expressed by means of several conceits. Donne’s religious poems Donne’s baroque sensibility is evident in his love poems in the tension between conflicting. Donne’s religious poems often develop an analogy between sexual love and divine love. in the exercise of reason. The insistence on violence and struggle. divine judgement. In his religious meditations in verse.
7.6. In the last six lines. Andrew Marvell combines in his poetic work the sophistication of metaphysical wit with the elegance and grace of classical forms and attitudes. from the Reader. the greatest of political poems in English literature: An Horatian Ode* upon Cromwell’s Return from Ireland (written in 1650). nature.3. representing Donne’s sonnet Batter My Heart. 2. revise subchapter 2. Andrew Marvell: the patriotic theme in the Horatian Ode The last of the metaphysical poets. How does he use this contrast in order to speak about his religious experience? Analyse this conceit in no more than 12 lines / 120 words. Donne suggests his contradictory.3. Three major themes can be detached from his poetry: love. If there should be significant differences. Marvell left. Proiectul pentru Învăţământul Rural 53 . and read the poem again. Compare your answer with the one offered in the section Solutions and suggestions for SAQs. living through the turbulent years of the Civil War*.The late Renaissance and the Baroque SAQ 10 Read Text 2. paradoxical feelings by means of a conceit which exploits metaphorically the contrast between marriage and rape. and love of country. This meditation on political conflict and national history is impressive by its clarity and controlled variations of tone.5. according to some critics. at the end of the unit. As a Puritan* patriot.
on the scaffold.The late Renaissance and the Baroque Andrew Marvell (1621-1678) Its classical perfection manages to hold in balance the ambivalence of attitude and the complication of thought characteristic of the metaphysical trend. On a Drop of Dew 2. reveals thus its symbolic dimension to the poet’s contemplative mind. which begins with a most accurate description of a dew-drop on a rose petal. The theme of love in Marvell’s poetry Of Marvell’s love poems.e. Victorious Cromwell is admirable for his fiery spirit and the courage with which he assumed the task to “cast the kingdoms old / Into another mould” (i.3. The speaker’s argument opposes the “deserts of vast eternity. behaving with royal grace in his last minute. which illustrates the poet’s skill in combining the playful and the serious.7. developed then into a complex analogy with the pure Christian soul and its relation with earth and with heaven.” so the Christian Soul denies the earth and its “impure” pleasures. but Marvell’s poem extends it into a meditation on time. King Charles I Stuart. in contrasting colours. He rather sees the events and the fate of the two rulers in the context of a providential history.” whose visible beauties are the key to spiritual truths. Marvell does not portray Oliver Cromwell and his opponent. Proiectul pentru Învăţământul Rural Carpe diem 54 .e. in which both of them act according to a divine order.” and finally dissolves itself “into the glories of the almighty Sun. pictured with remarkable precision. anticipating the early Romantic attitude to nature. What begins as a nature poem is extended into a religious poem by means of a metaphysical conceit. Marvell emphasises the dignity with which the defeated king met his fate. a masterpiece of metaphysical wit. Just as the dew-drop is “trembling.” associated with his mistress’s preference for a prolonged courtship. Although loyal to the Puritan cause.e. to change the form of ruling power). 2. however. in which the speaker develops an ingenious argument in order to persuade his mistress to give up her coyness [i. It is a seduction poem. Gifted with a sharp sense of observation of natural detail. Nature as “mystic book” Another side of Marvell’s poetic personality is illustrated by his nature poetry. The most illustrative poem. A natural detail. in this respect. lest it grow [i. and thus he can find reason to praise both of them. these details as emblems of a transcendent reality. aspiring to union with almighty God. He showed a deep love for the countryside. as if Nature itself were a “mystic book. Marvell often sees.3. for fear that it might grow] impure. shyness] and accept his passionate love. the most accomplished is To His Coy Mistress. On the other hand.8. is On a Drop of Dew. His nature poems have usually a mystical tendency. and many of his poems reveal his delight in the contemplation of rural nature. The carpe diem* motif was popular in Renaissance poetry.
which has the structure If…. Do not exceed 12 lines / 120 words in all. is presented as the only way of transcending our mortality. it can arrest the inevitable course towards physical extinction by a moment of ecstatic pleasure.The late Renaissance and the Baroque to the imperative of conquering time by the intensity of sensual enjoyment.8. at the end of the unit. Love. after revising subchapter 2. What are the main ideas corresponding to these three steps? Formulate them succinctly in the space left below. more carefully. paying attention to the logic of the argument. Proiectul pentru Învăţământul Rural 55 . Love can suspend the inexorable laws of nature. in the Reader). but…. If the difference is considerable. SAQ 11 Read Marvell’s poem To His Coy Mistress (Text 2. read the poem again.8. then (therefore)…. If… But… Therefore… Compare your answer with the one provided in the section Solutions and suggestions for SAQs. in its sexual fulfillment.3.
The late Renaissance and the Baroque
Summary
This unit has introduced you to an important aspect of the English Renaissance: the development, in the early 17th century, of the Baroque as a structure of sensibility different from that of the Elizabethan age (corresponding to the high Renaissance). Subchapter 2.1 focuses on the contrast between the optimism, confidence, exuberance, sense of order, harmony and balance characterising the high Renaissance spirit, and the baroque vision with its emphasis on disorder, conflict, tension and confusion, scepticism and anxiety. Paradox and irony are favourite devices for the exploration of the relationship between contraries, such as truth and illusion, wisdom and madness, life and death, body and spirit, action and contemplation, etc. A taste for the obscure, for melancholy, for the macabre often defines the Baroque, but it may also display an attraction to the spectacular, to extravagance and excess. Subchapters 2.2 and 2.3 focus, respectively, on Shakespeare and on two great metaphysical poets, John Donne and Andrew Marvell, who best illustrate this spirit of the late Renaissance. Subchapter 2.2 deals with Shakespeare’s four great plays of his second period of creation – Hamlet, King Lear, Othello, and Macbeth. The themes they explore (the nature of evil, the meaning of human suffering, the paradoxes of innocence and knowledge, truth and falsehood, etc.(reflect the baroque sensibility of the age). This subchapter includes also a discussion of Shakespeare’s last major dramatic creation, The Tempest, a romance play in which his tone changes into a more affirmative one and the central thematic concern is the possibility of moral regeneration, of the restoration of order. Subchapter 2.3 aims to acquaint you with some of the basic features of metaphysical poetry, insisting on its use of conceits, on its argumentative structure, on its mixture of intense feeling and intellectual detachment. Both John Donne and Andrew Marvell display a baroque sensibility in their attraction to paradox and ambiguity, and they are both great masters of metaphysical wit, skillfully controlling lyrical effusion by subtle and precise logical argument.
Key words
● ● ● ● ● ● ● ● ● ● Renaissance Baroque paradox scepticism tragedy romance play play-metaphor metaphysical poetry conceit discordia concors
56
Proiectul pentru Învăţământul Rural
The late Renaissance and the Baroque
Glossary
• Baroque: the term comes from the Portuguese barroco and the Spanish barrueco, meaning a rough or imperfectly shaped pearl. It describes a style in architecture and the visual arts, music and literature, which dominated the 17th century, and which was characterised by sumptuous ornamentation and by the search for effect. Its meaning is often extended to a certain type of sensibility, not necessarily restricted to the historical period in which the baroque style flourished. In art, the Baroque is opposed to Classicism and Neoclassicism. blank verse: see the Glossary in Unit 1. carpe diem: literally, “seize the day” in Latin; a phrase from one of Horace’s Odes, meaning “enjoy yourself while you can.” The carpe diem motif is associated with the theme of the brevity of life and the inevitability of death. Civil War: see the Glossary in Unit 1. courtly love: a concept developed during the Middle Ages, in literary and aristocratic/courtly circles, which was closely linked to the feudal concept of vassalage and the cult of the Virgin Mary. discordia concors: (Latin) literally: harmonious discord; combination of apparently discordant images or ideas, the joining of opposites in such a way that a paradoxical sense of harmony is created. fall of princes: the traditional theme of a tragedy, as established by Aristotle (see the Gallery of personalities below), in his treatise on Poetics. According to him, tragedy was supposed to deal with the downfall of a noble character, enjoying “reputation and prosperity.” The disaster is brought on him not by vice and depravity, but by “some error of judgement,” and its representation is meant to arouse pity and fear. far-fetched: literally: carried too far; improbable, unlikely. history plays (or chronicle plays): a form of drama invented by the Elizabethans, which dramatises a certain historical period, starting from historical record rather than from myth and legend. Shakespeare’s chronicle plays include a sequence of four plays on the War of the Roses (the three parts of Henry VI, and Richard III – 1590-1592), and another series, consisting in Richard II, King John, the two parts of Henry IV, and Henry V, written between 1595-1599. These plays are mainly inspired from the 16th century chronicles of Raphael Holinshed, and they were highly influential in the shaping of a national consciousness. They scrutinise the national past, underlining the importance of a centralised authority which should put an end to the dangers of anarchy, inherent in the feudal struggles for power. Horatian Ode: an ode (see the Glossary in Unit 1) written in a highly formal, regular pattern, on the model of the ancient Latin poet Horace (65-8 B.C.). hyperbole: a rhetorical figure consisting in deliberate exaggeration, for the purpose of emphasis. imagery: basically, language appealing to the senses. Imagery represents the coherent system of mental images evoked by 57
• •
• • • •
• •
• • •
Proiectul pentru Învăţământul Rural
The late Renaissance and the Baroque
• • • • • • • • • •
•
• •
figurative language, to which certain patterns of feeling are associated, and which direct the reader’s reaction. For instance, in Macbeth, the recurrent imagery of clothes sitting ill on their owner intensifies our perception of the protagonist as a usurper, and the dominant imagery of darkness contributes to the suggestion of the proportions of the moral evil. In King Lear, frequent images connected with bodily pain and torture and with animals of prey strengthen our sense of the extraordinary power of evil, of a humanity that has become a toy in the hands of indifferent gods. Jacobean and Caroline drama: see again subchapter 1.4.1 in Unit 1. masque: see again the Glossary in Unit 1. Metaphysical Poets: see again subchapter 1.3 in Unit 1. oxymoron: a rhetorical figure in which apparently contradictory terms are used in conjunction (as in “beautiful tyrant”). pastoral: see again the Glossary in Unit 1. Petrarchan: related to or modelled on Petrarch (see again the Gallery of personalities in Unit 1). Puritan: see again the Glossary in Unit 1. Renaissance: see again the Glossary in Unit 1. revenge tragedy: see again subchapter 1.4.1 in Unit 1. sea-change: this phrase from Shakespeare’s The Tempest, used by Ariel in one of his songs, is used to refer to a complete change in the nature or character of something, a change which seems almost magical. soliloquy: from Latin solus, i.e. alone, and loqui, i.e. to speak; a widely accepted dramatic convention, by which a character, speaking alone on the stage, reveals to the audience his thoughts, feelings, motives and intentions. In Shakespeare’s plays, the soliloquies mark the moments of the characters’ most profound insight, in which some important revelation is reached, or in which the character discloses the full complexity of his motives and reveals the depths of his consciousness. valediction: a farewell speech (from Latin vale: farewell, and dicere: to say). wit: see again the Glossary in Unit 1.
Gallery of personalities
• • Aristotle (384-322 B.C.): Greek philosopher, author of works on logic, ethics, politics, poetics, rhetoric, metaphysics. Johnson, Samuel (1709-1784): the most influential critic of the 18th century, author of the impressive critical-biographical work Lives of the Poets (1779-1781), editor of Shakespeare’s work (1765). He compiled the first important Dictionary of the English Language (1755). Kyd, Thomas (1557-1595): one of the most popular Elizabethan dramatists, the author of The Spanish Tragedy, the prototype of the Renaissance revenge tragedy, modelled on the plays of Seneca (se again subchapter 1.3.2 in Unit 1). Marlowe, Christopher (1564-1593): Elizabethan dramatist, the
Proiectul pentru Învăţământul Rural
•
• 58
The late Renaissance and the Baroque
•
•
•
most important and influential of Shakespeare’s precursors. His tragedies (Tamburlane the Great, Doctor Faustus, The Jew of Malta) depict titanic heroes, whose extraordinary will power and ambition set them on a risky quest (for absolute power, knowledge and wealth, respectively). Sidney, Philip (1554-1586): important poet of the Elizabethan age, best known through his sequence of love sonnets Astrophil and Stella. He is also the author of a prose romance, Arcadia, and of a critical prose essay, An Apology [i.e. defense] of Poetry, which played a major role in the definition of English Renaissance literary aesthetics. Spenser, Edmund (1552-1599): one of the greatest English poets, whose influence on later poets is comparable to that of Shakespeare and Milton. Like Sidney (see below), Spenser wrote a sonnet sequence, Amoretti, which enjoyed great popularity. His masterpiece is the allegorical poem The Fairie Queen, a culmination of Renaissance poetic art, which glorifies Queen Elizabeth. Tudor monarchs: Henry VII (1485-1509), who established national order and unity after a long period of feudal war; Henry VIII (1509-1547), Elizabeth I (1558-1603).
Solutions and suggestions for SAQs
SAQ 1 1. emphasis on disorder, violence, conflict, instability 2. emphasis on life’s shortness and insubstantiality (life as dream), on the macabre and the morbid, on melancholy 3. taste for extravagance, excess, breaking of limits and proportions, ambiguity 4. scepticism, anxiety, tension SAQ 2 1. Shakespeare shows a deep understanding of human nature in its extraordinary variety; he portrays a wide range of feelings, emotions, attitudes and moral features; he achieves perfectly convincing characters, in a variety of dramatic registers. 2. The last plays are characterised by a vision of hope and of order restored; here, innocence is victorious over evil, by contrast with the former tragic vision of the universe and of man as torn by inner conflicts. SAQ 3 The fragment contrasts the confidence and exuberance of the Renaissance with the scepticism and melancholy characteristic of the baroque spirit. Hamlet as a Renaissance man glorifies the beauty and majesty of the universe, and praises man as the masterpiece of creation, close to angels and God in his power of understanding and the infinity of his creative potential. On the other hand, to his tragic consciousness the world appears as irremediably corrupt and infested with evil, and man as a creature limited by his mortal condition (“quintessence of dust”).
Proiectul pentru Învăţământul Rural
59
attempt to reconcile contradictory or discordant experiences. Prospero seemed also to think that Caliban could be socialised through speech. SAQ 6 Prospero might have better controlled Caliban in his “brutish” state. T. analytical detachment from emotion 4. “The innocent sleep” is the symbol of moral integrity. make his purposes known through words). F. He is not a cold-blooded killer. 2. Othello. led to his awareness of his condition as a slave. use of conceits (extended comparisons. Hamlet.The late Renaissance and the Baroque SAQ 4 1. which he resents. T. 3. 5. 4. the development of conscience. As “chief nourisher in life’s feast. he failed in his effort to enlighten Caliban.e. of a clean mind.g. however. because the latter’s nature was hopelessly evil. 7. By 60 Proiectul pentru Învăţământul Rural . which remain perfectly united. usually between highly dissimilar elements. “Sleep no more” anticipates the torments of Macbeth’s conscience. through language (knowing his “own meaning”). F. As a truly superior being. From Caliban’s point of view. Perfect circles (symbolising perfect love) may be traced by means of the compasses. SAQ 7 1.” sleep (i. Othello.g. made of two moving legs articulated at one end. 5. of his own sense of self. Hamlet. this hallucination proves Macbeth’s strong imagination. Hamlet. he chose to raise Caliban to the condition of a rational creature. even if physically the lovers must be apart. innocent conscience) is part of the natural order of man’s existence. is a suitable emblem for their souls. which organises and “manages” intense feeling and emotion. This instrument. King Lear SAQ 5 In the first place. guided by rational will. etc. endowed with speech. T. surprising associations) 3.) SAQ 9 The poet associates mutual love with the way in which a pair of compasses works. 3. 4. which would have enabled him to communicate (e. unexpected. 6. King Lear. Macbeth’s feeling that he has lost this privilege of nature reflects his awareness that his “unnatural” deed is a violation of moral law (which is “natural”). F. 2. T SAQ 8 1. to blend contraries (e. unable to find peace once it has been corrupted by evil. passion and reason. the abstract and the concrete. He thus expected Caliban to overcome his primitive impulses and to develop more civilised tendencies (“purposes”). King Lear. From Prospero’s point of view. and the horrible crime has immediate effects on his conscience. by keeping one foot fixed and moving the other round this centre. concise expression and density of meaning 2. complicated line of argument.
just as the mistress. God would set him free for a complete experience of religious devotion. 1969 (pp. SAQ 11 If we had time enough and the world were all ours. vol. Ford. since only worms will “enjoy” it. English Literature and Civilisation. The speaker tries thus to persuade his mistress of his own constancy of feeling.” Depending on the distance from the centre to the circumference. your virginity will then be worth nothing. Further reading 1. Paradoxically. Ioan-Aurel (coord. London: Secker and Warburg Ltd.. But I know time is merciless. but the implication is that his will and reason are too weak to defend his faith. 1991 (pp. Taking him by force – by the force of the divine grace –. instead of letting it devour us slowly. Preda. Penguin Books Ltd. which would restore the purity of his faith (being “chaste”). 130-140) Proiectul pentru Învăţământul Rural 61 . vol. so let us devour Time with the intensity of our desire. 1983 (pp. Bucureşti: Editura Didactică şi Pedagogică. Boris (ed. 246-249. Daiches. SAQ 10 Marriage is associated with love. 3. your beauty will fade and my songs of praise will have no object when you lie in your grave. in fact.” which only God can effect.). 273-287) 2. 2 (“Shakespeare to Milton”). The New Pelican Guide to English Literature. A Critical History of English Literature. The only way out of his loveless “marriage” to sin is a “divorce. I would spend ages in praising every part of your body.The late Renaissance and the Baroque analogy. the metaphor of the speaker’s “marriage” to God’s enemy suggests his sense of sin. David.” so there is always the certainty of reunion for the lovers. 34-40. as the moving leg will “come home” and join its “twin. 302-305) 3. He loves God. the poet’s love depends on the certainty of his mistress’s faithfulness and constancy: “Thy firmness makes my circle just. waiting for her departed lover. The Renaissance and the Restoration Period.). Therefore let us enjoy each other while we are still young and you are beautiful. 97-105. Your own passion “transpires” in the blush of your skin.. the inclination of the fixed leg may vary – it seems to “lean after” the moving leg. But. because your charms deserve such praise. while rape presupposes the violation of one’s will. consent and legality. however. 267-283. and which would resemble rape. in the absence of joy. will long for him.
3.1.4.1. 3. 3. 3.3.1. 1 Solutions and suggestions for SAQs Further reading 63 63 63 64 64 66 66 67 67 68 69 70 72 72 74 75 77 78 79 81 82 83 83 84 85 86 87 62 Proiectul pentru Învăţământul Rural .3.5. 3..4.2.2.3. 3.3.2. 3.The works of John Milton UNIT 3 THE WORKS OF JOHN MILTON Unit Outline 3. 3.6. 3.2.4. 3.5.4.4.2. 3.3.2.1. 3. Unit objectives The Works of John Milton Milton. 3. 3.4. 3. 3.5.1.2.4.4. the “author of all ill” Milton’s depiction of Adam and Eve Summary Key words Glossary Gallery of personalities SAA No.5. 3. 3.5.
music. such as education. He returned to England when the troubles which were to lead to the Civil War* started. as a publicist. Greek and Hebrew. religious and civil debates of his age. religion. theology. After that. accumulating an impressive knowledge in a diversity of fields (e. and the course of his literary career was consistently marked by his involvement in the political. rhetoric and the great works of the classics. He lived and created in an age of historical turbulence and profound change. and for almost twenty years he served their ideal of a truly reformed England. motifs and concerns in Milton’s earlier poems ♦ describe the kind of sonnet structure used by Milton ♦ analyse the way in which Milton develops imaginatively and interprets biblical events in Paradise Lost ♦ state and explain the theme of Paradise Lost ♦ summarise the argument that enables Milton to “justify the ways of God to men” in his epic poem ♦ define the main features of the character of Milton’s Satan ♦ describe Milton’s treatment of the characters of Adam and Eve in Paradise Lost Unit objectives 3. recommended him for the office of Latin Secretary to the Council of State. family. as well as his moral inflexibility. In 1638. His enormous learning. and he dedicated long years of study and preparation to his accomplishment as a creator. etc. Paradise Lost. which exerted a huge influence on many generations of poets. Milton. the greatest epic poem in English literature. written in English and in Latin. etc. Christian faith and classical formal perfection. politics.). and he made up his mind about his own position in the conflicts that agitated his country. and his acquaintance with the great artistic achievements of that country and with prominent personalities enriched his education and contributed to his erudition. geography. baroque* vision. He devoted himself heart and soul to the cause defended by the Puritans*. In his prose essays and pamphlets*. the Christian humanist Milton is one of the most prominent figures of the 17th century.g. Milton had from an early age the conviction of his poetic vocation. Milton’s enduring reputation is ensured by his masterpiece. he approached a diversity of subjects.The works of John Milton By the end of this unit you should be able to: ♦ situate Milton’s literary activity in the historical context ♦ explain what features of Milton’s work define him as a Christian humanist ♦ identify themes. 63 John Milton (1608-1674) A man of impressive learning The Puritan patriot Proiectul pentru Învăţământul Rural . he studied Latin.1. His education was eminently that of a Christian humanist. mathematics. the freedom of the press. At Cambridge (1625-1629). the author of a work which represents a highly original synthesis of Renaissance humanism*. he went on a trip to Italy. he continued to read intensively.
Milton’s Christian humanism consists in this fusion of classical form and Christian themes.” The Latin elegies The Nativity Ode 3. L’Allegro describes a day – from morning till sunset – in the life of the cheerful man. and his first notable poems were seven Latin elegies*. for instance. is in touch with divine secrets. Milton’s early poems Milton started writing poetry very early. As a poet. In the Sixth elegy. Milton follows Ovid in the emphasis on sensuous enjoyment. celebrating the birth (the “nativity”) of Christ and its inauguration of a new order for humanity. However. Virgil*. His models were the great Greek and Latin poets (Homer*. as it is also an ambitious assertion of Milton’s own literary birth as a “poet-priest. However. the pastoral* image of the shepherd becomes a metaphor for the poet-priest engaged in the exploration of high Christian themes. approaching the great religious themes that enabled him to assert his genius. his political hopes ended. Milton’s first important poem in English on a religious theme was written in 1629: On the Morning of Christ’s Nativity. L’Allegro and Il Penseroso To Milton’s long years of preparation for the fulfilment of his vocation belong also two poems.The works of John Milton The Christian humanist poet a position that he occupied from 1649 until 1660. he started to move away from themes and concerns which were defining for the classicist spirit of the Renaissance. Milton places emphasis on the dignity of agricultural labour and the 64 Proiectul pentru Învăţământul Rural . to whose excellence he aspired to rise. etc. with its pastoral delights. As his poetic personality gained in self-confidence.1. This poem was intended as the first in a series about the significant moments of the Christian year. and he was perfect master of a variety of styles. 3. but Milton did not complete his plan. As in other poems. On the other hand. in the treatment of the theme of love and the use of Greek mythology. Ovid*.2. which already displayed the ambivalence in Milton’s poetic identity as both Christian poet and classicist humanist. In some of them. or the two sides of the poet’s soul. in the optimism and exuberance accompanying the contemplation of reviving nature. these two sides are usually kept apart in these poems. Milton wrote with the same ease and grace both in English and in Latin. in these poems Milton appears highly preoccupied by his poetic vocation. the Nativity Ode* is a landmark in his creation. who. He sought inspiration in biblical mythology.). in the perfect integration of classical allusion and pagan mythology with Christian spirituality.2. They deal with contrasting moods of poetic inspiration. by his aspiration to be a Christian epic* poet. which are in fact complementary: L’Allegro [“the cheerful man”] and Il Penseroso [“the pensive/melancholy man”]. With the Restoration*. but his maturity and experience enabled him to bring to fulfilment the most important part of his poetic work. like a priest.
b. to become a great epic poet of the Christian age. In both poems. the crowing of the cock. gives way to the mystic exaltation of the poet-student listening to religious music. The final part of Il Penseroso expresses the poet’s aspiration of attaining visionary power. b. to master a variety of styles.The works of John Milton satisfactions that it offers. he expects to discern in the heavenly notes a spiritual truth. In Il Penseroso. in L’Allegro. If your choices should be wrong. Check your answers by looking in the section Solutions and suggestions for SAQs. c. Milton’s Christian humanism is reflected in a. at the end of the unit. in Il Penseroso. 1. appropriate mythological allusions contribute to the creation of the atmosphere.e.2. you will thus review some aspects of Milton’s literary personality. and on the happiness of rural life. but the “natural” music of L’Allegro (the song of the lark.” contemplative mood. 3. the song of the milkmaid) contrasts with the deep. celebrate the diurnal pleasures of pastoral life and its activities. In the latter. and 3. Are Milton’s first poems in English which deal with a Christian theme. his constant preoccupation with his own poetic becoming. revise subchapters 3. L’Allegro and Il Penseroso a.” in which the studious poet finds the gratification of intellectual experience. Proiectul pentru Învăţământul Rural 65 . The diurnal activities and the cheerfulness of L’Allegro are replaced here by the nocturnal peace and quiet of the “lonely tower. in his poetic work. There is both parallelism and contrast between the two poems. b. the diversity of subjects in his prose essays and pamphlets. there is a strong emphasis on music. of classical erudition with biblical themes. The secular* pleasures of common life.1. 2. are complementary poems about poetic inspiration and creative moods. Milton’s literary ambition was a. polyphonic sounds of the organ. c. the integration. the poet hopes to hear “more than is meant to meet the ear” – i. to rival the classics in his perfect mastery of Latin. c. the poet emphasises the blessings of the “pensive. with its simple pleasures. SAQ 1 Make the right choice to continue each of the three beginning statements. In each poem.
66 Proiectul pentru Învăţământul Rural . Milton composed another poem in which. Milton’s sonnets demonstrate a remarkable flexibility. The death of a promising young man makes the poet meditate on existential problems. Milton’s sonnets Milton revived the tradition of the sonnet*. The death of the dedicated young man.” Lycidas shows Milton again preoccupied by his own becoming a poet. He asks himself if there is any sense in preparing oneself for poetic fame and giving up the pleasures of life when death may so unexpectedly put an end to all endeavour. Irrespective of their nature.2. in his determination to carry on with his task and do each day’s work: “Tomorrow. Milton’s concern with his poetic fulfilment 3. The elegy Lycidas. uses again the pastoral frame. If in other poems of Milton’s early career this thought is expressed more obliquely. Lycidas – a pastoral elegy In the same year with L’Allegro and Il Penseroso (1637). Confronted with the tragic inevitability of death. or occasional and complimentary compositions. the shepherdpoet’s consolation is in his own sense of purpose. not on earth. personal manner. representing both himself and his dead mate as shepherds. This fear was accompanied by the paradoxical feeling that his genius was not ripe enough for the poetic task for which he felt he was destined.3. preparing himself seriously for becoming a priest. may appear unjust in a world in which corrupt priests prosper and accede to high offices. he defines his poetic ambition in terms which are both Christian and classical-humanist. The answer to such questions enlarges the frame of the pastoral elegy: the true reward for both merit and vice is in heaven. The early death of his Cambridge mate was an occasion for meditating on the possibility of his own death before having accomplished the great work for which he had been preparing himself for so long.The works of John Milton 3.2. and the end of the elegy brings in a note of personal confidence. to fresh woods and pastures new. variety and originality in the use of this poetic form. and they were either testimonies of personal experience and feeling. written at the death of a fellow-student at Cambridge. Milton adds a contemporary Christian relevance to the classical pastoral convention when he reflects on the corruption of the church. in a heavenly pastoral world. The lamenting poet finds comfort in the thought that the soul of the dead friend is now with God. in two of his sonnets he reveals these anxieties in a direct. again. which had known a period of decline since the Elizabethan age*. He wrote sonnets intermittently throughout his life.
” that they are “timely happy spirits”. with a certain sadness. foolishly: how can God expect him to fulfill his task if He has decided to make him blind? (“Doth God exact daylabour. he Paradise Lost to commands “thousands” (of spirits. Since for God time is in fact eternity (“All is…as ever” in God’s eye). In Sonnet XVII. in which the accumulation of knowledge was meant to create a solid foundation for his future great work. Milton has the strong sense that his poetic accomplishment is a task imposed by God (his “great task-master”). and the theme of blindness was to accompany the great themes of his coming masterpieces.” “mean or high” as it may be. in 1652. since. Patience – a Christian virtue – teaches him that God is served not only by actions. As a Christian poet.The works of John Milton 3. but he had not fulfilled his great poetic promise. that the unfolding of his poetic destiny is not only a matter of time. that. The only thing that matters is that he should have “grace to use it so. who carry out the divine his daughters will. in another poem of this kind (Sonnet XVII).3. written in 1631. he admits.” By this time. God: the poet’s “great taskmaster” 3.e. angels). Milton was still invoking Patience to avoid the anxiety caused by his feeling of “unripeness. To prevent such a complaint. he must admit.” It would be arrogance to think that God needs “either man’s Milton dictating work or gift” to assert His greatness. The life of study and leisure that the poet had been leading was a period of prolonged apprenticeship*. When he wrote Sonet XVII. but finds consolation in his faith in Providence. If he is to transcend time by literary fame. In the first part of the sonnet. but of God’s eternal will. The final six lines of the sonnet change this tone of lamentation to one of self-comfort at the thought that heaven has already decided his “lot. Milton meditates on his loss of sight.3.1. Sonnet XVII After almost twenty years. and that the passing of the time will eventually confirm if he is destined for glory. Proiectul pentru Învăţământul Rural 67 . confessing his temptation to ask.2. but also by Christian humility. patiently. and confronts the evidence of a “late spring. light denied?”). i. Milton’s eye-sight was definitively compromised. as King of Heaven. at his age. Patient and dignified waiting for God’s will to be fulfilled is also a way of serving Him. He has reached the age of twenty four. A sad biographical circumstance increased Milton’s anxiety in this respect: he was going blind. Sonnet VII In Sonnet VII (“How soon hath time”). Lamenting the loss making his political and religious views known in a series of influential of his eyesight essays. it does not matter if this task is fulfilled soon or late. by the acceptance of one’s fortune – of God’s “mild yoke. they have been fortunately able to prove their maturity at the right time. other young men have demonstrated “inward ripeness.” to carry out the task in such a way as to make his achievement count in eternity. Milton laments the passing of his youth without any sign of poetic ripeness. he had asserted himself as a successful publicist.” with no “bud or blossom” to promise ripe fruit.
read again subchapter 3. at the end of the unit. in the Reader). As the several Invocations in the poem suggest. made up of two sections: an octave (an eight-line stanza) and a sestet (a six-line stanza). Dante* –. and of leaving to posterity an undying work. If there should be significant differences. This formal pattern usually corresponds to a certain thematic structure. Read these sonnets (Texts 3. and the two sonnets. and 3. which in Sonnets VII and XVII is the same.2.4. Virgil. Paradise Lost was the fruit of long years of preparation and meditation. Compare your answer with the one offered in the section Solutions and suggestions for SAQs. What is the common thematic development in these two sonnets? Your answer should not exceed 8 lines/80 words. His blindness was no obstacle – as he advanced in the composition of the poem. he expected the inspiring Muse to compensate for his physical blindness with a 68 Proiectul pentru Învăţământul Rural . respectively.1.The works of John Milton SAQ 2 Milton adopted the form of the Italian sonnet. Paradise Lost – the Christian epic Milton began the composition of his masterpiece in 1657. completing it in 1665 and publishing it in 1667. the passages stored in his mind were transcribed after his dictation. paying attention to what their octave and sestet deal with. and it represented the fulfillment of his ambition to write an epic which would be “doctrinal to a nation.3. and he worked at it over several years. 3.” He had always dreamed of reaching the stature of the great epic poets that were his models – Homer. when he was already blind.2.
These problems may be summarised by the alternative freedom vs. Finally.The works of John Milton more penetrating understanding of spiritual truths. in fact. etc. the fault with The Felix culpa happy consequences. he decided on the subject of the Fall – the theme of Paradise double fall. burning in the “darkness visible” of those “regions of sorrow. to “illumine” what is “dark” in him. happiness and peace they had enjoyed in Heaven. whose main moments are the fall of the rebel angels. is subordinated to the poetic intensification or clarification of the main theme. The twelve books which make up Paradise Lost unfold an impressive epic action.e. Milton approached in his grandiose epic problems which provoked heated polemics in his time. are gathered to listen to Satan. predestination*. and thus to enable him to attain indeed to a “prophetic strain. His work is encyclopaedic. the poem develops an implicit debate on such contraries as freedom and tyranny. Its Christian frame absorbs and integrates Milton’s astonishing learning.4. an evil which is turned to good in God’s overall plan for the history of creation. brought about by his disobedience. Then the reader is plunged into the middle of the action: the fallen angels in Hell. but his erudition. with the poet’s invocation of the Muse. over the years. The The belief in poem’s doctrinal foundation is the idea that God’s infinite knowledge free will and power do not exclude man’s freedom of action and choice. Paradise Lost defines Milton best as a Christian humanist. 3. Milton’s ambition was. obedience and rebellion. original epic scenario. in which man’s fall.” as he anticipated in Il Penseroso. (divine) love and (Satanic) hatred. “to justify the ways of God to men. the creation of the world and of man.1. as he stated in the opening Invocation. of Lucifer* from Heaven. and his loss of Paradise.” and the central theme of his poem is that of felix culpa* – the fortunate mistake. The “lost Archangel. Starting from the dualism good/evil. Satan and the fallen angels in Hell The poem begins in conventional epic manner. man’s temptation and fall into sin.” He suggests to his followers that their “work” should no longer be done by force – since that is the attribute of the Almighty –.” full of the bitterness of defeat. Milton had thought.” forever deprived of the glory. in theme a daring. is presented as a necessary moment in the “Eternal Providence*”. Satan is determined to wage “eternal war” to his “grand Foe [i. and of Adam and Eve Lost from Paradise. He interprets poetically the biblical events. accumulated throughout his life. which is never ornamental. but by Proiectul pentru Învăţământul Rural 69 . enemy]” who “holds the tyranny of Heaven. declares his hatred against God and his intention to regain Heaven. Incapable of accepting the thought of submission and of his imprisonment in Hell. knowledge and ignorance/innocence. of many possible subjects for his capital work – subjects inspired either from British or from The subject and biblical history. the greatest synthesis of the Western literary tradition.
and their discussions are rendered in Book II. Chaos and Chance.” Meanwhile. Satan has reached the Garden of Eden. the overwhelming discord of the elements of a yet uncreated world. concentrates the doctrinal argument of the poem. 3.” and to make them transgress God’s interdiction of tasting the fruit of the Tree of Knowledge. cunning]. to seek the newly created Earth. and he flies away. assumes the danger of trying to break free from the formidable prison of Hell. and so “Heavenly love shall outdo [i. by virtue of his leading position. The corruption of God’s creation was thought better than any kind of revenge. God’s Son offers to pay this price for the reconciliation of man to his heavenly Father. God.” He thus anticipates the moment of the Temptation. and the only way to satisfy divine justice is a sacrificial death that would redeem man.e. surpass] hellish hate.4. Pandemonium*. explains to His Son the reason for his allowing this to happen. The accepted solution is to reach the new world created by God. the “wild abyss” governed by Night. Milton displays here at his best his gift of evoking vast spaces and general chaos. set him free from sin. Satan. His voyage through the great gulf separating Hell from Heaven.e.The works of John Milton The council of the fallen angels “fraud or guile [i. Satan is prevented from carrying out his design by the angels guarding Paradise. Satan also tells his companions of a prophecy according to which a new world and a new kind of creature were to be brought into being by God. He contemplates with envy the beauty and the innocent happiness of Adam and Eve. whose splendour is described more effectively through Satan’s jealous eyes. to find the weakness of man and to seduce him to join their party.e.2. in which his success was due to deceit and dissimulation.” God anticipates the event of His Son’s incarnation. Man’s sin of disobedience must be punished justly. is rendered in one of the most highly poetic passages in the poem. The divine foreknowledge of the Fall Book III. Divine justice and mercy Book IV: Satan’s arrival in the Garden of Eden 70 Proiectul pentru Învăţământul Rural . knowing in advance that Satan will be successful in his attempt to “pervert” man. and plans to “excite their minds / With more desire to know. death and resurrection. whose setting is in Heaven. the ascension from darkness to the light of his “native seat” – now forbidden to him –. The fallen angels are all called to a council in Satan’s infernal palace. i. and He commands His angels to adore and celebrate man’s Saviour and “universal king.
read again the text. at the end of the unit. If there should be major differences. Compare your answer with the one offered in the section Solutions and suggestions for SAQs. which contains God’s justification for allowing man to fall. What is God’s argument.4. and what are its implications? Answer in no more than 15 lines/150 words. in the Reader. Proiectul pentru Învăţământul Rural 71 . more carefully.The works of John Milton SAQ 3 Read Text 3.
in Milton’s poem. innocence and “virgin modesty. It is interesting that. Raphael’s warning to Adam In Book V. Raphael once again advises him against trying to penetrate the secrets of the “great Architect.e. the angel Raphael.e. so that he may know more about his enemy. and fear to transgress!” 3.” to fill in the “vacant room [i. King Anointed*”. space]” left by the fallen angels. Proiectul pentru Învăţământul Rural The divine creation: Good coming out of Evil 72 . and he explicitly warns Adam: “remember.4. without aspiring to know things above his power of understanding.” and reminds him that obedience to his Maker means enjoying the present happy state. The idea of Good coming out of Evil is central to Paradise Lost.The works of John Milton 3. and. Adam is grateful to Raphael.3. whose pride had been hurt when God proclaimed His Son the “Messiah. not before repeating his warning. and most evident in the treatment of the fall of Adam and Eve. with her “absolute” loveliness and grace. In Book VIII. in order to prolong his guest’s visit. sent by God. The story of the “deep fall / Of those too high aspiring who rebel angels (1808) rebelled / With Satan” is given by Raphael as a “terrible example” of the reward for disobedience. Adam asks Raphael to tell him the story of the fallen angels. visits Adam in Paradise to warn him about the danger from Satan. The creation of the world Raphael also tells Adam the story of the creation of the world and of man.” Man himself was created as a “better race. and about his perfect happiness in the company of “divinely fair” Eve. and wishes to know more about the celestial motions. not immutable [i. both in the large-scale description of the making of celestial bodies or in the sublime picture of the primal waters. In Milton’s interpretation. Satan. Blake: The downfall of the his own power and pre-eminence. he tells him about his own experiences after he was created.4. that cannot change]. in the multitude of its phenomena and living forms. The rest of Book V and Book VI are a retrospective account of the war in Heaven. Raphael tries to restrain Adam’s curiosity about “things above this world.” and that this happiness depends on his free will. The six days of the biblical Genesis are developed by Milton into an impressive poetic vision. instigated by Lucifer. and its impulse was God’s desire to create “good out of evil. after the defeat of the rebel angels. as this diminished W.” Raphael leaves them. and in the description of more familiar details of earthly Nature. Milton displays an extraordinary evocative power. God entrusted His Son with the act of Creation and the latter’s “powerful Word / And Spirit” gave life and order to “unformed” matter and turned chaos into cosmos. sweetness.4. Adam admits that. the “divine historian. the divine creation took place after the fall of Lucifer. He draws Adam’s attention that God has made him “perfect.” He explains to Adam that true wisdom lies in the desire to know those things which directly concern one’s own being. in Book VII.” for the evocation of the making of the world.
If your answer should differ significantly from the offered suggestions. 1794) Proiectul pentru Învăţământul Rural 73 . more carefully. the first moments in the creation of the world: the making of heavens and skies. Compare your answer with the one provided in the section Solutions and suggestions for SAQs.The works of John Milton SAQ 4 Text 3. A Prophecy.7. in the Reader presents. at the end of the unit. read the fragment again. in no more than 10 lines/100 words. Blake: Urizen as the creator of the material world (from the poem Europe. What does Milton suggest by the image of God using his “golden compasses”? Answer in the space below. W. and the “Spirit of God” infusing life into the primal ocean. through Raphael’s words.
flattered by his praise of her “celestial beauty. The seduction of Eve Book IX presents the great scene of Eve’s seduction by Satan. and all harmony between them is destroyed by bitter reciprocal accusations. Satan gives voice again to his torments and to his ambition of destroying God’s creation.” Back to guarded Paradise in this disguise. and all The effects of Nature is in pain. suspicion. and. while Adam tries to convince her that together they would be more safe from harm. their inward the fall on Nature peace. whose spirit has entered the body of a serpent.The works of John Milton 3. the thundering skies weep.” but to “open eyes” and bring those who taste closer to the condition of a god. Adam is chilled with horror at Eve’s irresponsible mistake but decides to share her fate. The “calm region” of their state of mind. her argument wins: she is willing to put her innocence to trial. Eve is amazed at the miracle of a beast capable of speech and. is now troubled by the “higher winds” of negative passions – “anger. The disaster of the original sin shakes the foundations of the natural order: Earth trembles. hate / Mistrust. W. he is disarmed by her Satan with Adam and angelic grace. but he regains the strength of his hate and appears to Eve (1808) her in the splendid shape of the Serpent. for a moment.e.4.5. Blake: Satan finds Eve alone. Their former innocent sensuality is now replaced by guilty lust and the feeling of shame. Meanwhile. discord” – which make reason and will helpless. Book IX: Eve and the Serpent (illustration by John Martin. Adam and Eve have a difference of opinion: Eve insists that they should divide their daily labour and work in different places. Credulous Eve tastes from the forbidden fruit and tries to convince Adam that its effect is not to open the way to “evil unknown. At last.” she is finally seduced by his promise of higher knowledge and by his assurance that there is no sin in such aspiration. 1827) 74 Proiectul pentru Învăţământul Rural . the “subtlest [i. since the “link of nature” is so strong between them that he cannot imagine living without her. most subtle*] beast of all the field. certain that the proud tempter will not be successful.
but. as God himself predicts: His Son. but are terribly humiliated to find that they are tasting only dust and ashes. which marks the conquest of the world by Satan.8. Seduced by the illusion of the Tree of Knowledge. 3. which will bring her close to the condition of God. by inciting her to disbelieve God’s threat. and he proudly boasts of it in the Pandemonium. at the end of the unit. _______ e. He tries to arouse Eve’s suspicion that God’s reason for His interdiction may not be man’s own good. He tries to introduce into Eve’s mind the doubt about God’s being “the author of all things. _______ c. read once more the indicated text and do the exercise again. the destined “restorer of Mankind*. Match these sentences with the fragment. He flatters Eve. in which these moves are illustrated. a. such as the building of a huge bridge across chaos by Sin and Death. The world after the Fall In the next books. on a separate sheet. He tempts Eve with the promise of absolute knowledge. _______ Compare your answer with the one offered in the section Solutions and suggestions for SAQs. If any of your matches should be wrong. hoping to arouse her pride.4. accusing Him of keeping Adam and Eve ignorant so that He may hold them in a state of servitude. He denigrates God.” is the one who will. from the speech by which Satan tempts Eve into disobeying God and eating the forbidden fruit. Write the number(s) of the corresponding fragment(s) in the indicated space. in the middle of this speech. at the end of each sentence.6. annihilate Sin and Death. He tries to dispel Eve’s fear of death. but he also adds symbolic episodes.” _______ g. but His fear that His power might be weakened if His creatures equalled him in knowledge. the whole assembly of fallen angels are temporarily turned into monstrous hissing snakes and dragons. He tries to awaken in Eve the spirit of defiance and insubordination. or fragments. _______ b. at last. they taste its fruit. _______ f. Milton continues to expand moments of the biblical Genesis. This emphasises the idea that Satan’s victory is not final. in the Reader contains four fragments from Book IX. Satan’s victory seems complete. 75 Book X: the world open to Sin and Death Proiectul pentru Învăţământul Rural .The works of John Milton SAQ 5 Text 3. the consequences of man’s original sin are unfolded in episodes of great poetic and emotional intensity. _______ d. The sentences below describe various moves in Satan’s strategy of seduction.
Adam suffers deeply for the loss of his native place and of God’s proximity. through Christ. Michael shows Adam a vision of the future. but of sadness. his suffering. pride. etc. The certainty that. – to the hostility of Nature. who can see the “many shapes of Death” and the many ways that lead to it. intemperance. 1827) 76 Proiectul pentru Învăţământul Rural . and He sends the archangel Michael to God decides Adam and Eve’s expulsion show them out. from man’s own vices – violence. The vision is replaced by Michael’s narrative in Book XII. the Son of God acts as a mediator between the sinful humans and His Father. God sends Him to communicate the divine punishment to Adam and Eve. Moments of the biblical history are unfolded before Adam’s eyes. God consents. resurrection and ascension to the coming of Heaven. but Michael comforts him. from Heaven Before they leave Paradise. The promise of where the central episode is the promised birth of God’s Son. Book XII: Adam and Eve leaving Paradise (illustration by John Martin. an anticipation of the effects of the original sin on the following generations. redemption*: Jesus. asking God to accept their prayers and sincere repentance. the emphasis on the presence and role of the Son of God increases. evil will finally be turned to good makes Adam and Eve’s exile from Paradise more tolerable. In Book X. death. but He decides that Adam and Eve may no longer live in Paradise. and offering to pay the price of His own death for the peace between God and mankind.The works of John Milton After the story of man’s fall. This comforting story gives Adam peace of mind and Christ the hope that man is able to build – in Michael’s words – “a paradise within.” founded on love. In Book XI. changed drastically after Adam’s fall. faith and good deeds. and the poem closes not on a note of despair. combining thus justice with mercy.
however. in the Reader represents the ending of Paradise Lost. It may be argued. Compare your answer with the one provided in the section Solutions and suggestions for SAQs.5. that both Satan and the human couple are heroic – each in a different way in their endurance of the bitter consequences of their sin. The heroes of Paradise Lost Many critics have remarked the paradox that the heroic spirit of Milton’s epic is embodied in Satan. which they fully assume. while Adam has more in common with a tragic hero. How do these lines present Adam and Eve at the moment of their exile into the world? Your answer should not exceed 12 lines /120 words. 3. more carefully.The works of John Milton SAQ 6 Text 3. read the fragment again. If they should differ in major points. Proiectul pentru Învăţământul Rural 77 . at the end of the unit.9.
5. he naturally assumes the role of a leader. This is why he is in a continual state of frustration and anger. From the beginning of the poem. the Romantic poets were to establish the view that Satan is actually the main hero. Before his fall. and he finds inner strength only in the intensity of his hatred. and his extraordinary courage “never to submit or yield” inspires his followers. Satan appears indeed as a champion of freedom. and his longing for the delights of his former existence torments him like an inner hell. “great in power / In favour and pre-eminence. in whom they saw an embodiment of the spirit of freedom and of resistance to tyrannical oppression.” Envy accompanies Satan’s thirst for power. Satan knows how to inflame again their ambition of re-ascending and their thirst for revenge.The works of John Milton 3. where there is “neither joy nor love.” as he cannot help comparing their bliss with his own condition in Hell. but for him freedom does not mean equality: among the rebel angels. but he also knows that this freedom is a form of punishment. and his great ambition is “to reign. He is envious Envy and hate of God’s Son and His title as King of Heaven. Satan seems to comfort himself with the thought that at least he is free. This sight is for him “hateful” and “tormenting. made happy in their innocent love.1.” He instigates the other angels to rebellion in the name of freedom from servitude. and that Milton gave the full measure of his literary genius in the character of Satan because he instinctively supported the idea of freedom.e. unwilling to serve a power that he considered tyrannical. In Hell. Milton’s Satan: the rebel’s inner hell The most fascinating of Milton’s heroes is undoubtedly Satan. William Blake remarked that Satan is Milton’s most accomplished creation. In moments when the fallen angels feel despair at having lost Heaven. One of the most powerful illustrations of this feeling which consumes Satan is the scene in which he sees Adam and Eve for the first time. Pride is one of Satan’s most prominent features in Pride and ambition Paradise Lost. he had been the first Archangel. since it is accompanied by suffering and torment. “Imparadised in one another’s arms” – i. He displays majesty and grandeur even in his fallen condition. Over a century after the poem’s publication. which is itself a paradise.” only the pain of longing and unfulfilled desire. 78 Proiectul pentru Învăţământul Rural . he is envious of God’s omnipotence.
” in whose destruction he finds complete satisfaction for his hurt pride.The works of John Milton 3.” He is “the author of all ill.” and the “Enemy of Mankind. and his power of seduction comes from the mastery of a very efficient rhetoric. The negative power of rhetoric: Satan the Tempter Gustave Doré: Satan (1870) Proiectul pentru Învăţământul Rural 79 . Satan’s greatness as a character comes from the sublime intensity of his negative passions. It is with “high words. Satan. the “author of all ill” The only way in which Satan can define himself as an equal to the power that he refuses to serve is to become its irreconcilable opponent. the destroyer of faith. but the epic poet insistently underlines their manipulative intentions. and he invests all his titanic energies in his destructive plan.5. Satan can assert his freedom of action only in the sphere of evil. His “immortal hate” makes revenge his only aim.” seeming reasonable and true. Satan is The Tempter. He is determined “to do ill” – which is “the contrary to his high will” – or to pervert the good done by God. Awakening in man the impulse to question. he is the promoter of suspicion and doubt. and “out of good still to find means of evil.2. The temptation of Eve is in fact the repetition of the earlier act of persuading the angels to join him in his rebellion. but by the evil subtlety of his mind and the corrupting power of his word. Milton insists on the fact that they abandoned “the eternal splendours of Heaven” and followed Satan seduced by his promises of freedom and greatness. It is also with “persuasive* words. that he determines Eve to break the divine interdiction.” which actually lacked substance that he manages to revive the courage of the depressed fallen angels. As God’s absolute antagonist. Satan represents the negation of the creative power of the divine Word: his revenge is accomplished not by force. Satan’s speeches have an impressive convincing force.
. “Better to reign in Hell than serve in Heaven. and read the indicated fragment again.3. “and “The mind is its own place.5. in Hell. 80 Proiectul pentru Învăţământul Rural . “A mind not to be changed by time or place. If there are significant differences.2. His words reveal some of the defining features of Milton’s hero.The works of John Milton SAQ 7 Text 3. Read the whole fragment carefully. and 3.) B.” (6 lines /60 words) Compare your answers with those offered in the section Solutions and suggestions for SAQs. at the end of the unit. revise subchapters 3. and in itself / Can make a Heaven of Hell.5. in the Reader contains a part of Satan’s speech before his followers. a Hell of Heaven”? (Answer in no more than 4 lines/40 words. and point out what features of Satan’s nature are illustrated by the following lines: A.1.
As a Christian. He is now more aware of his freedom and his potentiality. There is a tragic combination of greatness and weakness in their portrayal. he justifies “the ways of God to men” by showing the necessity of the divine grace. but armed with the wisdom of faith. of understanding and accepting his limits. of their wrong use of the freedom given by God. Although Paradise has become a forbidden place for them.” “Our Author. Both Adam and Eve display a certain Satanic fascination with the possibility of overcoming their condition through knowledge. ancestor. but as a consequence of their wrong choices. precursor]. deprived of worth.” “our general mother. the protagonists of Milton’s ambitious epic leave it not in hopeless disgrace. in Book XII. as well as his identification with them in their condition of creatures that have fallen. man has paid a terrible price for the wisdom of not imitating Satan.3. But it is an evidence of Milton’s genius that. As a humanist.e. Milton’s depiction of Adam and Eve Poetically. in spite of the fascination and seductive power with which he is invested. Proiectul pentru Învăţământul Rural 81 .” but also “our credulous mother.” “mother of human race. Adam is called Sire* of Men. He has the revelation of the grandeur of God’s plan and of the “goodness infinite” of the Creator. Blake: The expulsion from Milton deals with it as one of the central paradoxes of the human condition. The consequences of their fall are great because their virtues – so tragically tested – are great. the character of Satan is Milton’s greatest achievement in Paradise Lost. there is not any doubt left about his fundamental evil. but who can hope for redemption*. gifted with reason – a divine Eden 1808) attribute –. Fallen man is not a hateful creature. Milton is the heir of the Renaissance in his glorification of man and his virtues.5. and Milton expresses both admiration and compassion for them. He is now able to understand God’s final purpose. the titanic dimension of his suffering.” The insistent use of the adjective “our” suggests Milton’s invitation to the reader to join him in his identification. of turning all evil into good by the supreme act of divine grace: the acceptance of Christ’s sacrifice for man. Adam’s enlarged understanding emerges in perfect fusion with his strengthened faith. the sorrow of the fallen humans at their own weakness and their final recognition of their fault entitles them to God’s mercy. While Satan’s pain is always accompanied by the proud defiance of God. In his last conversation with Michael. Satan’s torments in Hell.” “Patriarch of Mankind. but W.” Eve is the “Mother of Mankind.” “Our great Progenitor [i. Milton depicts Adam and Eve’s fall not as the result of depravity. Created in God’s image. The way in which Milton refers to Adam and Eve throughout the poem points out his reverence to the original pair.The works of John Milton 3. are set against Adam and Eve’s lamentations after the fall.
a necessary part of His design. at the end of the unit.2. you are recommended a more careful reading of the indicated text. Subchapter 3. The same obsession with poetic ripeness may be found 82 Proiectul pentru Învăţământul Rural . Compare your answer with that offered in the section Solutions and suggestions for SAQs. the Nativity Ode. one of the greatest English poets. in no more than 8 lines/80 words. presents some of his notable early compositions – the Latin elegies. in which he explains to His Son why the fall of man was inevitable. Summary In this unit. If there should be major differences. in the Reader. contains a fragment from God’s speech in Book III. and the twin poems L’Allegro and Il Penseroso. His work is that of a Christian humanist: his astonishing classical erudition and his aspiration to the formal perfection of his classical models combine with his interest in religious themes. he prepared himself for it during long years. Some of Milton’s earlier works display this obsessive concern with his becoming a great poet.5. the pastoral elegy Lycidas. you have been acquainted with some aspects of the prominent literary personality of John Milton. Convinced also of his poetic vocation. Milton was deeply involved in the religious and political debates of mid-17th century. Devoted to the Puritan cause during the Civil War.The works of John Milton SAQ 8 Text 3. Read this fragment and summarise its argument.
presented in subchapter 3. his love of freedom. Baroque: see the Glossary in Unit 2. which are. Subchapter 3. apprenticeship: the training for a trade or for any kind of activity.5. but also in which man may. Civil War: see again the Glossary in Unit 1. Milton’s impressive epic poem Paradise Lost (1667) is the fruit of his mature vision. put in the service of evil.3. Proiectul pentru Învăţământul Rural 83 . Milton emphasises his fortitude and strength of will. and the culmination of his poetic achievement as a Christian humanist. and with the Christian compassion for their unhappy choice. be tested for the responsibility which must accompany the exercise of his free will. Milton justifies the fall of man and his exile from Paradise in the context of a providential history. the most fascinating and complex creation is Satan – Lucifer in his fallen condition.The works of John Milton in two of his sonnets. Subchapter 3. His destructive energy represents a negation of the creative power of the divine word. as a sign of consecration or sanctification.” and its great Christian theme is that of felix culpa. the creation of the world and of man. Undoubtedly. offers a brief presentation of the subject and structure of the poem. Adam and Eve are treated both with the typical Renaissance admiration for man’s potential and virtues. in which divine grace will eventually turn all evil into good. Key words ● ● ● ● ● ● ● ● ● Christian humanism elegy sonnet epic the Fall of Man the original sin free will Lucifer / Satan Felix culpa Glossary • • • • anointed: from to anoint: to apply oil on someone in a religious ceremony. concerns itself with Milton’s heroes in Paradise Lost. and the promise of man’s reconciliation with God through the sacrifice of Christ. however. his courage and majesty. which interprets poetically key moments in biblical history and elements of biblical mythology. at any time.4. Satan is dominated by powerful negative passions which keep him the prisoner of an inner hell. The declared aim of Milton’s epic is “to justify the ways of God to men. In Milton’s vision of the original sin. the fall of man and the loss of Paradise. The central events in Milton’s epic are the fall of Lucifer and of the rebel angels.
or some tragic event. In classical literature. clever in using tricks. by extension. Providence: God’s kindness. suffering and death of Christ. It may also mean cunning. the allegorical account of the poet’s journey through Hell. It means “the carrier of light. foreknowledge: knowledge of something before it happens. to a place of wild confusion. Lucifer: the name of the archangel who led the rebel angels. sonnet: see again the Glossary in Unit 1. Restoration: see again the Glossary in Unit 1. Man’s sin/fault was “happy” because its reward was Christ. humanism: see classical revival in the Glossary in Unit 1. the range of subjects in an elegy was wider.” After the fall from Heaven. Sire: a respectful term of address. Ovid: Publius Ovidius Nasso (43 B. felix culpa: this phrase comes from a line in the Latin version of the Catholic religious service held on Easter Sunday. Gallery of personalities • Dante: Dante Alighieri (1265-1321). benevolent care or protection of his creatures. secular: related to worldly things (as opposed to sacred).e. pastoral: see again the Glossary in Unit 1. to whom are attributed the great epic poems The Iliad and The Odyssey. Pandemonium: a word coined by Milton (from Greek pan: all. Roman poet. noise and chaos. the “great and good redeemer” (i. every. guided by Virgil and his idealised love Beatrice. formerly used when speaking to a king.).The works of John Milton • • • • • • • • • • • • • • • • • • • • • elegy: a meditative poem lamenting the death of someone. Puritans: see again the Glossary in Unit 1. to convince. subtle: not immediately evident. Homer: Greek poet (c.C. predestination: from a theological point of view. Italian poet. Proiectul pentru Învăţământul Rural • • 84 . author of La Divina Commedia. difficult to detect (or analyse).C. Restorer of Mankind: Christ as the one who will return (restore) man to God’s grace and to his original condition. he is called Satan. to cause to believe).-17 A. the one who sets man free from sin).). redemption: the deliverance (the rescuing) of man from sin through the incarnation. pamphlet: see again the Glossary in Unit 1. the act by which God determines in advance the events and their course. whose works include the poem on love Ars Amatoria and the poem on myths Metamorphoses. and daimon: demon) – the place where all demons gathered. epic: see again the Glossary in Unit 1. ode: see again the Glossary in Unit 1.e.D. persuasive: having the power or ability to persuade (i. not concerned with or related to religion. The word may refer. Purgatory and Paradise. 800 B.
2. at the end of the play.C. one of the greatest Roman poets. God’s creation. Send-away assignment no. 1 This assignment covers Unit 2 and Unit 3. in the Reader renders most of his memorable monologue. 2. At the beginning of Book IV. You will thus be drawing a portrait of Milton’s Satan..3.2. with special attention to the indicated subchapters.2. You may also consider it useful to pay attention to the following aspects when reading the text: • Satan’s present misery set in opposition with the memories of his former condition. in Heaven • his oscillation between remorse and pride • his oscillation between self-justification and self-blame for his rebellion against God • his consideration and rejection of the possibility of rehabilitating Proiectul pentru Învăţământul Rural 85 . His speech reveals Satan’s tormented mind and the multitude of passions that agitate his soul. before the final battle. 1. • Read attentively this fragment. Satan prepares himself to enter Paradise and to accomplish his diabolical design of tempting Eve. the baroque motif of the theatrical illusion is developed. what is the difference in the implications of the two play-metaphors? The answer to these questions should not exceed 25 lines / 250 words. either with remarkable lucidity or blinded by his hate and ambition. The weight of this task in the assessment of this SAA is 50%. and thus of destroying man.6. in Milton’s Paradise Lost. which reveals the complexity of Milton’s hero. as well as of SAQ 7 and its solution at the end of the unit might help you to better understand the text and organise your answer. • What characteristic baroque theme do both fragments illustrate? Given the different context – tragic in Macbeth. Prospero’s speech closes the representation given in honour of Ferdinand and Miranda. 40 lines/400 words should be enough for your answer (apart from the lines that you are expected to quote for illustration).. the paragraphs about Macbeth in 2. in the Reader represent short fragments from Shakespeare’s Macbeth and The Tempest. A revision of subchapter 3. whose epic poem The Aeneid relates the experiences of Aeneas after the fall of legendary Troy. before he firmly decides to carry out his evil plan. You will find it helpful to read again subchapter 2.). In both of them. and the last paragraph of 2.5. Macbeth delivers his monologue immediately after he is informed about Lady Macbeth’s death. Identify his conflicting feelings and the various thoughts that trouble his conscience. in which he explores his inner hell.The works of John Milton • Virgil: Publius Ovidius Maro (70-19 B.1. and 2.1. Texts 2. Text 3. romantic in The Tempest –. It will be therefore advisable to revise the preceding unit.4.
however. as man’s wrong choice was not the pure result of his free will. the “instrument” by which to exercise his free will. 1 will count as 10% in your final assessment. • the coherence. Remember that. The paradox of freedom. and reason makes man. in grading your paper.” man shared the perfection of the angels (“the Ethereal Powers and Spirits”) and their complete freedom of will and judgment. Milton emphasises the geometrical. i. since that would mean the “revocation” of His own “high decree” by which man was made free. is that one may choose right or wrong. both sonnets deal with the theme of loss (the poet’s sense of the passing of time.. SAQ 4 The image of God using His divine instrument (the “golden compasses”) to draw the “just circumference” of the world implies the idea of perfection and rationality.e. but the consequence of evil influence. Both man and the rebel angels are “authors to themselves in all. The poet places his trust in Providence. or reason. the divine punishment is compensated by mercy (the sending of Jesus as mankind’s saviour). is thus not attributable to God. 3. his blindness. responsible for his choices.The works of John Milton • • himself before God his determination to turn his suffering into satisfaction his impressive self-knowledge The weight of this task in this SAA is 50%.b. SAQ 3 God’s whole argument is based on the idea of freedom.a. Created “just and right. clarity. respectively) and with the anxiety that poetic fulfilment is late to come. and consistence of your ideas (40%) • the accuracy of your grammar (20%) • the accuracy of your spelling (10%) Solutions and suggestions for SAQs SAQ 1 1. Pay special attention to the instructions for each task. God cannot use His infinite power and knowledge to prevent the errors of those who are free to choose. SAA no. not God. The implication is that God gave man conscience. The fall of man. 2.. rational spirit of the Creator (he refers to Him elsewhere as “the great 86 Proiectul pentru Învăţământul Rural .c. your tutor will take into account: • the closeness of your answer to the formulated requirement (30%). SAQ 2 In the first section (the octave). like that of the angels. comforting himself with the faith that his poetic destiny is in God’s hands. The latter part of both sonnets (the sestet) changes the mood to one of patient confidence.” In the case of man.
Bucureşti: Editura Didactică şi Pedagogică. unless he is put in the situation of making choices. 2. Daiches. unless he exercises his will and reason. comforting himself that he exchanged submission for sovereignty. Satan feels God’s absolute power as a limitation to his enormous ambition. to be dictated by Reason. 4 SAQ 6 For Adam and Eve. SAQ 8 God cannot be pleased with blind submission. who draws a firm line between the formed and the formless (chaos). 153-163) 3. but at least they have the mutual comfort of their love.e.4. Ioan-Aurel (coord. 2. London: Secker and Warburg Ltd. His gift of Reason to man has no justification (it is “useless and vain”). The Renaissance and the Restoration Period. and the image of the terrible gates. they soon master the sadness of their loss and confront the wide world as a place in which they are expected to exercise judiciously their free will. 141-152) Proiectul pentru Învăţământul Rural 87 . This line illustrates both his aspiration to complete independence and his ambition. Further reading 1.The works of John Milton Architect”). Editura Universităţii Suceava. If God leaves man’s loyalty. e. and for him servitude in Heaven is the real hell. The Literature of the Beginnings. the intelligible and the unintelligible (the dark void). SAQ 7 1. Forced to look ahead. f. is meant to keep alive the memory of their transgression. Their hesitant steps suggest their awareness of the difficulty of all choice.4. Satan is willing to exchange the happiness of Heaven for the torments in Hell. 2. Incapable of obedience to God. Turcu. 2. 1983 (pp.3. The same rational spirit separates what is vital from what is “adverse to life” (the “infernal dregs”).. under the guidance of Providence. 1. Paradise is now a forbidden place. Luminiţa Elena. of the responsibility that accompanies freedom. d. SAQ 5 a. David. 3. These lines suggest Satan’s formidable strength of will and the independence of his indestructible spirit. i. guarded by fear-inspiring armed angels. It is his will and desire that give value to things around. Preda.e. 435-449) 2. as God has made him.). i. If Hell is a space of freedom. Man is not a free creature. 2 (“Shakespeare to Milton”). 1969 (pp. faith and love untested. 1. 2003 (pp. From Beowulf to Paradise Lost. b. of human solidarity. c. English Literature and Civilisation. He wants man’s obedience to be the result of an act of free choice. with passive virtue. then it is like Heaven for a spirit that cannot accept constraints. vol. A Critical History of English Literature. g.
The Restoration and the Augustan Age UNIT 4 THE RESTORATION AND THE AUGUSTAN AGE Unit Outline 4. 4. Gulliver. 4.4.4.4.3.3.1.4. a master of satirical comedy of manners The rise of sentimental comedy English literary Neoclassicism Great Augustan writers: John Dryden and Alexander Pope Principles of Neoclassic literary poetics Nature and Reason The Augustan ideal of style “To divert and instruct” – the imperative of Augustan literature The periodical essay The Tatler and The Spectator.5.3. 4.3.7.1.2. 4. 4.5. the frustrated idealist The importance of Gulliver’s Travels Summary Key words Glossary Gallery of personalities Solutions and suggestions for SAQs Further reading 89 89 89 89 90 90 92 93 95 95 96 96 98 98 98 100 103 103 103 105 105 107 107 110 110 111 111 113 115 116 88 Proiectul pentru Învăţământul Rural . 4. 4.4.2. 4. 4. 4.2.1. Unit objectives The Restoration and the Augustan Age Restoration drama Restoration theatre – a form of Court entertainment Dominant forms in Restoration drama Restoration comedy and its character types William Congreve.2. 4.1. 4.4. 4. 4. 4. 4. 4. “The Spectator’s Club” Augustan satire John Dryden Alexander Pope Jonathan Swift The structure of Gulliver’s Travels Lilliput and Brobdingnag: satire and utopia The fourth voyage.4.4.3.6.1.1. 4.1.2. 4. 4.4.4.2 4. 4.2.2.1.4.1.2.5.1.
Unit objectives 4. and. drama holds a place apart. and their re-opening in 1660. its audience being restricted to the fashionable circles gravitating around the Crown. The Renaissance tradition of the theatre as popular entertainment.1. under the patronage of king Charles II. Nature. grandiose and extravagant in tragedies –. One of the most important aspects of this literary age is the shift from the baroque* sensibility of the late Renaissance to the Neoclassic ideal of order. was attended by a strong anti-Puritan reaction. ♦ define the purposes and literary strategies of the periodical essay as an instrument of cultural enlightenment ♦ explain the remarkable development of satire in the Augustan Age. of increasing rationalism and secularisation.1. and of considerable diversity. and Jonathan Swift. it was a period of transition as well. ♦ identify the main concerns of literary Neoclassicism. central to the Neoclassic poetics of the Augustan Age. the cast of actors included women. Human nature. Restoration drama marked a clear split between popular and aristocratic standards of taste. the age in which the ideological premises of the Enlightenment were constituted. ♦ explain the relevance of concepts like Art. ♦ describe satirical devices used by John Dryden. ♦ specify the main targets of satire in Swift’s Gulliver’s Travels. the scenery became more elaborate – more “realistic” in comedies. was interrupted: Restoration theatre became almost exclusively a form of Court entertainment. clarity and elegant restraint. Charles II Stuart (reign: 1660-1685) Proiectul pentru Învăţământul Rural 89 . Restoration theatre – a form of Court entertainment In the heterogeneous literary picture of the Restoration. Alexander Pope. Significant changes took place in the theatre: the stage became closed on three sides. From a literary point of view. The Puritans had closed theatres in 1642. with spectators no longer allowed to sit on it. under the influence of French theatres. ♦ establish a relation between the spirit of Restoration comedy and the cultural-historical circumstances in which it emerged. addressing itself to an inclusive public. 4.The Restoration and the Augustan Age By the end of this unit you should be able to: ♦ identify the favourite themes and the typical characters of Restoration drama.1. Restoration drama The Restoration* was a period of significant social and institutional change.
” reflecting the aristocratic ethos of the time. refinement and sophistication. exotic places. with characters conventionally distributed into fabulously valiant heroes and virtuous beautiful heroines. The highest achievement of this kind of baroque theatre was provided by John Dryden’s plays*. Another dominant dramatic form during the Restoration was the comedy of manners.2. A certain coarseness of feeling. The Puritan rigidity and austerity of the former period were repudiated. Heroic tragedy* was a dramatic development from the epic poem. the cynicism. 4. but they were loveless marriages and love affairs without warmth and affection. reflected the hedonism* and promiscuity encouraged at court by Charles II himself (nicknamed “the Merry Monarch” for his pleasure-loving way of life). or in the survival of love over the criminal machinations of the villains. Dominant forms in Restoration drama The main kinds of drama were heroic tragedy and comedy of manners. and satirised the aspiration of social climbing and the ideal of virtue and respectability of the middle classes. and the plays of the Restoration Wits*. Gallantry. Restoration comedy and its character types Restoration comedy was “class drama.3. Restoration comedy was a mirror of the Comedy of manners environment in which it developed. were essential for the true man of the world. Conquest and seduction.The Restoration and the Augustan Age 4. lust. both of them highly conventional forms. It made fun of the people from the countryside. or Court Wits. Marriage and the games of love were a prevailing theme. sumptuous costumes. The action was usually set in remote. and absolute villains. ending in Heroic tragedy the death of the hero or heroine or both and the triumph of honour. One of the most common types was the rake – the libertine. and the characteristic theme was the conflict between love and honour. The conception of character in Restoration comedy was indebted to the Renaissance comedy of humours*. of incredible cruelty and perfidy. and. inflated conception of heroism – these were the ingredients of a dramatic genre whose spirit was in sharp contrast with the unheroic age of the Restoration.1. above all. betrayal and mockery were recurrent motives in the comic plots of Restoration drama. Sensational turns of situation. The range of character types in Restoration comedy was very diverse. the 90 Proiectul pentru Învăţământul Rural . on the one hand. the licentiousness* and frivolity characterising Restoration comedy were accompanied by a cult for elegance. and its audience was restricted to the exclusive and fashionable circles in London. ridiculing their crude manners and lack of sophistication. adultery. an artificial. fashionable manners. jealousy. Restoration comedies dealt primarily with sexual intrigue and the pursuit of pleasure – including the pleasure of cynical manipulation of others. wit*.1. magnificent settings. on the other. grandiloquent declamations and sentimental exaltation. although each in its own way and for different reasons.
” without scruples.The Restoration and the Augustan Age “young-man-about-town. cynical. the country squire*. the scheming valet. the ingénue. etc. If characters were usually static. lacking complexity. with several subplots and with action developing at a fast pace. Another frequent type was the fop*. one of the first actresses and the mistress of Charles II William Hogarth* Detail from The Rake’s Progresss (1735) Proiectul pentru Învăţământul Rural 91 . aspiring to the perfect adventure. pleasure-seeking. the plot of Restoration comedy was usually highly complicated. Contrasting types were the coquette. deliberately superficial in construction. young or old. despising marriage. but whose affectation* became the object of irony and satire. selfish and manipulative. Other common character types in Restoration comedy were the country girl. usually an unprincipled and heartless married woman. the lusty widow. who tried to imitate fashionable manners. whose generosity and kindness are satirised as weaknesses. and the trusting husband as dupe. more concerned for his reputation as a wit than for honour. whose simplicity and ingenuousness made her a perfect prey to the sophisticated seducer. Nell Gwynn (1650-1687). or fool.
T F 9. at the end of the unit. to 4.3. T F 6. Read the statements below and identify five true ones. simple action. T F 2. Restoration theatre introduced professional women actors in performances. elegance. The Renaissance comedy of humours inspired Restoration dramatists in their construction of dramatic character.The Restoration and the Augustan Age SAQ 1 Let us revise some aspects concerning the Restoration drama.4. The Restoration rake as a typical character in comedy was representative for the atmosphere of licentiousness. Restoration comedy praised wit. Restoration comedy built its plot on a single. Circle appropriately T (true) or F (false). If any of them should turn out to be wrong. The main themes of heroic tragedy were seduction and the games of love. hedonism and amorality at Court. William Congreve.1. who resorts to all kinds of devices to avoid 92 Proiectul pentru Învăţământul Rural . a master of satirical comedy of manners Among the most representative authors of comedies during the Restoration period there were George Etherege*. William Wycherley* and John Dryden*. The middle classes and their moral code found a mirror in the comedy of the Restoration. 4. extravagant stage settings and highly rhetorical language. by doing the exercise that follows.1.1. T F 5. His satirical play Love for Love (1695) deals with the contrast between public reputation and private behaviour. such as the impoverished gallant. read again subchapters 4. Heroic tragedy reflected the realities and spirit of the Restoration Age.1. refinement and sophistication. The true master of Restoration comedy of manners was William Congreve (1679-1723). T F 4. T F Check your answers in the section Solutions and suggestions for SAQs. The baroque character of Restoration heroic tragedy resided in its sensational plot. frivolity. T F 8. It displays typical Restoration characters. T F 3. T F 7. and satirised clumsy manners and dull simplicity. 1.
as these were remote from their experience. restore his fortunes and win the love of his mistress. Congreve’s merit is to have turned stereotypical characters into credible. etc. The rise of sentimental comedy* Congreve belongs to a period of transition in the evolution of comedy. mixed marriages between aristocracy and the newly rich.The Restoration and the Augustan Age William Congreve (1679-1723) his creditors. half-sad. and the shifting relationships and alliances. the pair of witty lovers. The situation. perfectly aware of each other’s faults and playing various games which keep them on the border between independence and surrender. when Augustan* England was seeking for social stability and cohesion. A shift in taste was taking place in the context of social change – the rise of a prosperous class of merchants. and friendship to jealousy.5. the dramatic productions still preserved characteristic farcical elements and something of the brilliant artificiality of Restoration comedy. It has a sophisticated plot containing several strands of action and centering on the relation between Mirabell and beautiful Millamant.1. the witty and resourceful servant. half-amused. the awkward country-girl. The indecencies and blasphemous spirit of earlier Restoration comedy became the object of severe condemnation by public opinion. involving a multitude of characters. Drama was changing under the pressure of middle class taste. and it had to take into account the general concern for the improvement of manners that developed in the late 17th century. He gave grace to the conventions of a highly artificial form of drama. Congreve’s finest comedy is The Way of the World (1700). Towards the end of the 17 th century. Proiectul pentru Învăţământul Rural 93 . increasingly middle class. which reminds of some of Shakespeare’s comedies. the ambivalent motivations and feelings (ranging from love. consistent characters. with a rare concern for the accuracy and elegance of expression and for the balance of sentences. is extremely complex. hate and disgust) give this play an equivocal tone. and were not interested in the rituals and games of fashionable life or in the sparkling wit duels. bringing it to perfection. The new audience in the theatres. 4. admiration. affection. psychologically subtle and complex. disapproved of the licentiousness of Restoration comedy. but they were now clearly intended for a middle class audience. adopting a moralising tone and recommending virtue and sensibility above refinement and wit. He is the most gifted of the Restoration dramatists.
If there should be significant differences. who is sincerely in love with Millamant and wishes to marry her. in Act IV.1. their agreement has serious implications. 94 Proiectul pentru Învăţământul Rural . However. under the appearance of frivolity. at the end of the unit." Presenting their expectations from each other in a half-joking way. in no more than 15 lines / 150 words.. read again subchapter 4. which presents Millamant's demands.. What is the idea of marriage that her conditions suggest? Answer in the space below. In a witty dialogue.4. they seem to be playing a game.1. they establish and agree on the terms of a "contract. Read Text 4. as well as the indicated fragment.The Restoration and the Augustan Age SAQ 2 In Congreve's play The Way of the World. Millamant is also in love. Mirabell is a reformed rake. but she accepts Mirabell's marriage proposal on certain conditions. Compare your answer with the one offered in the section Solutions and suggestions for SAQs.
or of the heroic couplet* over blank verse*. and Alexander Pope* in the 18 th . balance. The excellence of their literary work and the elegance and force of their critical arguments made them central figures of the Augustan Age. John Dryden (1631-1700) Proiectul pentru Învăţământul Rural 95 . Besides Dryden and Pope. other great writers who were influenced by Neoclassicism or defended its doctrine were Jonathan Swift*. Great Augustan writers: John Dryden and Alexander Pope Two great writers constituted the main influence in the development of the Neoclassic literary doctrine in England: John Dryden in the 17 th century. of the elegant French classical drama over English Renaissance drama. Oliver Goldsmith* and Samuel Johnson*. and harmony extended beyond literature.2. Joseph Addison*. His main critical work is An Essay on Dramatic Poesy (1668). 4. In it. a society exhausted by civil wars was expressing its need for stability and moderation. Augustan England believed that a cultural idea of balance. Pope presents the basic concepts and theses of this literary orientation in a poetic form of remarkable elegance and clarity. in a series of essays and prefaces where he discussed matters of literary composition and taste and defended his own literary practice. His didactic poem An Essay on Criticism (1711) is the most outstanding literary manifesto of English Neoclassicism. elegance. English literary Neoclassicism* The Neoclassic aspiration for order. The dialogue form of this essay allows Dryden to avoid being dogmatic and to look with healthy scepticism at a wide range of critical issues.2. and propriety would favour the spirit of social unity and order and would contribute to the protection of the achievements of civilisation. His work doesn’t equal in variety that of his predecessor and master. in which he systematises his Neoclassic view on literary art. such as the superiority of the Ancients over the Moderns. John Dryden illustrated with masterpieces all contemporary literary genres. but it represents the quintessence of the Augustan literary ideal.The Restoration and the Augustan Age 4. Alexander Pope brought to perfection Dryden’s achievements in poetic style and technique. and he laid the foundations of modern literary criticism. The return to the ancient models of the classical era was accompanied by the sense of an analogy between the present of England and the Roman times of Caesar Augustus*. In both cases.1.
Following Nature presupposed first of all its understanding. which in turn required good judgment and common sense. of infinite variety. in satirical or burlesque* works.. The quest for patterns of general significance through the study of particulars was not only a literary precept. and whose creative power was a matter of intuitive genius and not of acquired art. which referred to the writer’s obligation to use those elements of diction* and composition which were considered proper for each genre. and the poet might disregard them. and he could master the secrets of poetic art by the study and imitation of the works of ancient authors.e. for instance. The rule of decorum 4. This was the case of the genius. for the Augustans. lacking ornament. skilful transgression. The Neoclassic emphasis on the principles and rules that guided successful creation did not mean blind adherence to them. since it dealt with noble characters and actions. would lead to the revelation of the typical and universal features. The Augustans were aware that the heights of literary achievement couldn’t be reached by simply learning the trade. i. required an elevated style. Epic and tragedy. but a general intellectual tendency in the age. yet achieve great beauty. that it was an inborn gift that made a poet.3. was Shakespeare. Proiectul pentru Învăţământul Rural Human Nature 96 . The concept of Human Nature referred to those features of human character and experience. whose imagination had nothing to do with training or learning. i. To follow / copy Nature was the writer’s main endeavour. which usually presented ordinary people and actions. Nature and Reason According to the Neoclassic doctrine. and in order to do that accurately he was supposed to follow Reason as the main guide. the main source of inspiration for the writer was Nature*. who respected no particular rules and followed no particular models.e.The Restoration and the Augustan Age 4. comedy. was expected to use a common. The study of human nature in its individual aspects. a dignified diction.2. the emphasis on discipline in art. skill. to make form and substance adequate to each other. Principles of Neoclassic literary poetics One of the most important features of literary Neoclassicism was the concern with rules and norms. The belief in order and correctness was reflected in the neoclassic principle of decorum [from Latin: propriety]. The most eloquent example. It was the existence of this rule of decorum that enabled Neoclassic authors to derive great effects from its deliberate. A poet’s innate talent needed training. which were seen as common to all humanity and as permanent and unchanging. the most valuable store of literary experience. Sometimes rules might be too constraining for this natural gift. humble style.2.2. by which the Augustans meant most frequently Human Nature. on the other hand. and to those patterns of behaviour.
g.3. The rationalist poetics* of Neoclassicism owed greatly to Horace*. a combination achieved through reason.3. Compare your answer with the one offered in the section Solutions and suggestions for SAQs. but also to imported French ideas – e. and beauty was the result of the balanced combination of talent and inspiration with skill. If there should be significant differences.2. in a paragraph of no more than 4 complex sentences (80-100 words / 8-10 lines).The Restoration and the Augustan Age A rationalist poetics All the faculties involved in the process of creation were seen as subordinated to Reason. in the Reader represents a fragment from Samuel Johnson’s Preface to his 1765 edition of Shakespeare’s works. and what Neoclassic conviction do they imply? Answer in the space below. at the end of the unit. to those of Nicolas Boileau*. Proiectul pentru Învăţământul Rural 97 . read again subchapter 4. or art*. and the indicated fragment. What are the main ideas in this fragment. SAQ 3 Text 4. Emotion was supposed to be filtered and controlled by reason.
The writer's art was a form of social communication. “To divert and instruct” – the imperative of Augustan literature The Neoclassic concern with standards of good writing must be seen in connection with an important feature of Augustan literature: its integration with social life. manners and taste. the language of prose aimed more and more at simplicity. with the cultivation of men’s best virtues through polite learning*. of the belief in progress an in man’s perfectibility.” Augustan wit 4. where nothing seems to be studied. precision and clarity.5. Wit described a style which combined elegance with profundity. of quick accumulation of information. affectation were rejected. and the measure of the writer’s skill was his ability to convey an impression of “natural easiness and unaffected grace. of critical debate in every field. 4. The periodical essay Although the normative poetics of Neoclassicism had in view mainly poetry and drama. In the context of general progress. but to be a functional part of the community. Literature was supposed to delight but also to instruct – to offer not only aesthetic pleasure. It displayed flexibility skilfully controlled. “grace and strength united. but also moral edification and standards of good judgment and behaviour. Neoclassicism cultivated an ideal of style characterised in the first place by intellectual clarity and expressive restraint. The periodical essay is the Augustan prose genre which contributed immensely to the forging of a modern prose style. too.3. refinement with wisdom. yet everything is extraordinary” (Thomas Sprat*). A more straightforward style in prose was an imperative in an age so much concerned with education of mentalities. 98 Proiectul pentru Învăţământul Rural . or.4. and he was not supposed to withdraw in an ivory tower. unnecessary ornament. Ostentation. as Oliver Goldsmith defined it.The Restoration and the Augustan Age 4. The marked didactic tendency of much of the literature of this period reflects the Augustans’ pride in the conquests of their civilisation and their determination to assume responsibility for the defence of its achievements. and which illustrated most eloquently the didactic impulse of all Augustan literature. and of the increase and diversification of the reading public. This ideal of style is best summed up by the Augustan notion of wit. The Augustan ideal of style The suitable doctrine for the Age of Reason.2. It must not be forgotten that this was the age of the Enlightenment*.2. its effects were considerable on prose. eloquence with restraint.
and they were published with varying regularity. contributing significantly to the “polite” education. Journalism and coffee houses* were the main instruments by which people’s curiosity was satisfied. Essay periodicals were usually the work of a single author. the periodical essayists aimed at broadening the intellectual horizon of their readers. the enlightenment and the improvement of taste of its widest section.” that ignorance is a source of evil. opened in 1688. as a reaction to the ever greater demand for political news and gossip. at a time when political tension in the country and the events of war on the Continent engaged public attention to a high degree. dominantly middle class. The reflections on both modern and ancient works. the debate on a variety of critical and aesthetic issues made the latter familiar to the public. or to the discussion of literary matters. In order to counterbalance this tendency. with Alexander Pope. The periodical essay constituted a chronicle of contemporary manners and an effective instrument of moral and social criticism. they created an alternative kind of periodical publication. Many periodical essays were dedicated to the dissemination of philosophical and scientific notions. for a clientele of ships' captains. They believed. some of them being issued daily. At the same time. consisting in essays on a variety of topics. that “a little knowledge is a dangerous thing. merchants and ship owners 17th century coffee house in Covent Garden Proiectul pentru Învăţământul Rural 99 . Some writers felt that this popular avidity for political news might inflame partisanship and favour a spirit of social discord. th Edward Lloyd’s coffee house. meant to provide guidance in matters of manners and morals.The Restoration and the Augustan Age It developed in the late 17 and early 18th centuries. at cultivating their minds. and to offer intellectual enlightenment to a wide audience. the middle class readers.
Joseph Addison wrote: The mind that lies fallow* but [i. and by far the most popular ones. The Tatler and The Spectator. 100 Proiectul pentru Învăţământul Rural . Steele and Addison assumed the mission of public educators and proceeded to rescue their audience from what they perceived as “that desperate state of vice and folly into which the age is fallen” (Steele). think again and try to do the exercise once more. “The Spectator’s Club” Among the most important periodical essayists. Like other writers. collected in book form. on a separate sheet. Think of present relevance of this remark.The Restoration and the Augustan Age SAQ 4 In one of his periodical essays. and Joseph Addison’s The Spectator (1711-1714). Explain the analogy that his observation invites us to develop. in no more than 12 lines / 120 words. whose essays were published several times in the century.e. they tried to make their essays not only instructive but also attractive and amusing. were Richard Steele*’s The Tatler* (1709-1711).1. 4.3. only] a single day sprouts up* in follies that are only to be killed by an assiduous culture. at the end of the unit. To increase the efficiency of their undertaking. If they are significantly different. Compare your answer with the one offered in the section Solutions and suggestions for SAQs.
• Will Honeycomb. for The Spectator. wit and understanding. a group of six fictional characters “engaged in different ways of life” and representing various social and human types.e. He is a man of “great probity. a model of honesty. hard work and skill. laziness. generous and cheerful. and sloth [i. an expert in fashion and gossip. rather than a merit.” He is a worthy representative of the middle class. The six members of The Spectator’s Club were: • Sir Roger de Coverley. ready to take responsibility for the progress of the nation. he is a somewhat old-fashioned gentleman. skills] and industry. instead of pursuing the career of a lawyer.” but whose life constitutes an eloquent example of moral integrity. in which they collaborated.” • Captain Sentry. Steele and Addison invented The Spectator’s Club. that “it is stupid and barbarous way to extend dominion by arms. He believes. Now. idleness] has ruined more nations than the sword. a middle-aged squire. but their good breeding qualifies them both for the same society of gentlemen. a gallant. as his father had intended for him. who had spent a turbulent youth in the company of the Restoration Wits.The Restoration and the Augustan Age Joseph Addison (1672-1719) For example. actions and writings of the ancients makes him a very delicate observer of what occurs to him in the world. and the reflections of “Mr. taciturn and with “no interest in this world. no longer as repulsively materialistic and greedy. 101 Proiectul pentru Învăţământul Rural . for true power is to be got by arts [i. a competent justice of the peace*. who had to quit the military profession because his strict honesty proved to be an obstacle to the advancement of his career. Many essays presented little stories about incidents in their daily lives.” and “his familiarity with the customs. and great experience. in his county. “a very philosophic man. • A gentleman who. a rich London merchant. manners. He is a pleasant company for his acquaintances in town. for instance. “a person of indefatigable industry*. and his harmless eccentricities are accompanied by a natural benevolence that endears him to everybody. Sir Andrew Freeport’s convictions are those of an enlightened middle class. steady effort] makes more lasting acquisitions than valour [i.” or that “diligence [i. His wisdom and gravity are set against the frivolous interests of Will Honeycombe. bravery in battle]. strong reason. an embodiment of its energies and enterprising spirit. a man of the world.” He thus embodies the Augustan humanist view that true knowledge of human nature comes from a combination of first hand experience and learning. He is the prototype for the character of the country squire in many 18th century novels. • A clergyman. otherwise harmless and a well-bred gentleman. a courageous.e. • Sir Andrew Freeport.e. Spectator” on their opinions and behaviour in a variety of circumstances constituted real lessons in manners and morals.” of wide learning. modest and commonsensical person.e. His character is the first notable literary representation of the merchant class in a serious and dignified way. interested in his appearance and displaying a certain affectation in behaviour. turned to the study of literature.
Sir Richard Steele (1672-1729) 102 Proiectul pentru Învăţământul Rural . and write them in the indicated spaces below. more carefully.1. 1. 7. common sense.The Restoration and the Augustan Age The gentleman represented an ideal of social behaviour. Identify at least eight such features. 4. read again subchapter 4. Compare your answer with the one offered in the section Solutions and suggestions for SAQs. combining the external marks of social decency (pleasant conversation. 8. cheerful disposition. SAQ 5 From the description of the members of the Spectator’s Club. 2. at the end of the unit. it is clear that Addison promotes certain virtues.3. If there should be major discrepancies. a cultivated mind and superior understanding. the talent of never offending the others) with such qualities as moral and physical courage. which are important for the Enlightenment ideal of social integration. 5. 3. 6.
often touched by ironic humour. Augustan satire defended the values of civilisation in a civilised way: elegance. admiration and condemnation. with implications concerning the whole of Augustan civilisation. are mingled: the evil conspirator. its cult of reason and common sense. It tells the biblical story of Absalom’s rebellion against his father. The best achieved portrait is that of Achitophel / the Earl of Shaftesbury. a merciless attack on literary pedantry and dulness. selfishness. The hero of this mock-heroic epic* is Mr. brave and fearless man. could not entirely remove or hide its tensions. Pope. at the advice of Achitophel* (cf. turning it into an allegory of contemporary political struggles. Charles’s brother and heir to the throne. and Achitophel is the first Earl of Shaftesbury. disloyal and excessively ambitious. Political and religious dissensions. made king by the Goddess Dulness* in a realm turned to complete confusion by the vain ambitions of the Dunces – the multitude of bad writers and Proiectul pentru Învăţământul Rural 103 . from political and social life.4. greed. 4. The Augustan Age is the great age of satire in English literature. appears also as a stormy spirit. the Duke of Monmouth. Perhaps the greatest Augustan satire on the world of letters is Alexander Pope’s The Dunciad* (1728. hypocrisy. king David. The perfection of Dryden’s diction and his masterful use of the sketches heroic couplet* combine with his brilliant of character.1. Swift – aimed it at a variety of targets. stability and order of a remarkable civilisation. contradictions and dark aspects. and satire became their formidable weapon. struggle for power and profit.4. intrigues. folly. Alexander Pope Satirical attacks on literary mediocrity and incompetence were frequent in an age so preoccupied with standards of correctness and excellence. a passionate. The writers’ sense of mission turned them into guardians of the enlightened values of their time. Augustan satire The refinement and elegant surface of the Augustan Age. Bayes*. the instigator of the opposition to Catholic James Stuart. whose claim to the throne was justified by his Protestant religion. 1743). Samuel. in which Dryden’s praise and criticism.4. 4. and affectation were felt as diseases which threatened to weaken the force. John Dryden A remarkable example of political satire is John Dryden’s Absalom and Achitophel (1681-1682). and its most outstanding representatives – Dryden.2. 15-18). Absalom is the latter’s illegitimate son. urbanity and refinement made it a sophisticated instrument of correction. genuinely gifted for leadership.The Restoration and the Augustan Age 4. The biblical characters represent English political figures: King David is Charles II. to religious debates and literary practices.
Compare your answer with the suggestions provided at the end of the unit. and the satire ends with the apocalyptic extinction of the enemies of Dulness: Fancy (i. SAQ 6 Text 4. he reflects on the art of the satirist. read the fragment again. however. more attentively. imagination). Religion. and skill in the use of parody and the burlesque. Philosophy.4. in the Reader represents a fragment from one of John Dryden’s essays. imaginative inventiveness. as it betrays Pope’s fear that civilisation and its conquests are vulnerable to unreason. Its implications. Explain this analogy.e. Truth. If it should be significantly different. The empire of Dulness finally extends to the whole universe of the spirit. pointing out the Augustan conception of satire. Here. are more disturbing than entertaining. and Morality. 104 Proiectul pentru Învăţământul Rural . Pope’s satirical allegory displays unequalled comic virtuosity and wit. concerning satire. in a paragraph not exceeding 12 lines / 120 words. in the section Solutions and suggestions for SAQs. that the corruption of the spirit (which follows from the corruption of the word) leads to the crumbling of all order.2. drawing an analogy between satire and a public execution. Art. Science. and revise subchapter 4.The Restoration and the Augustan Age Alexander Pope (1688-1744) critics who aspire to undeserved fame. The final triumph of this “great Anarch*” is rendered by a parodic allusion to the biblical Genesis: the “uncreated word*” of Dulness restores the primordial chaos.
3. Gulliver is cast on the shore of a country inhabited by the Houyhnhnms. philosophical. The most powerful expression of Swift’s satirical genius is Travels into Several Remote Nations of the World “by Lemuel Gulliver.4. Balnibarbi. because he is perceived as a Yahoo endowed with “a rudiment of reason.4. Glubbdubdrib. respectively. where mad scientists are engaged in phantasmagoric projects. and his nostalgia for the perfect world of the 105 I. and the disappointment and anger at seeing reason so often abused.4. building houses starting from the roof. with elements of the marvelous or fantastic fable. like extracting sunshine from cucumbers. or softening marble to make pincushions. It is an allegorical satirical travel book. whose admirable society is built entirely on rational principles. he is shown the Academy of Lagado (a burlesque of the Royal Society). Jonathan Swift. he learns about the Struldbruggs.A Voyage to the Country of the Houyhnhnms Proiectul pentru Învăţământul Rural . In it. Jonathan Swift (1667-1745) 4. In his last voyage. and where human creatures. Swift was divided between the idealist confidence in man’s capacity of selfimprovement. popular in the 16th and 17th centuries. Back in England.” therefore a potential threat to that civilisation. the Yahoos. His hurt sensitivity and disillusionment are conveyed in a series of prose satires which cover a wide range of issues – political. Gulliver finds himself among people who are twelve times smaller and. Gulliver is finally expelled.” a work which Swift published anonymously in 1726. as well as an unequalled master of satirical wit and irony. justice and freedom. These satires have established his reputation as a champion of moral virtue. Luggnagg and Japan IV. Gulliver can’t help seeing his fellow humans as disgusting Yahoos. appear in the utmost state of degeneracy. combining the conventions of utopia* and of the imaginary voyage. a hater of pedantry and pretence. absorbed in mathematical speculations and music. the flying island.The Restoration and the Augustan Age 4. In Balnibarbi. is inhabited by impractical intellectuals. Laputa. Gulliver’s Travels pretends to be the record of the most astonishing experiences of an average man. but the significance of his work may be extended to the philosophical question of the human condition itself. Like many of his contemporaries.A Voyage to Lilliput II. curious and resourceful. In Lilliput and Brobdingnag. economic. Jonathan Swift Pope’s friend. Swift alludes satirically to a multitude of aspects from the contemporary political. and literary. bigger than himself.A Voyage to Laputa. intelligent speaking horses. an uncompromising defender of truth. a race of immortal people whose eternal life is in fact a curse of endless decay. The structure of Gulliver’s Travels Consisting of four books. social and intellectual realities. In Luggnagg. with a sharp sense of observation. In his third voyage he visits several strange places. in his potential as a rational creature. whose adventures as a surgeon and then the captain of several ships take him through the most unusual places. From this last country. is one of the greatest satirists in world literature. religious.A Voyage to Brodingnag III.
who is thus forced to examine itself in a distorting mirror. 1. Each answer should be limited to 3 lines / 30 words. and he also re-interprets attitudes observed in the Yahoos in the light of the information received from Gulliver about human customs and institutions. The parallel results in a grotesque image of humankind. Compare your answers with those provided in the section Solutions and suggestions for SAQs. 2. read the fragment carefully once more. If none of the features mentioned there corresponds with your answers. 106 Proiectul pentru Învăţământul Rural . His initial curiosity and openness to the diversity of human nature turns into madness and misanthropy.The Restoration and the Augustan Age rational horses alienates him completely from his own kind. 3. and he prefers now the company of horses. Find. in Text 4. 4. incapable of suffering the proximity of humans. at the end of the unit. from the Reader.5. SAQ 7 Gulliver’s Houyhnhnm master tries to understand human nature by analysing the behaviour of the Yahoos (since he perceives Gulliver to be one). four features which humans and Yahoos are found to share.
Gulliver is confronted. and his position in that strange land is highly ambiguous. etc. Gulliver in Brobdingnag 4. Gulliver’s failure to accept the mixed essence of man. The Lilliputians’ physical smallness is accompanied by moral flaws – they prove to be mean. Their non-human shape suggests that the absence of passion. These comic details are satirical allusions to contemporary or recent events. cruel and hypocritical. ambitious. means de-humanisation. he contemplates with shame and despair all the imperfections of the human race. his real humiliation is caused by the unflattering contrast between his own race and civilisation. Political corruption is institutionalised (for example. the highest offices in the state are obtained by those who know how to entertain the king best. forgetting that man holds a middle place in the Great Chain of Being*. and they constitute a miniature picture of England. The latter is shocked at the moral abjection and contempt for reason that he discerns under the gilded surface of Gulliver’s patriotic description of his country. with its religious controversies among Anglicans. in his last adventure. The error of Gulliver* is that he adopts an impossible deal of perfection. Their society is deeply divided by absurd dissensions: for example. by dancing on a rope. Dissenters and Catholics. but their universe is completely deprived of emotion and feeling. In spite of Gulliver’s dimensions (an allegorical representation of his complex of superiority). from which he chooses to leave. vain. ruled by an enlightened monarch. etc.The Restoration and the Augustan Age 4.6. The fourth voyage. In the Yahoos. Lilliput and Brobdingnag: satire and utopia In the first two books of Gulliver’s Travels. Gulliver.4. its thirst for war – the endless conflict with France. In Brobdingnag. he sees ideal creatures. of the capacity for affection. He is no longer certain of the essence of his own nature. the frustrated idealist After the comic-disturbing examples of unreason witnessed in his third voyage.5. However. as he is in permanent danger from creatures so much larger than him. he is actually physically vulnerable in this world. with the hardest dilemma and the deepest humiliation.4. jumping over or creeping under a stick. to integrate Proiectul pentru Învăţământul Rural 107 . In the Houyhnhnms. or between those who break a boiled egg at the round end – the "Big Endians" – and those who break it at the pointed end). The Houyhnhnms may be an allegorical embodiment of moral perfection attained through the exercise of pure reason. its political parties – Whigs and Tories –. The Yahoos and the Houyhnhnms are a double mirror for Gulliver. governed only by reason. between those who wear shoes with high heels and with low heels. issues or figures. his vulnerability increases. physical size indicates allegorically features of human nature.). and he realises how far man is from moral perfection. and the utopian commonwealth of Brobdingnag.
the Yahoos would stand for the essentially corrupt nature of man.illustration from a 1947 edition of Gulliver’s Travels 108 Proiectul pentru Învăţământul Rural . filthy. an image which earned Swift the reputation of a misanthrope. Illustration from an early nineteenth century abridged editions (for children): Gulliver entertaining and being entertained by the tiny Lilliputians.The Restoration and the Augustan Age reason with feeling and instinct. The Houyhnhms and the Yahoos have also been seen as allegorical representations of Reason and Instinct. unteachable and ungovernable. For many readers. In a “theological” perspective. The last book of Gulliver’s Travels has been given a multitude of interpretations. while the Houyhnhms would represent man who has escaped the consequences of the original sin. or as opposite caricatural views of man in the state of nature. and he ultimately becomes the target of Swift’s irony. the Yahoos embodied Swift’s own vision of mankind as hopelessly degraded. Houyhnhnm and Yahoo . makes him a frustrated idealist.
however. more carefully. find anti-utopian elements in it. the Houyhnhnms’ society is perfect – a true utopia. Point out both kinds of aspects in the description contained in Text 4. Formulate your answer in no more than 10 lines / 100 words for each aspect.6. If there should be major differences. and by mixing the desirable with the unacceptable.4. Proiectul pentru Învăţământul Rural 109 .The Restoration and the Augustan Age SAQ 8 Swift’s ironic method is to mislead the reader by giving the appearance of rationality to the absurd. you need to read the fragment again. and to revise subchapter 4. The careful reader will.6. in the section Solutions and suggestions for SAQs. from the Reader. Utopian aspects: Anti-utopian aspects Compare your answer with the one provided at the end of the unit. For Gulliver.
For Swift. The period of the Restoration overlaps with the emerging Augustan Age. narrow-sightedness. It is an age of transition. It was a chronicle of manners and an instrument of social and moral criticism. and by means of it. was another characteristic genre. his learning and sense of literary tradition. Dryden. grotesque.). on Reason and common sense in aesthetic choice. Steele. caricature. One of the literary forms that developed during this period was the periodical essay (Addison. Like heroic tragedy (e. Its flourishing in the Augustan Age reflects the integration of literature with social life. Pope) and in prose (Swift).g. which contributed greatly to the development of a modern prose style. parody. Swift’s allegorical satire Gulliver’s Travels is the most accomplished exploration of the contradictions of the Age of Reason. Swift. He intended to “vex the world” in order to “mend” it. It cultivated the idea of the “marriage” of Art and Nature. 110 Proiectul pentru Învăţământul Rural . placing wit above virtue. the pressure of the taste of the rising middle class replaced it with sentimental comedy. and he used every weapon in the satirist’s arsenal to awaken man from his selfcomplacency: biting irony. when literary Neoclassicism developed. The latter’s eminently rationalist poetics placed emphasis on clarity and elegance in style and composition. Dryden. both in verse (Dryden. generally. arrogant ignorance and unfounded pride in his reason. Congreve. Satire. a wide public. accommodating a diversity of literary forms and traditions – old and new. a masterpiece of irony which places under scrutiny many of the myths of the Enlightenment. While heroic drama sustained an impossible. but also an enduring achievement of the enlightened spirit. Pope. the belief in progress and improvement in an age which was also that of the Enlightenment. this highly artificial and conventional form was an expression of the taste of the Court aristocracy. dominantly middle class. comedy was licentious and cynical. Gradually. and. etc. including that of Reason itself.7. the writers’ sense of responsibility towards the values of their civilisation. Swift’s extraordinary inventiveness and narrative gift.The Restoration and the Augustan Age 4. on the rule of decorum. inflated ideal of heroism and virtue. Johnson are central figures of the Augustan Age. and his brilliant wit make Gulliver’s Travels not only a landmark in Augustan literature. Addison. on expressive restraint and skilfully controlled wit. The importance of Gulliver’s Travels Gulliver’s Travels is the expression of Swift’s indignation and anger at man’s foolishness. Dryden). Summary The Restoration is a historical and a literary period. Steele). therefore also capable of error. was enlightened in matters of literary taste and intellectual achievements. Goldsmith. and recommended as a model the literary wisdom of the Ancients. reason was not to be taken for granted: man was only a creature capable of reason.4. A representative literary genre for this age is the comedy of manners (Etherege.
all the acquisitions of the human spirit become meaningless. admirer. political or religious orientation. his craftsmanship.1. coffee houses: since the 1650s. or human skill (as contrasted to the work of Nature). and the Glossary in Unit 2. Dulness as “Great Anarch” is the ruler of spiritual chaos.The Restoration and the Augustan Age Key words • • • • • • • • • • • • • • • • The Restoration The Augustan Age heroic tragedy comedy of manners Neoclassicism rationalist poetics Nature/Human Nature art wit to delight and instruct periodical essay The Spectator’s Club satire allegory utopia irony Glossary • • • Achitophel: the story of Absalom and Achitophel is told in The Old Testament. the acquired competence of the writer. it may also refer to a woman’s lover.” where Dryden would come regularly. 111 • • • • • • • Proiectul pentru Învăţământul Rural . greatly concerned with appearances. art: in the Neoclassic doctrine. In Pope’s satire. They were usually frequented by people of the same social rank. For instance. but is intended to impress others. Art may generally refer to the work of man. blank verse: see again the Glossary in Unit 1. dress or behaviour which is not natural. acquiring quickly the status of real “institutions” of opinion. achieved by training and practice. burlesque: see the Glossary in Unit 1. affectation: a manner of speech. gathered people of the literary profession or interested in literary matters. or escort. they were convenient places for socialising and for the dissemination of news.1. in the 2nd Book of Kings (verses 15-18). Anarch: a personification of anarchy. baroque: see again subchapter 2. “Will’s Coffee House. Augustan: see Augustan Age in the Glossary in Unit 1. which designated a fashionable. profession or interest. beaux: plural of beau (“handsome” in French). In her empire of darkness and confusion. well-dressed man.
heroic tragedy: see again subchapter 1. honour. to deceive). stupidity. In the 1743 version of The Dunciad. “Mr. referring not only to external nature. a word designating a person who is stupid or slow to learn. licentiousness: uncontrolled sexual behaviour.3 in Unit 1 (heroic drama). mock-heroic epic: see mock-heroic style and epic in the Glossary in Unit 1. characters were constructed on the basis of a particular disposition. or “humour.e. boring. landscape. Bayes: a name which was frequently applied satirically to a writer. a strictly ordered hierarchical system. “Dull” also means uninteresting. Dryden himself had been attacked several times as “Mr. Dunciad: the title is coined after The Iliad. Enlightenment: see again the Glossary in Unit 1. Great Chain of Being: an ancient world-picture. which conceived of every being in nature as having its well-established place in an uninterrupted chain of increasing degrees of complexity.4.” diction : see poetic diction in the Glossary in Unit 1. Bayes. from dunce. in which the destruction of one “link” would bring chaos. Gulliver: the name sounds very similar to the adjective “gullible.” Nature: an inclusive concept.3 in Unit 1. but to the whole of created reality. figuratively: undeveloped or inactive. fallow: (about land) left unplanted or unseeded. the bay-leaf crown was the ancient emblem of fame. and distinction. surviving through the Middle Ages and the Renaissance into the 18th century. who had criticised Pope for his edition of Shakespeare (1725). In Pope’s satire. Bayes” refers to Lewis Theobald. trait . unexciting. industry: the quality of being hard-working or of being always employed usefully. Pope replaced Theobald by Colley Cibber. Mr. hedonism: a lifestyle devoted to the seeking of sensual pleasure. heroic couplet: see again subchapter 1. justice of the peace: a person appointed by the crown to judge less serious cases in small courts of law. dulness: in a strict sense. shortness of sight or imperfect sense of things. the Proiectul pentru Învăţământul Rural 112 . fop: a man who is excessively concerned with fashion and elegance.” another word for “laurel”. inclination. slowness in thinking and learning.The Restoration and the Augustan Age • • • • • • • • • • • • • • • • • • comedy of humours: see Jonson in the Glossary in Unit 1. who in 1730 had become Poet Laureate. Pope uses the word in the enlarged sense of “all slowness of apprehension. It derives from “bay. In this kind of comedy.” a “force inertly strong” which corrupts understanding and confuses the mind. i.” which means easy to fool or persuade to believe something (from “to gull”: to cheat.
e.4 in Unit 1. Restoration Wits: see again the Glossary in Unit 1. sprout up: to begin to grow or develop. and sentimental novel in subchapter 5. Tatler: a “tattler” is a person who gossips. uncreated word: with reference to the literary world.” from Greek u = not. founder of literary journalism.” utopia: a genre in fiction whose name comes from Sir Thomas More’s work Utopia (1516).1. Restoration: see again the Glossary in Unit 1. or who chats or talks idly. the conception about literature and the creative act of a certain literary school or writer.4. for the notion of sentimentalism. making literature “dull. polished). wit: see again the Glossary in Unit 1. Neoclassicism: see again the Glossary in Unit 1. Boileau. He excelled in all literary genres of his time. poetics: the system of principles and conventions which govern a certain literary form. i. squire: a country gentleman. this phrase suggests the lack of inspiration. polite learning: the knowledge acquired through classical education (polite: refined. elegant. Gallery of personalities • • • Addison. author of poems. perfect society (literally: “no place.The Restoration and the Augustan Age • • • • • • • • • • • • cosmic harmony and order manifested in the appearances of this world. He established the periodical essay as a literary genre. Pope’s satire warns thus about the dangers of lowering literary standards. of imagination and originality. He was equally successful as an author of heroic dramas (see again subchapter 1. Among the latter. he translated from ancient authors. and topos = place). in which he outlines the features of an ideal. or literature in general. 113 Proiectul pentru Învăţământul Rural . and he contributed significantly to the dissemination of the values of the Enlightenment in England. whose poem L’art poétique (1674) established the canons of taste and the standards of literary judgement for European Neoclassicism. especially the main landowner in a village. and he was the pioneer of modern English literary criticism. of taste or skill.3 in Unit 5. Marriage à la Mode (1672) distinguishes itself by its brilliant wit combats and effective social satire. essays and dramatic works. sentimental comedy see again subchapter 1.3 in Unit 1) and of comedies of manners. John (1637-1700): one of the most outstanding figures of the Restoration and the Augustan Age.4. Nicolas (1636-1711): outstanding French poet and critic. Joseph (1672-1719): representative of English literary Neoclassicisn. Dryden.
a masterpiece of 18th century fiction.The Restoration and the Augustan Age • • • • • • • • • • Etherege. as well as to the forging of a polished literary prose style. Goldsmith. satires and epistles. 114 Proiectul pentru Învăţământul Rural . Sprat. Steele. and The Man of Mode. member of the Royal Society. preoccupied by the cultivation of an English style that should be simple. and of the influential critical work Ars Poetica. and a major representative of English sentimentalism.). Alexander (1688-1744): the most illustrious representative of English literary Neoclassicism. Pope. His comedies The Country Wife (1675) and The Plain Dealer (1676) satirise the discrepancies between the social surface of respectability and the unscrupulous selfishness that may hide behind it. Hogarth. author of odes. who called him a “comic history-painter. Latin poet of the time of Caesar Augustus. Johnson. of Irish origin. he is the author of the novel The Vicar of Wakefield (1766). extremely popular owing to his “modern moral subjects” – a series of paintings or engravings which tell a story and constitute a comment on social. in which he is the optimistic spokesman of the Age of Reason.C. His works include the philosophical poem An Essay on Man (1733). Samuel: see the Gallery of personalities in Unit 2. or Sir Fopling Flutter (1676). Wycherley. which contains an allegorical satire on the division of the Christian Church. Richard (1672-1725): Augustan essayist and dramatist (he established sentimental comedy on the English stage). concise and flexible. In the mock-heroic allegory The Battle of the Books (1704). Jonathan (1667-1745): the greatest English satirist. Besides his famous Gulliver’s Travels. he endeavoured to lift Latin literature to the level of Greek literature. Like his friend.” Horace: Quintus Horatius Flavius (65-8 B. as well as the mock-heroic poem The Rape of the Lock (1712). Swift. a bitter satire in defense of the Irish people. and A Modest Proposal (1729). George (1634-1691): a member of the group of Restoration Wits. Among various other works. political and moral vices. Thomas (1635-1713): mathematician and writer. He was a friend of the novelist Henry Fielding. His best comedies are She Would If She Could (1668). an unequalled master of irony and wit. his works include A Tale of a Tub (1704). he argues for the superiority of the Ancients over modern authors. clear. Together with Addison. William (1640-1716): one of the Restoration Wits. William (1697-1764): painter and engraver. Virgil. he contributed to the spreading of Enlightenment ideas. Oliver (1728-1774): upholder of the Neoclassic standards of style and composition.
regardless of their particular condition. or judgment.e. and she proposes to reject the social rituals and fashions that would require them to wear masks. opinions and tastes. good judgment. common to all humanity – is greater than the pleasure of “sudden wonder” procured by the depiction of “particular manners” and by “fanciful invention. benevolence. 2.” Shakespeare will appeal to readers across the ages. of those features which are universal. furnished with ideas. 8. good breeding.F SAQ 2 Millamant has an unconventional view of marriage.The Restoration and the Augustan Age Solutions and suggestions for SAQs SAQ 1 1. abdicating from reason.F. good sense. 6. She wishes for a sincere and authentic relationship. because he succeeded in rendering the general “truths” of human nature. in an analogous sense. industry.e.T. 4. SAQ 3 The pleasure of contemplating representations of “general nature” – i. reasonableness.F.T. She also refuses to see marriage as a limitation of the woman’s freedom. by the standards of her social environment. for sophisticated Millamant. of Human nature.F. and. 9.T. a way of protecting their intimacy and their feelings. 3. and she rejects the idea of the wife’s subordination. Addison’s observation reflects the faith in man’s intellectual and moral perfectibility through responsible education – an attitude characteristic of the Enlightenment. and should not try to impose his/her habits on the other. the refusal to make a public show of their affection. integrity. 5. Civilised reserve in society. common sense. educated to think – will employ itself with trifles. so the mind which is not assiduously and constantly cultivated – i. which may be cultivated or left to “lie fallow.” Just as weeds (i. SAQ 4 Addison builds an analogy between the human mind and a field. Dryden makes an analogy between the sharp blade of the executioner’s sword and the sharp irony and wit of the satirist.T. Her desire to preserve an area of privacy in her domestic life reflects the fact that she does not conceive love and marriage as incompatible with one’s independence. sense of responsibility. Proiectul pentru Învăţământul Rural 115 . In marriage.T. Culture is thus seen as an improvement of nature. each partner should accept and respect the other’s wishes. wild plants growing where they are not wanted) will invade an uncultivated field. SAQ 6 Satire is the art of pointing at people’s faults without resorting to insult or calumny. 7. His characters embody the fundamental human passions which will always move mankind. diligence. Johnson implies that an author’s greatness depend on his insight into Human Nature.e. SAQ 5 honesty. is. modesty. open-mindedness.
which breeds imaginary ills. The civilised art of satire is opposed to the coarseness and brutality of personal attack and insult. only the species counts. and no personal choice in the matter of marriage. The irrational greed and avarice. deprives their thinking of flexibility and nuance. Bucureşti: Editura Didactică şi Pedagogică. The tyranny of reason also rules out affection and emotion: they have no particular feelings for their own offspring. and the hierarchy of their society is based on racial discrimination (“inferior” Houyhnhnms will fatally be servants).” the subtlety of his accusations. The incapacity of choosing a ruler according to real merit. The Renaissance and the Restoration Period. which are the literary equivalent of a man’s “slovenly butchering. which is meant only for procreation. 2. the “unnatural appetite” for things whose value doesn’t justify the effort and energy spent in their acquisition and preservation. the ability of the worst to set themselves as leaders. Both of them need skill – or “art” – to do this in a satisfactory way. the rulers’ habit of surrounding themselves by favourites whose role is to flatter and to encourage them in their abuses. 5. The art of the accomplished satirist consists in the elegance. and the equal education of males and females was a progressive Enlightenment ideal. Cornelia. 537-550) 2. the education in the spirit of moderation and industry. David. Macsiniuc. London: Secker and Warburg Ltd. SAQ 8 Utopian aspects: The cultivation and exercise of reason. so the satirist is merciless in his denouncing human flaws. the exclusion of opinion. Ioan-Aurel (coord. decency and civility are certainly desiderata of any civilisation. 2003 (pp.. 3 (“The Restoration to 1800”). The Houyhnhms are not divided by quarrels. the silly behaviour of women determined to draw attention to themselves. the generalises extension of friendship and benevolence. Further reading 1. The spirit of competition. 1983 (pp. which makes social progress inconceivable. They practice population control. The tendency to idleness. the jealousy (envy) and the aggressiveness towards one’s fellows.” SAQ 7 1. 4. In the absence of affective attachment. Anti-utopian aspects: the absolutisation of reason.The Restoration and the Augustan Age Just as the executioner will implacably carry out the capital punishment. Womankind’s lustfulness and inclination to coquetry. conflict and self-interest. English Literature and Civilisation. 3. The individual is of no importance.). 180-187) 3. vol. the “fineness. A Critical History of English Literature. Daiches. The Novel in Its Beginnings. 1969 (pp. Editura Universităţii Suceava. civility and friendship become a cold and superficial form of social relationship. The English Eighteenth Century. ultimately of imagination. Preda.33-66) 116 Proiectul pentru Învăţământul Rural .
2. 2 Solutions and suggestions for SAQs Further reading 118 118 118 118 119 121 123 123 124 125 127 128 128 129 130 132 132 133 134 134 135 136 136 136 137 139 139 140 142 142 143 144 145 146 148 Proiectul pentru Învăţământul Rural 117 .5.1.1.1. 5.2.1. Gallery of personalities SAA No.4.3. 5. 5.7.3.3.3. 5.2. 5. 5. 5. 5. 5. 5.3.3.4. Unit objectives The Age of the Enlightenment: the rise of the novel. 5. 5. 5.3.4.4. 5. 5.2. 5.2.1. 5.2.1.6.1.2.4.2.2.5. 5.2.3. 5.4.6.2.1.8. 5.4.2.3.4. 5.4.3. 5.4.5. 5.The Age of the Enlightenment: the rise of the novel UNIT 5 THE AGE OF THE ENLIGHTENMENT: THE RISE OF THE NOVEL Unit Outline 5 5. 5.2.
Romances were long narratives combining heroic adventure and passionate love. values and attitudes characteristic of the Age of the Enlightenment ♦ describe typological features of the studied novels ♦ compare the studied novelists from the point of view of their approach to character and plot ♦ delineate a character from one of the novels under discussion. Novel and romance in the 18th century The dominance of female readership explains the enduring popularity. emancipation and progress received unprecedented prominence and were vital for the self-assertion of the new class.1. and there is a connection between. in the early years of the 18 th century. and their involvement with literary life was increasing. the rise of the middle classes. of a genre which became the main rival of the novel: the romance.1.1. more inclusive reading public. Such tales gratified the fantasies of a class of readers who were still barred from public self-assertion. in various aspects of the novels discussed in this unit. tolerance. The late 17 th century had seen a flourishing of this kind of fiction.The Age of the Enlightenment: the rise of the novel By the end of this unit you should be able to: ♦ identify. confined to the 118 Proiectul pentru Învăţământul Rural . a certain tendency to women’s emancipation. Not only were women the most numerous “consumers” of novels. Women’s education was beginning to be encouraged. whose action was often set in remote. whose vast majority was middle-class. but there was a considerable amount of novels written by women. A significant part of this new reading public consisted in women. and generally about women. This new literary form embodied the democratic and revolutionary impulse of a century in which the issues of individual liberty. and whose protagonists were of noble stock. and the development of the novel. exotic settings. Background and main concerns The novel’s emergence is commonly associated with the aspiration of the middle classes to overcome cultural marginality. 5. natural rights. in the light of the author’s aesthetic principles ♦ describe the peculiarities of the narrative technique and style used by the studied authors ♦ define the concept of metafiction and describe metafictional strategies in Sterne’s novel Unit objectives 5. mostly imitations of French models. The general growth of literacy* in the 18 th century led to the rise of a new.
By contrast. its determination to participate in the general Augustan quest for an ideal of social harmony. truth to Nature – is what primarily distinguished the novel from romance. On the other hand. Thus. in its concerns. The knights and princesses of romances were replaced. because the depicted experience and universe were more or less familiar to them. It attempted to correct morals and educate manners by censuring vice and folly. The novel proposed norms of moral conduct and standards of social integration. its endeavour to propagate a certain moral and social code. For most women. Proiectul pentru Învăţământul Rural 119 .1. whose province was the spectacular and the extraordinary. The novel reflects. Characters are no longer idealised.The Age of the Enlightenment: the rise of the novel domestic universe.2. by common people. a reality that was close to the average reader’s experience became a source of imaginative interest. moral or psychological detail. with entertainment frequently subordinated to the instructive aim. The ordinary aspects of life. their common denominator was the attempt to convey an impression of authentic experience. but from contemporary life. history. the novel’s aspiration was to fulfil the double mission of all Augustan literature: to entertain (to divert) and to instruct (to edify). Didacticism and realism in the 18th century novel Whereas the basic aim of romance was to entertain. legend. 5. In spite of the great diversity of novels in the 18th century. in the novel. realised with an unprecedented wealth of social. shows its assumed responsibility towards contemporary civilisation. The novelist no longer drew his plots from mythology. its emphasis on individual experience is the literary expression of the spirit of individualism associated with the growing importance of the middle classes. its normality. On the one hand. but distinct individualities. The represented experience was meant to engage the reader’s interest both because it was familiar and because of its uniqueness. Realism – or. the novel reflected the general critical spirit of the Age of the Enlightenment and participated in its project of emancipation through education. socially and materially dependent on men. The readers of novels could identify themselves with the characters. it recommended patterns of behaviour and models of success that were relevant to the condition of middle class readers. the province of the novel was the familiar. to their relevance for the reader’s aspirations and possibilities. or previous literature. vague and abstract figures. in Augustan terms. a double tendency of the Age of the Enlightenment. romances were therefore literature of escape. the novel’s didactic vocation. The popularity of the novel and the success of its didactic mission owed greatly to its endeavour of convincing the reader of the lifelikeness* of the represented characters and actions.
Women were … 3.1. If there should be major differences. by centering its interest on the relationship between the individual and his/her social environment. 120 Proiectul pentru Învăţământul Rural . at the end of the unit. The tensions and conflicts between private/individual convictions and inclinations.The Age of the Enlightenment: the rise of the novel The novel offers imaginative versions of the reconciliation of these two tendencies. … 4.1. constitute the foundation of all novelistic plots in the 18 th century. The novel’s interest in the tensions between the public and the private reflected … Compare your answers with those given in the section Solutions and suggestions for SAQs. read again subchapters 5.2. 1. Each full statement should describe a general aspect concerning the rise of the novel as a genre in the 18th century. By contrast with the escapist spirit of romances. and public/social norms and conventions.1. and 5. on the other. Two or three lines (20-30 words) should be enough for each completion. The rise of the middle classes … 2. The didactic mission of the novel in the 18th century consisted in … 5. on the one hand. SAQ 1 Complete the sentences below.
3. popular in the 17th and 18th centuries.The Age of the Enlightenment: the rise of the novel 5. Richardson). and the world represented in such novels is open. They invariably contain the motif of the journey. Fielding).g. • • The novel of manners submits to the reader’s judgements various types of social behaviour. examining the conflicts between private morality and public expectation. The analysis of sentimental response was meant to elicit from the reader an empathic understanding. the comic vision is always in the service of social and moral criticism. displayed not only in fiction. and its beginnings are defined by a tendency to “sponge” on other literary forms. which claim the reader’s attention more than the characters do. The most popular kinds of novels in the 18th century were: Adventure novels share with romances an emphasis on action. • Picaresque* novels may be considered a special case of adventure novels. classic models to follow. The comic novel in the 18th century is inscribed in a long tradition of deflation of romance. On the other hand. but they differ from romances in their attention to realistic detail.g. misfortune to the solution of all conflicts and the integration of the protagonist in a social structure. The sentimental hero/heroine unites a remarkably acute sensibility with spotless virtue and a deep sense of honour. their distance from the every day experience of common readers. exposing their irrelevance and unreality. romance is trivialised through parody*. therefore an ally to realism. on events. The characteristic comic plot presupposes the passage from disorder. Instead. irony and burlesque*. It may either offer a comprehensive mirror of the social diversity of the age (e. since this kind of fiction subverts the prestige of older genres (the epic. This makes the 18th century novel rather difficult to classify. a wide variety of influences went into its making. The motif of the travel is central. and extremely diverse. inclusive. belonging to several categories at once.e. The comic novel is an opportunity for writers to display a critical attitude not only to reality. • Proiectul pentru Învăţământul Rural 121 . repetitious. but to literature as well. and which emphasised the importance of feeling and its close connection with moral virtue. from which it borrowed devices. for the author. in imitation of the descriptive accuracy of travel literature. Many novels cut across divisions. or explore personal conflicts which involve different sets of values (e. Typology of the novel in the 18th century The novel as a genre had no authoritative. • The sentimental novel is the literary manifestation of that cross-current within the Age of the Enlightenment which placed value in emotional response rather than in reason. confusion. an opportunity for comprehensive social criticism. in which the action is episodic. and the hero’s various encounters are. forms of expression. i. loosely structured.1. the romance). but also in poetry and in drama. Sentimentalism became a literary fashion. patterns and motifs.
• SAQ 2 What kinds of novels do the following sentences describe? Write the answer in the space indicated by the continuous line. 3. ________________________ 8. It explores the labyrinth of emotion and feeling. ________________________ Compare your answers with those provided in the section Solutions and suggestions for SAQs. after each sentence. usually with supernatural ingredients. It explores the diversity of social manners and their articulation with moral values. ________________________ 7. 122 Proiectul pentru Învăţământul Rural . at the end of a process in which he/she learns to accord private impulse with social expectation. read again subchapter 5.. It offers more delight in ________________________ action than in character. mocking their elevated style by applying it to common. 1. It defines itself in contrast with the “serious” narrative genres. The achievement of maturity leads to the hero’s satisfactory social integration.3. It is concerned with the individual’s full assertion as a social being. Its hero is a marginal figure who aspires to social success. trivial subjects. It centres on intellectual debate and confrontation of ideas. deliberately reducing the importance of plot or emotional conflict. ________________________ 5.1. in their confrontation with moral choice. ________________________ 4. ________________________ 6. ________________________ 2. If you have failed to match any of the descriptions with the right type of novel. this illustrates the concern of the Enlightenment with the development of the individual as a social being. Two of these descriptions do not match any of the types of novels described in the subchapter above.The Age of the Enlightenment: the rise of the novel The novel of education (the Bildungsroman*) is concerned with the formation of character through the accumulation of experience. at the end of the unit. and his/her experiences provide a satirical survey of the contemporary society. in an atmosphere of gloom. It presents a tale of mystery and horror.
They differ in the objects of their “realistic” approach: whereas Defoe’s interest is invested in the external world of fact. Features of Defoe’s heroes Daniel Defoe (1660-1731) Proiectul pentru Învăţământul Rural 123 . They are pragmatic. Puritan* background. Mariner. The Life and Strange Surprising Adventures of Robinson Crusoe of York. is invariably accompanied by moral reformation. and their adventures show the individual victorious over circumstances and environment (physical or social). on his fiction. resourcefulness and capacity for adjustment and survival. This confers vividness to their narratives. in actions. They share a middle class. Defoe and Richardson: from circumstantial realism to sentimental truth Each of these two novelists had an essential contribution to the rise of the novel. in circumstantial details.2. in the next years. Its tremendous success encouraged Defoe to produce. the constant striving towards accuracy of description. Richardson focuses on the inner world of thought and feeling. Both of them enjoyed enormous popularity not only in England. Their novels are the literary reflection of the spirit of individualism that characterised the age. cast in a picaresque form. on the movements of consciousness and the emotional response to moral problems. but also on the Continent. several adventure novels. 5. They were all stories of success. This aspect in Defoe’s novels points to his Puritan background. establishing it as the most popular literary genre in the 18th century. and tracing the protagonists’ struggles to achieve material prosperity as a condition of a stable social position.1. and both of them focus on the individual in his/her struggle of securing a legitimate position in the social structure. Both Defoe and Richardson display in their narratives a remarkable faithfulness to detail. when the writer was almost sixty. of such non-fictional kinds of writing as the spiritual autobiography or didactic religious treatises. the power to hold attention and keep curiosity awake. Their rise to social respectability and wealth. to the influence. dynamic and versatile. His heroes are remarkable in their vitality. their social insertion. on the individual’s striving towards some form of personal achievement.2. published in 1719. Daniel Defoe and the novel of adventure Defoe’s career as a novelist started with his masterpiece.The Age of the Enlightenment: the rise of the novel 5.
of his moral strength to carry on against all obstacles. struggling to impose on an alien space his middle class idea of order. to buy slaves.” as he came to call his novels – the attempt to inculcate religion and morality through a gripping story which has the appearance of authenticity. Son of a successful German merchant settled in England. he learns that his prospering business in Brazil has made him a rich man. The subject is inspired by 17th century stories of castaways on desert islands. but during a terrible storm he is shipwrecked on a desert island. Under Defoe’s pen.2.” without “any appearance of fiction in it. Providence helps him finally leave the island.1920) 124 Proiectul pentru Învăţământul Rural . he turns from a reckless. Illustration to the first edition (1719) Robinson on the beach (illustration by N. Robinson becomes engaged in a heroic struggle for survival. After 26 years.2. The only survivor.” It is. the desire for adventure and for “seeing the world.The Age of the Enlightenment: the rise of the novel 5. prudent and calculating mature man. On his return to England. and the book ends with his promise of further accounts of his island. he rescues a savage from his fellow cannibals. In the 28 years of solitary life. a celebration of man’s power of spiritual endurance in adversity. In the hope of increasing his wealth. He marries. such an experience became an archetypal one. C. one of Defoe’s “honest cheats. Robinson displays from a young age the romantic inclination of wandering. Robinson Crusoe: theme and plot Robinson Crusoe is recommended as “a just history of fact. Robinson settles in Brazil where he becomes a relatively prosperous plantation owner. as well by the more recent case of a sailor who had lived in complete solitude for five years on an uninhabited island. After several misadventures at sea. romantic youth into a realistic. where he has established a colony. has three children. he starts a voyage to Africa.” He disregards his father’s advice of continuing the family trade and keeping within the limits of his “middle station in life. Wyeth . in fact. not only physical but also spiritual.” and leaves home on board a ship. names him Friday and turns him into his loyal servant and receptive pupil. in soon left a widower.
tracing Robinson’s progress from sin (his disobedience of his father). Compare your answer with the one provided in the section Solutions and suggestions for SAQs. as one of the great myths of individualism of Western civilisation. Interpretations of Robinson Crusoe Defoe’s novel lends itself to a variety of interpretations: as an allegory of man’s evolution from the state of nature to civilisation and its institutions. and finally to his conviction of God’s benevolent design. In this light. embodying elements of contemporary social philosophy and economic theory. It corresponds to the Proiectul pentru Învăţământul Rural 125 .” 5. Robinson perceives his exile from the world as a terrible punishment for his transgression of his father’s word. Isolation is no longer a misfortune. Gradually. In his initial struggle with despair.The Age of the Enlightenment: the rise of the novel SAQ 3 How does the description “honest cheat” apply to Robinson Crusoe? Answer in no more than 8 lines / 80 words.. but the proper condition for the examination of consciousness.2. Robinson comes to see his solitude rather as a spiritual and moral shelter. making sure you understand the meaning of the phrase “honest cheat.2. If it should differ considerably. to the awakening of religious conscience. as a political or economic utopia.2.3. the motif of the island acquires symbolic Robinson’s island dimensions.2. at the end of the unit. as an allegory of the ecological development of history. It may also be read as a spiritual autobiography in the Puritan tradition. the awareness of his sinfulness and the sincere desire for repentance.1. read again subchapters 5. and 5. as his life becomes more secure and his trust in Providence increases.
Robinson Crusoe also celebrates those human features which enable man to master circumstances: pragmatism. Defoe’s novel is thus a celebration of the dignity of work. in the space below. its essential role in man’s material and spiritual progress. where his daily bread is earned with “infinite labour. If you should fail to find any of the features mentioned there. if the biblical curse of work is meant to remind Adam permanently of his original disobedience..2. which will serve his instinct for independence. at the end of the unit. at least four features of the hero’s character as they are illustrated by this description.. 2. 4. morally autonomous.. perseverance.” However. as well as the fragment in the Reader. Robinson finds in it a “therapeutic” value.” Robinson perceives the island as the equivalent of a regained Paradise. or the felix culpa*. Crusoe’s years of solitude trained him for social insertion.g. It has its spiritual rewards. as a self-reliant individual. In this connection. He takes pleasure in his work). Compare your answer with the one offered in the section Solutions and suggestions for SAQs. or by a sentence (e.The Age of the Enlightenment: the rise of the novel The celebration of homo faber characteristic Puritan tendency to self-scrutiny and introspection. inventiveness. ingenuity). Like Adam. subchapter 5. and is thus a way of restoring a lost Paradise. perspicacity.3. food and the basic commodities of life turns into a source of satisfaction. you must read again the last two paragraphs of subchapter 5. You may render these features either by a single noun (e. SAQ 4 Read Text 5.” desires and “delights. 126 Proiectul pentru Învăţământul Rural . 1. with a well-defined utilitarian view of life. Changed in his “notion of things. Robinson is cast out from the “edenic” safety and happiness of his father’s home into an uncertain world of toil. 3. Enumerate. The enormous effort by which he secures shelter.2. g. the protagonist’s experience evokes the theme of the fortunate fall. and it is also symbolic of the Puritan sense of an intense personal relationship with God.2. describing in minute detail Robinson’s attempt to make an earthenware pot.
lack of unnecessary ornamentation. The latter owes greatly to Defoe’s experience as a journalist. concreteness.2. read the fragment and subchapter 5. His fiction has the remarkable power to evoke a tangible reality. episodic plots imitate the episodic quality of life itself. he paid little attention to matters of form. containing. on a separate sheet. SAQ 5 Analyse Text 5. the most common objects and actions in their particularity. clarity. in the Reader from the point of view of its style.4. Compare your answer with the one provided in the section Solutions and suggestions for SAQs. with unmatched vividness. It was with Richardson that “the sense of life” conveyed by the narrative was completed by a sense of form. in turn benefited from his innate gift for telling stories. The “journalistic” style of Defoe’s fiction is consonant with an ideal of prose style characterised by plainness. Defoe’s style The world of Defoe’s novels is the world of common fact and action. easy and eminently factual style made his writings accessible to a large audience. His linear. but on the complexity of character and human relationship. clear language. whose reality is difficult to doubt. His simple.The Age of the Enlightenment: the rise of the novel 5. He convinced readers of the truthfulness of his narrative by evoking. Identify in it at least four features of Defoe’s characteristic narrative style and write them in the space provided below. Robinson Crusoe is a gripping narrative.2. at the end of the unit. 1. arising from the complication of a plot centering not on episodic adventure. which. 127 Proiectul pentru Învăţământul Rural .4 once more and do the exercise again. rendered in a simple.2. at the same time. the frequent enumerations and inventories. Defoe’s novels imposed a model of style that contributed considerably to the “democratisation” of literature. of familiar detail. 2. 4. 3. which draws much of its force from Defoe’s peculiar narrative manner and style. In his aspiration to create an effect of reality in his narrative. If your list contains none of the features mentioned there. solid world. the accumulation of circumstantial detail create a strong sense of a palpable. Defoe is the first major fiction writer whose narrative realism conveyed such a powerful impression of authenticity and completeness in the representation of the interaction of the individual with the environment. The richness of concrete detail. the promise of symbolic meanings.
who is now convinced of the purity of her motives and of her innocence. Mr. or Virtue Rewarded Pamela is a simple countryside girl who works as a maidservant in the house of Lady B_. In Clarissa. in Bedfordshire. B’s relatives and friends. Her disarming combination of graceful modesty and pride helps her come victorious in an encounter with haughty Lady Davers. In her new state. Richardson focuses on the relation between feeling and virtue. or Virtue Rewarded (1740) and Clarissa. impressed by Pamela’s unusual beauty and grace. tries to seduce her and make her his mistress. the double victim of the libertine aristocrat who raped her and of her narrow-minded. Her diary – intended for her parents – falls into Mr. hoping that she will give in. the latter’s son. Both are written in the epistolary manner*. B_ abducts her and keeps her a prisoner for a while in his Lincolnshire house. Upon the death of her mistress. of individual freedom threatened by arbitrary power. not only in England but also on the Continent. cruel and greedy relatives. unanimously loved and admired. Richardson’s contribution to the development of the novel Richardson is the first to combine a sense of social reality with the interest in individual psychology. but also the agitation of her heart and its conflicting impulses. the tone is rather that of a comedy of manners and the ending is in the spirit of the Cinderella* tale.The Age of the Enlightenment: the rise of the novel 5. as well as for his didactic purpose. Pamela continues a diary. or the History of a Young Lady (1748). the death of the heroine turns her into a tragic figure. B_. B_’s hands. his exploration of unconscious motivation makes him a forerunner in the great tradition of the novel of psychological analysis. Samuel Richardson (1689-1761) 5. Mr. Richardson’s prominent place in the history of the English novel is ensured by two novels: Pamela. Both novels concentrate on the microcosm of the family and develop the themes of the trial of innocence. There. In Pamela. whose affection she finally gains. of the struggle between virtue and vice. Pamela has one more test to pass: winning the approval of Mr. He acknowledges his love and proposes marriage to her.2. Mr. 128 Proiectul pentru Învăţământul Rural . At the same time. B_’s sister. His focus on the inner life of feeling and emotion prefigures the Romantic* sensibility. The plot of Pamela. Pamela decides to thank Providence by doing as much good as she can to those around her. Pamela differs from Clarissa in tone and ending. Faced with her resistance. which Richardson found best suited for the realistic rendering of psychological and moral complexity.5. Back to Bedfordshire as mistress of the house. His influence was considerable.6.2. sensibility and morality. recording the details of her ordeal. As the first great sentimental novelist.
The cover engraving and title page of the 1741 edition Mr.7. He thus questions the exclusive right of aristocracy. Gravelot to the 1742 edition) Proiectul pentru Învăţământul Rural 129 . Richardson’s novel participates in the larger illuminist debate on the issue of authority and absolute power vs.2. to set moral standards to the nation. This ambiguity in her condition makes her remarkably class-conscious. but the education she received in Lady B_’s house is far above that of a servant. the rights of the individual.The Age of the Enlightenment: the rise of the novel 5. Through its subject and theme. She perceives her imprisonment by Mr. Richardson’s implicit radical message. his violation of her privacy (including the private space of her correspondence) as abusive attempts to reduce her to the condition of an object. is consistent with the spirit of individual freedom which defines the Enlightenment.” but she defends her dignity as an individual. as he embodies perfect virtue in a lower middle-class girl. a complete novelty in fiction. Richardson’s creation of Pamela is revolutionary. B_ intercepting Pamela’s first letter to her parents (Engraving by H. Pamela is brought up by her modest parents in the spirit of the strictest religious principles. Pamela’s position of moral superiority reflects Richardson’s confidence that the values of the middle class entitled them to claim moral leadership. She sees social hierarchy as “natural. F. The moral conflict in the novel is accompanied by social issues. as a traditionally dominant class. the freedoms that he takes with her. B_. that no one has the right to control the ideas and feelings of another. Social hierarchy and the individual self Pamela’s problem is not only the defense of her chastity.
Psychological realism and the epistolary technique What makes Richardson a real innovator is the credibility with which he renders the heroine’s inner conflicts. Richardson’s mastery consists in the subtlety with which he suggests the gradual surfacing of unconscious feeling and with which he traces the heroine’s slow process of self-knowledge.2. her contradictory impulses and unconscious motivations.8. what are the implications of her exclamation: “My soul is of equal importance with the soul of a princess. though in quality [i. but his moments of kindness confuse her and make her feel vulnerable. B_ When the latter acts openly as her oppressor.7. but her letters betray her growing affection for her master. Her conscience is divided between her loyalty to the moral principles inculcated by her parents and her social duty. 130 Proiectul pentru Învăţământul Rural . Compare your answer with the one provided in the section Solutions and suggestions for SAQs.6.The Age of the Enlightenment: the rise of the novel SAQ 6 Considering the heroine’s dilemma in the novel. social standing] I am but upon a foot with the meanest slave. in no more than 10 lines / 100 words. If there should be significant differences. read again attentively subchapters 5. it is easier for her to stand his abuses. as a servant. at the end of the unit. Her initial innocent regard for her master’s benevolence turns gradually into the apprehension of danger. to obey Mr.2.2. and 5.”? Answer in the space left below. between hate and admiration. Pamela struggles from the start between fright and fascination. 5.e.
and considering also Text 5. however. In Pamela’s letters and diary.The Age of the Enlightenment: the rise of the novel The character of Mr.4. The spectacular change in him is his overcoming of class prejudice under the influence of feeling.. events are recorded with the same care for detail as in Defoe’s narratives. on the one hand. What counts. Proiectul pentru Învăţământul Rural 131 . SAQ 7 Starting from Richardson’s own description of his epistolary manner (Text 5.3. at the end of the unit. She has a remarkable gift for rendering an incident vividly or delineating another character. and that human actions may have their true motivation hidden from consciousness. He found the epistolary narrative to be best suited for his sentimental focus.9.2. The exploration of the complexities of emotional response to pressing moral issues defines Richardson as a sentimental novelist. The use of the epistolary technique afforded direct access to the character’s thoughts and feelings. excerpted from Pamela. her sentimental response to them. which are captured in the process of their emergence. is the impact of these incidents and encounters on her mind and heart. as well as the indicated fragments in the Reader. find two main advantages of the epistolary technique. read again subchapter 5. He proves as unaware of his feelings as Pamela is. Your answers should not exceed 4 lines / 40 words each. in the Reader). 1. on the other. What Richardson manages to convey most convincingly is the psychological truth that feeling and emotion may sometimes run counter to our rational will. If they should correspond to none of the offered suggestions. B_ follows a similar evolution. There is a struggle in him between the “pride of birth” and “pride of fortune”. Compare your answers with the ones given in the section Solutions and suggestions for SAQs.. 2. and his developing love.
The result was the first comic novel of manners in England. and the long central section of the novel – its picaresque part – describes Joseph’s adventures on the road. controlling the narrative and imposing his own values explicitly. Cervantes. burlesque and comic satire. He is also the first novelist who displayed a remarkable sense of form. required a narrator who should be no longer a character. to his native village. Parodic accents are revived: Pamela is not Richardson’s humble.The Age of the Enlightenment: the rise of the novel 5. Fielding abandons parody.1. His works are panoramic reflections of the age. in London. Mr. Fielding uses the technique of reversal as a parodic device. The multitude of incidents during their journey acquaints the reader with the most diverse aspects of English countryside life and with an impressive variety of human types. and. The careful narrative architecture of his novels.” Mr. Treating seriously of male virtue results in comic effect. Fielding considered the Puritan morality preached by Rhichardson’s Pamela as narrow and ungenerous. which is doubled by the fact that Joseph is pursued not only by the mistress. Joseph Andrews is presented as Pamela’s brother. above all. modest and gentle creature. emulating his sister in the exemplarity of his virtue. His acknowledged literary models were Swift. 1790) 132 . but a snobbish. At this point. they mirror a wide range of human types. Slipslop. performed by means of comic satiric devices. More unexpected Proiectul pentru Învăţământul Rural Lady Booby and Joseph Andrews (engraving by James Heath. and he thought to propose his own version of morality. Henry Fielding and the novel of manners Fielding is the creator of the novels of manners. B_’s aunt. including Pamela and her husband. Joseph’s sweetheart. He is the object of seduction of “Lady Booby*. priggish* upstart. but a voice external to the story. started as a parody. A somber discovery marks the climax of confusion: it appears that Joseph and Fanny are brother and sister. All important characters meet here. Abraham Adams. Through the omniscient* narrator. Pope.3. Booby. Mr. the author asserts himself. Omniscient narration afforded a comic vision of life. Henry Fielding (1707-1754) 5. irony. Lady Booby’s estate in Somersetshire is the scene for the novel’s last series of adventures. relationships and actions. whose servant he was. The hero’s companions are Parson Abraham Adams and Fanny Goodwill. Mrs. His rejection of both leads to his dismissal. but also by the maid. “written in imitation of the manner of Cervantes*. author of Don Quixote” (1742). as well as their inclusiveness. Fielding was a master of parody. who opposes her brother’s marriage to a simple country-girl. Comedy and parody in Joseph Andrews The History of the Adventures of Joseph Andrews and of His Friend. and the first comprehensive literary picture of the manners and mentalities of the age. so that he sets out for home. Fielding’s combination of realism and comedy inaugurated a lasting tradition of realistic fiction as an instrument of criticism of manners.3.
in the spirit of comedy. for true or false) for each of them.3. T F 8. Mr.The Age of the Enlightenment: the rise of the novel disclosures bring about the final clarification and the great reversal of the plot: Joseph turns out to be the son of a gentleman. indeed “in imitation of the manner of Cervantes. like the motif of love fulfilled against all obstacles. Affectation arising from vanity presupposes the concealment of vice under an appearance of virtue. while Fanny and Pamela are revealed to be sisters. Fielding likes to play with genres. Circle the appropriate letter (T or F. Natural imperfections are a source of the Ridiculous for the comic writer. SAQ 8 In the Preface to Joseph Andrews. T F 4. carefully. Both comedy and comic romance introduce characters of low social rank and inferior manners. Proiectul pentru Învăţământul Rural 133 . whom they had met during their journey. Affectation arising from hypocrisy is more efficiently comic. Cervantes. The burlesque in writing and the caricatura in painting presuppose distortion and exaggeration. T F 6. is an ingredient of romantic plots. but rooting his action in contemporaneity and the ordinary. T F 7. 1. The action of a comic romance is more extended and comprehensive than that of a comedy. T F 3. For instance. to be both serious and ironic about their conventions. Wilson. Fielding gives his definition of a comic romance and discusses the nature and the source of the comic (“the Ridiculous”). read the text once more. 5. which closes the plot. which turns out to be gentle*.5. Fielding exploits such motifs in a comic or burlesque key. T F Compare your answer with the one provided in the section Solutions and suggestions for SAQs. at the end of the unit. or the pattern of the adventurous journey. This removes all obstacles in the way of Joseph and Fanny’s marriage. The comic writer gives pleasure by strictly imitating nature. alluding thus to the older genre. Read Text 5.” Fielding himself speaks of his work as a comic romance.2. Fielding resorts to the burlesque both in the creation of his characters and in diction. T F 2. If you should fail to identify the sentences correctly as true or false. T F 5. very carefully and identify which of the statements below are true and which are false. The novel as comic romance Like his invoked literary master. the spectacular reversal of Joseph’s status.
in spite of the many instances of greed. Along the novel. often making him appear ridiculous. his virtues always outshine his occasional foolishness. but also moral instruction. but a species” (Joseph Andrews). but they placed their main interest in the individual. Virtue and vice are not the “privilege” of a certain class or profession. Proiectul pentru Învăţământul Rural Character as type The principle of contrast in characterisation 134 .3.4.3. Fielding’s fiction displays an immense gallery of characters.3. one of the most successfully accomplished quixotic* characters. doctors. the essence of Christian morality is not prudence. Fielding offers aesthetic delight. Fielding makes a synthesis between the comic and the morally serious. The presence of Parson Adams is essential for the evolution of the main character. In other words. etc. The character of Parson Adams The influence of Cervantes is clear in Fielding’s delineation of Parson* Adams. Like his literary ancestor. For the author. Parson Adams’s character remains the moral center of the novel. but good deeds and charity. both loyal and treacherous servants or friends. Defoe and Richardson were also concerned with the relation individual-society. Parson Adams as a quixotic character 5. but manners. fulfilling thus the novel’s double aim of entertaining and instructing. In order to make the extraordinary variety of human types easier to deal with. not an individual. there are both good and bad innkeepers. which often create comic effects. At the same time. because “beauty and excellence” are always best demonstrated by their reverse. Fielding resorts to the principle of contrast in characterisation. as for Richardson. quickly assimilating his mentor’s lesson and convinced that true Christianity means. as he himself says. He represents what Fielding considers the highest Christian value: goodness. His fund of Christian idealism is inexhaustible. cruelty. active goodness. In the beginning. which must give substance to faith. both honest and hypocrite priests. above all. In the combination of foolishness and idealism that characterises the parson. in various nuances of behaviour and in its moral diversity. lawyers. he describes “not men. By means of techniques of contrast. Joseph appears to follow his sister in his restriction of virtue to the question of chastity. profession and temperament is represented in his novels. Every social class. Fielding involves him in a multitude of comic situations. etc. Joseph emerges as morally mature. and the reader is invited to judge all the other characters against the moral standard that he embodies. and he never seems to learn from disappointing experiences. Adams’s unsuspecting nature often gets him in trouble. the parson combines innocence and simplicity with dignity and learning. Fielding’s conception of character in Joseph Andrews The way in which Fielding conceives his characters in his novels is of great importance for his didactic purpose. Fielding’s panoramic approach led him to find uniform patterns in human behaviour. in Fielding. hypocrisy and intolerance he is confronted with. masters.The Age of the Enlightenment: the rise of the novel 5.
At the same time. 5. Such reflections show his Neoclassic emphasis on discipline and craftsmanship as essential for successful creation. incorporated in the substance of his works. Proiectul pentru Învăţământul Rural 135 . and he believes.4. like many Augustan writers.3.2.3. 5. and he tried to give full legitimacy to the novel.. through its moral and temperamental types. Fielding is the most “Augustan.. Compare your answer with the one given in the section Solutions and suggestions for SAQs. Explain them. His commentaries and reflections on his own art. and 5. read again subchapters 5. 5. 1. 2. He had a solid classical education and a strong sense of literary tradition. in the superior corrective efficiency of comedy and its devices. of no more than 3 lines / 30 words each. combining elegant seriousness with wit and irony.” His exploration of the diversity of Human Nature..2.5. 3. preoccupied with the reformation of manners. at the end of the unit. drawing short comparisons. If they should differ substantially. Fielding’s Augustanism* Of all 18th century novelists. SAQ 9 Mention at least three features of Fielding’s art of the novel which distinguish him from Defoe and Richardson. His narrative style is eminently Augustan: articulate and refined. provide the first theory of the novel. of evoking his characters’ social position and moral nature through their language.2..4. He is a moralist.The Age of the Enlightenment: the rise of the novel 5.8.3. defining it in relation with the respectable genres of the epic and drama. unaffected. he had the exceptional gift of individualizing his characters through speech. reveals his Augustan view of the writer’s province.
instead of a linear narration of a life's story and the rational coherence of an autobiographical retrospective account. which progressed at a slower pace than the growth of his son. However. who has read “the oddest books in the universe” and consequently has “the oddest way of thinking. as well as of Parson Yorick. In spite of his promises.4. pedantic discourses are completely incomprehensible to those around him. corporal Trim. that. 136 Proiectul pentru Învăţământul Rural . With Sterne. We learn few things about his life: that his nose was crushed at birth by the doctor’s forceps.4. the testing of the possibilities and limits of fiction took the novel into a radical direction.” in every sense. Tristram Shandy: an unconventional autobiographical novel The title of the novel raises in the reader the expectation of an autobiographical narrative. Walter Shandy. he seems to have. other interesting things to relate. This makes his novel a work of metafiction*. The ultimate question that Sterne raises in his novel is the nature of fictional representation. Laurence Sterne and the “anti-novel” Sterne’s only novel was published in instalments: its nine volumes appeared between 1760 and 1768. Walter.2. unpredictable narrative. is an erudite philosopher. Fielding had demonstrated. the history of a private life.4. moulds reality into a literary pattern. Much more of the narrative is dedicated to the unforgettable figures of his father. 5.The Age of the Enlightenment: the rise of the novel 5. the relation between life and literature. the priest who baptised Tristram.” He is fond of building strange theories and hypotheses about the smallest things. i. a sceptical examination of the conventions of realistic fiction. that he was.1. which isolates each of them in his mental universe. we are drawn into an extremely irregular. He digresses continually. His Tristram Shandy has been seen as an anti-novel. the narrator. that his father decided to write a “system of education” (Tristrapaedia). christened Tristram (a name which evokes the French word “triste”) instead of Trismegistus* as his father had intended. and his long. at the age of five. Toby and the latter’s devoted servant.” individuals dominated by some private obsession. These few tragi-comic episodes from Tristram’s early life make him a “small HERO. of those procedures by which an author “transcribes“ life.” when a window sash fell over him owing to the maid’s carelessness. that parody was a factor of innovation in the development of the novel as a literary genre. that his brother Bobby died suddenly. His father. at every point. Tristram suffered a new misfortune: an accidental “circumcision. He tells us about his birth only in Volume III. by accident.e. in Joseph Andrews. Eccentric characters in Tristram Shandy Tristram’s family is a collection of “originals. Tristram. does not manage to give a shape to his story. Laurence Sterne (1713-1768) 5. of his uncle.
Shandean* book” that Tristram is trying to write is meant to do good to the reader’s both heart and head. character and destiny. On the other hand. ironic terms. the members of the Shandy family reach mutual understanding on the affective level.The Age of the Enlightenment: the rise of the novel Among his most eccentric theories. gathering “almost as many books on military frontispiece to vol. and discharged from the army. pitiful creature. Sentimentalism and tragi-comic vision The characters’ obsessions and idiosyncrasies are an intellectual barrier in their communication. a quixotic figure forming an eccentric couple with corporal Trim. 5. where compassion and empathy bridge the gap created by their singularity. modesty and. which influences all his thoughts and actions. There are many eccentric characters in 18th century fiction. representing there the main battles as they William Hogarth. the early accidents in his son’s life cause him great distress. The “nonsensical. and it is either dealt with sentimentally or revealed in its comic absurdity. amiability. Tristram Shandy displays a unique combination of sentimentalism and comedy. to 137 The Shandean view of life Proiectul pentru Învăţământul Rural . uniqueness is achieved in extreme. He transforms his bowling green into a miniature military field.” Toby Shandy is Sterne’s best accomplished sentimental character – the narrator continually praises his uncle’s good nature. They cannot share their thoughts. which were expected to influence a man’s conduct. therefore. during the War of the Spanish Succession*. there are his “system of noses” – his conviction that the quality of a person’s nose determines his character – and the hypothesis concerning Christian names. to preserve good humour in the middle of trouble. Characterisation by hobby-horse is a negation of conventional means of realistic character delineation. Sterne places emphasis on the sentimental nature of his heroes as an aspect of their “moral character. with man as a vulnerable. but they can enter a dialogue of the hearts. were being fought on the continent. as comic eccentricity. Suffering is a permanence in Tristram’s world. Wounded in Flanders. Tristram calls such obsessions hobby-horses.” defined as the capacity to mock at the blows of fate. generosity. which becomes almost a parody of human individuality. Its approach to the frustrations of life is called by Tristram “true Shandeism. However. above all. He becomes completely Tristram Shandy. but the uniqueness of each individual mind.1 architecture as Don Quixote was found to have of chivalry. gentleness. Understandably. It is not type (social. but in Sterne’s novel all characters are eccentrics. The narrator sees laughter as the ultimate defense of the sensitive soul against life’s miseries and limitations. absorbed in this activity. doomed to pass from sorrow to sorrow. “My uncle Toby” is the most memorable character in the book.” forgetting (1760) everything in pursuit of his obsession. good-humoured. moral or psychological) that interests Sterne. and this is made obvious in their endless conversations recorded in the novel. His narrative emphasises a tragi-comic vision of life.3.4. uncle Toby continues to live the reality of war through a substitute.
Compare your answer with the one offered in the section Solutions and suggestions for SAQs.3. which enables man to keep a healthy spirit and to get around the evils of life by joking about them. Sterne introduces the theme of Fortune – a theme which he will develop with a characteristic mixture of sentimental pathos and comic wit.6. SAQ 10 In Vol. in the Reader) attentively and explain why Tristram’s selfdescription as a “small HERO” suggests a tragi-comic vision of life. at the end of the unit. To remember the features of the tragic hero. read again subchapter 5. I. Ch.The Age of the Enlightenment: the rise of the novel take a lightly ironic distance from suffering. V. Write the answer in the space left below. in the Glossary to Unit 2. restricting it to 12 lines / 120 words..4. If the difference is considerable. Read this short chapter (Text 5. 138 Proiectul pentru Învăţământul Rural . It is a combination of wisdom and mirth*. see again the fall of princes. as well as the fragment from the Reader.
It is. Sterne’s rambling narrative. but also as an author.4. watched as if by a slow motion camera.” Not only as a man. The defamiliarisation of realistic conventions By taking extreme freedoms with narrative and compositional conventions. there are numberless digressions and interpolated stories.” The confused chronology and the digressive excesses frustrate also our expectation of a plot. by exploiting them in a parodic way. The “Shandean” view of writing This ambivalent view of life corresponds. in Sterne’s novel. Tristram has the consciousness of his tragi-comic predicament.4. even a black sheet introduced at the death of Yorick. The narrator explicitly refuses to keep the story straight. The zigzagging narrative. Tristram is earnestly trying to tell the story of his life and his opinions as accurately as possible. does not seem to move towards any climax. The structure of the book is equally odd. which he calls “the sunshine of reading. there are several dedications scattered through the book. Typographically. coherent plots. the book is a comic oddity. but also to how it is told. so different from Fielding’s tight. only in the middle of Volume III that we find the author’s Preface.e. For example. the restriction of the hero’s “life” to a few episodes breaks the convention of autobiographical focus. with its multitude of dashes. the “imperfections of words. This impression is increased by Tristram’s effort to be exhaustive in his presentation. marking a moment of affectionate recollection. The difficulty he experiences as a writer is due to the limits of language. He thus exaggerates parodically the realistic pursuit of accuracy and immediacy. and to involve the reader both imaginatively and sentimentally. drawings and graphs. Sterne defamiliarises them. Tristram constantly oscillates between the comic despair at his incapacity to master his narrative and the delight he takes in complete narrative freedom. to a certain view of writing. He delights in minute descriptions of postures and small gestures. by drawing his attention not only to what is told. and gives the impression of stagnation. frustrates our expectation of chronological linearity commonly associated with an autobiographical account. Faced with the problems of accurate representation through words. with its blank pages for the reader to fill in. its unpredictable returns to various moments in the past. makes the reader aware of them.The Age of the Enlightenment: the rise of the novel 5. i. Digressive narrative Proiectul pentru Învăţământul Rural 139 . for instance.4. etc. asterisks. and he takes great delight in digressions. points of suspension. 5. The same “Shandean” view applies to writing: Tristram counteracts the frustrations of the author who aims at perfect communication by putting on the mask of the literary jester* and mocking at the conventions of the genre.5. Tristram resorts to other means of communication.
i.4. The unpredictable. i. which is connected. The meaning of metafiction depends. as it explores – halfseriously.e. makes Tristram Shandy a work of metafiction. they may be related to themes the problem of fictional representation and its limits. Sterne’s literary treatment of the notion of duration makes him a precursor of 20th century modernist writers like James Joyce and Virginia Woolf. The main subject of Sterne’s novel is. Tristram draws the narrative “lines. 140 Proiectul pentru Învăţământul Rural . at the structural level. random course of the narrative has a correspondent in the theme of Fortune. In volume VI. Tristram Shandy as metafiction The constant reference to the devices and conventions operating in fiction. ultimately. on the possibilities of fiction to render in an intelligible pattern the elusive. metafiction is fiction about fiction. Tristram constantly draws attention to the way in which he manipulates fictional time. Another prominent theme with a metafictional relevance is that The theme of time of time and its relation with the imagination. in the first four volumes. formless reality. into the “laboratory” of his literary consciousness. the theme of time corresponds to the narrator’s concern with the distinction between the time of writing. also concerned with the way in which consciousness refracts external reality.The Age of the Enlightenment: the rise of the novel 5. of life as pure chance. One such theme in Tristram Shandy is that of human communication – or rather incommunication –. halfsceptical meditation on the condition of literature and its relation with reality. half-comically – the distinction between subjective and objective time. The randomness of the narrative is a mirror of the narrator’s sense of his own life as tragi-comically governed by accident. works which call attention to their own devices. experimental character affords the reader a glimpse into the novelist’s dilemmas and arsenal of choices.6. on the author’s vision of life. Sterne’s particular approach to narrative correponds to a certain vision of human experience. There are themes in Sterne’s Metafictional novel which may be called “metafictional”. with the narrator’s desperate effort to be allinclusive and his incapacity of managing his narrative.” with their digressions. the process of its own writing. Tristram Shandy may be called the first philosophical novel in English. making the reader aware that “literary time” is arbitrary and conventional. however. It is a half-amused. Tristram Shandy questions the mimetic illusion that realistic fiction endeavours to create. Basically. the narrated time and the time of reading. the permanent inquiry into what a novel can do and cannot do.e. As metafiction. Metafictionally. Its extravagant.
In this way. Instead of continuing the story.5.The Age of the Enlightenment: the rise of the novel SAQ 11 Text 5.4.. The fragment is practically about the writing of the novel. 3. the narrator stops and considers his eccentric way of telling it. Write them in the spaces indicated below. If they differ significantly. and read the fragment attentively once more. at the end of the unit.6. Henry William Bunbury: Uncle Toby and Trim reviving a scene of war on the bowling green (1773) Proiectul pentru Învăţământul Rural 141 .7. using no more than 3 lines / 30 words for each of them. the author reveals to the reader one aspect of his conception of writing. which he discusses in the very text of the work.4. and 5. in the Reader illustrates the metafictional dimension of Sterne’s novel. 2. 1. Read the text and find three reasons for Tristram’s praise of digressions. go again through subchapters 5. Compare your answers with those provided in the section Solutions and suggestions for SAQs.
self-conscious novel that makes him highly modern. Key words • • • • • • • • • • • realism romance character to divert and instruct parody comic novel of manners sentimental novel narrative technique metafiction convention 142 Proiectul pentru Învăţământul Rural . Since its settlement on the literary scene. who shares with Fielding the attraction to comedy and parody. Richardson takes the novel in the direction of the minute analysis of emotion and feeling. in a work so committed to the matterof-fact. The absence of norms and models made it an exceptionally flexible and inclusive form. to the palpable reality of common objects and actions.The Age of the Enlightenment: the rise of the novel Summary The birth of the novel is a literary phenomenon that must be seen as part of the process of modernisation defining the Age of the Enlightenment in England. and Laurence Sterne. Lastly. You have formed an idea of this diversity from the chapters of this unit. and with Robinson Crusoe the middle class hero is imposed on the literary scene. Their works illustrate various aspects and tendencies in the evolution of the genre. readers along the ages have been able to find a wealth of symbolic meanings and a story of archetypal significance. this genre has enjoyed unrivalled popularity. Defoe illustrates best the new narrative realism that emerged in fiction. looks for the permanences in human nature and investigates the border area in which the individual’s aspirations and pursuits are submitted to the pressure of social demand. We have only concentrated on one novel for each writer. At the beginning of the 18th century. in his novels of manners. but his interest in the psychological complexity of the individual is completed by a remarkable sensitivity to social aspects. on the other hand. the novel was a minor form. However. Sterne. tests the possibilities and limitations of the newly-born literary genre in an experimental. which has dealt with four major novelists of this age: Daniel Defoe. Henry Fielding. completely ignored by Augustan poetics. selected as an illustration of the most characteristic features of his art. Samuel Richardson. Fielding. This is reflected in the wide diversity of directions in which the novel developed in the 18th century.
minuteness: exactness in the rendering of small detail. mirth: laughter. played like a piano. booby: silly or stupid person. harpsichord: an old musical instrument. see again the Glossary in Unit 1). exact representation of life. fixed idea. omniscient: describes the perspective of a narrator who appears to know all about the characters and their action. gentle: of good breeding. picaresque: the origin of English picaresque novels is in the Spanish picaresque fiction of the 16th century. which dominated Western aesthetics until the end of the 18th century. rogue) – belongs. in which its form becomes explicitly its subject. attitude and subject are deliberately distorted so as to make them appear ridiculous. but producing a different sound. Cinderella is the prototype of the obscure and neglected young person. whose style. jester: a professional clown employed by a king or nobleman. which became popular in England through translation and imitation.e. “beyond fiction”. parson: an Anglican priest in charge of a local church. burlesque: see the Glossary in Unit 1. tone.e. felix culpa: see subchapter 3. fun. happiness. or education.The Age of the Enlightenment: the rise of the novel Glossary • • • • • • • • • • • • • • • • • • • • • Augustanism: the features of style and the aesthetic views of a writer belonging to the Augustan Age (for the latter. a term designating the contemporary mode of fiction – postmodern fiction – which is essentially self-reflexive. lifelikeness: closeness to life. The hero – the picaro (i. the way of telling the story through a character’s letters or through an exchange of letters. a term associated with the aesthetic view according to which the work of art is an imitation – a representation – of reality. to the lower ranks of society. characteristically. The letter (epistle) as a literary species was widely used in the 18th century. literally: novel of formation. a hobbyhorse is a toy. in which the poor heroine. hobby horse: a favourite topic or an obsessive. ends up by marrying Prince Charming. or “narcissistic” – i. mimetic: the adjective derived from mimesis (Greek: imitation). Cinderella: an old fairy story. persecuted by her stepmother and ugly stepsisters. epistolary manner: in a novel. parody: the satirical imitation of a serious work. It was Aristotle who articulated this theory.3 and the Glossary in Unit 3. metafiction: literally. literacy: the ability to read and write. Concretely. a Fool. He is forced to 143 Proiectul pentru Învăţământul Rural . and he seeks social integration. Bildungsroman: German term. consisting of a stick with a figure of a horse’s head at one end. belonging to a high social class (as in gentleman). who achieves success owing to beauty and virtue. gaiety.
The high aspirations of this generous. having often to go through the experience of humiliation and frustration. priggish: describes a person who is strict about rules and correct behaviour and thinks him/herself morally superior to others. squire) appear as madness in a world whose reality is obscured to him by the idealism of the old romances. Shandean: the adjective that Tristram derives from his family name. on a quest that is both admirable and ridiculous. like a knight-errant of former times. honest and brave hidalgo (i. War of the Spanish Succession: 1702-1713.e. the famous satirical romance in which the hero’s sense of reality is altered by his obsession with the romantic chivalric ideal.The Age of the Enlightenment: the rise of the novel • • • • • • find his way in a hostile world by means of his resourcefulness and ingenuity. Don Quixote starts. which stands in an ironic contrast with the successive triumphs of the noble hero of romance). author of Don Quixote de la Mancha (1605. quixotic: the word describes a character moulded after Cervantes’s Don Quixote. “quixotic” indicates an unrealistically optimistic and impractically idealistic approach to life. Gallery of personalities • Cervantes (Miguel de Cervantes Saavedra): Spanish writer (1547-1616). Britain joined Austria. Stimulated by the numberless stories of romantic heroism that he has read. 1615). Trismegistus: Hermes Trismegistos (thrice-greatest) is the Greek name given to the Egyptian god Thoth as supposed author of various works of mysticism and magic. Don Quixote is an implicit debate on the relation between fiction and reality. • 144 Proiectul pentru Învăţământul Rural . Spain and Bavaria in this war fought over the disputed succession to the Spanish throne. Romantic: see Romanticism in the Glossary in Unit 1. Prussia and the Netherlands against France. Puritan: see the Glossary in Unit 1.
Horrified. to revise the preceding unit. which presents Swift as a master of allegorical satire. Mention at least four aspects in support of this idea. and to the illustration of those values and attitudes in a particular novel. clarity.. SAA no. and 5. your tutor will take into account: • the closeness of your answer to the formulated requirement (30%). 2 will count as 20% in your final assessment.4. 3. You might find it helpful to revise subchapters 5. You will have.1. 1. in the context of the novel’s pattern of Puritan autobiography? Your answer should be no longer than 10 lines /100 words. in the Reader presents an incident at the court of Brobdingnag. Read the fragment carefully and analyse: • the ironic-satirical treatment of Gulliver himself. • the coherence. Limit your answer to 25 lines / 250 words. in the Reader represents a fragment from Robinson Crusoe in which the motif of the island is particularly prominent. The weight of this task in the assessment of this SAA is 20%. who had just pronounced a severe judgement on his civilisation. Text 4. Text 5.2. • the features that make the kingdom of Brobdingnag a utopia of reasonable government. in grading your paper.1.4. 2 This assignment includes tasks concerning both Unit 4 and Unit 5. In order to win the good graces of the king. with special attention to subchapter 4. the king rejects this tribute. as well as the presentation of the novel you choose to discuss. and its contrast with European civilisation as Gulliver presents it. The weight of this task in the assessment of this SAA is 30%.1. revealing candidly to him the “benefits” of this invention. 2. as illustrated by this fragment. Gulliver offers him the secret of the recipe for gunpowder. The weight of this task in the assessment of this SAA is 50%. Remember that. Limit your answer to 35 lines/350 words. and consistence of your ideas (40%) • the accuracy of your grammar (20%) • the accuracy of your spelling (10%) Proiectul pentru Învăţământul Rural 145 . You may refer both to the general circumstances of the novel’s emergence and its concerns. therefore. Pay special attention to the instructions for each task. The novel as a literary genre both reflects and helps consolidate values and attitudes which define the Age of the Enlightenment.. and Gulliver’s new humiliation will make him partial in the subsequent description of the king’s rule.The Age of the Enlightenment: the rise of the novel Send-away assignment no. What is the double symbolic significance of Robinson’s island. in Book II of Gulliver’s Travels.
… novels focused on the ordinary and the familiar aspects of life. resilience. The rise of the middle classes … coincides with the emergence of the novel as a literary genre. SAQ 3 Defoe’s own phrase refers to the purpose of his novels: to entertain and to instruct. SAQ 5 factuality. Women were … a consistent part of the novel’s reading public. she may be deprived of the privilege of class and fortune. concreteness. but this is a way of accomplishing more efficiently his honest intention of conveying a moral message. on contemporary social reality and on the experience of the common individual. 3. inventiveness.The Age of the Enlightenment: the rise of the novel Solutions and suggestions for SAQs SAQ 1 1. but she denies any human being the right to control her moral 146 Proiectul pentru Învăţământul Rural the novel of adventure the sentimental novel the picaresque novel the Bildungsroman the novel of manners the comic novel . 2. all souls are equal. industriousness. By contrast with the escapist spirit of romances. which is given an air of authenticity by the meticulous. 3. She will accept humbly her social inferiority. 4. minuteness SAQ 6 Pamela’s assertion points to her conviction that the right to defend the moral integrity of one’s self is independent of social status. immediacy. sharp sense of observation. 2. In the social order. vividness. 5. patience. pragmatism. He delights the reader with an extraordinary adventure and a story of success. rationality. 5. and also authors of novels. realistic account. The didactic mission of the novel in the 18th century consisted in … offering the middle class readers models of moral and ethical conduct and of social success. but she lives with the deep conviction that in the spiritual order of a Christian world. He thus “cheats” the reader with the illusion of truth. SAQ 4 Tenacity. The novel’s interest in the tensions between the public and the private reflected … the attempt to reconcile the growing spirit of individualism with the aspiration to social harmony. optimism. 4. plainness. the capacity for learning from mistakes. 6. and by the form of autobiographical record. SAQ 2 1.
2. The reader is made witness to the most private thoughts of the character.T.T. you should think first of the features of a tragic hero. since the letters usually record moments of crisis in the character’s experience. In this way. wealth and power. This is not Tristram’s case. His style: while the style of Defoe and Richardson is closer to the plainness of common speech. 3F. which makes her sensitive to any form of power abuse. Fielding finds the omniscient point of view more suitable to his intentions. as well as a paradoxical combination of social conformity and rebelliousness. 5. 2.T. living and the act of writing overlap each other. Digressions keep the reader’s curiosity awake.T. SAQ 11 1. He is always a prominent figure. SAQ 7 1. It allows a more profound insight into the character’s mind.The Age of the Enlightenment: the rise of the novel will. It creates a greater sense of suspense and anticipation. The conception of character: he is interested not in the uniqueness of individuals. 3. they create a sort of suspense. Her statement reflects the strength of her sense of individual worth. 6. and this impression of unmediaded communication strengthens his belief in the character’s sincerity. SAQ 10 In formulating your answer. Fielding displays the elegance and refinement of the Augustan ideal of style. 4. 3. enjoying title. 7. The narrative manner: unlike Defoe and Richardson. he is concerned with human types. 2. He is a “small HERO” because the misfortunes of his life do not consist in some “great or signal evil. SAQ 8 1. his gifts and virtues set him above common people. 2.T. This technique may thus give a dramatic quality to the narrative. but in the way in which the individual embodies general traits of human nature. 3.” but in “pitiful misadventures. It prevents the writing from ending – it allows the writer to go on indefinitely.” The image of the “ungracious Duchess” – Fortune – pelting him with a series of “cross [i.F.e unfavourable] accidents” is in comic contrast with the ideas of tragic disaster and the fall of the great. who write in the first person. it enables the author to give greater psychological complexity to the characters. 8.F SAQ 9 1. Proiectul pentru Învăţământul Rural 147 . forbidding the reading “appetite” to fail and bringing in variety. The use of digressions is meant to show Tristram’s narrative skill and constitutes a mark of his originality. that is.
A Critical History of English Literature. 37-42. vol. Daiches. The English Eighteenth Century: The Novel in Its Beginnings. Penguin Books Limited. The English Novel. 179-195. 76-80) 2. Allen. Macsiniuc. 116127. Editura Universităţii Suceava. Walter.3 (“The Restoration to 1800”). 234-238) 148 Proiectul pentru Învăţământul Rural . 143-163. 701-704. 217-231. 43-46. 731-736) 3. 2003 (pp.The Age of the Enlightenment: the rise of the novel Further reading 1. 1969 (pp. 53-59. Cornelia. London: Secker and Warburg Ltd. 1991 (pp. David. 712-718. 598-602.
2.1.4. 6. The Task William Blake – the visionary artist Blake as a pre-Romantic poet Blake.3.5.3.1.English pre-Romantic poetry UNIT 6 ENGLISH PRE-ROMANTIC POETRY Unit Outline 6 6. 6.1.2.1. 6. 6.3.4.4. 6. 6. the Romantic visionary The theme of childhood in Songs of Innocence Ironic implications in Songs of Innocence The fall from Innocence: Songs of Experience Knowledge in the world of Experience The double vision in Blake’s Songs Summary Key words Glossary Gallery of personalities SAA No. 6. 6.2.2.1. 6. 6.2. 6.4. Unit objectives English pre-Romantic poetry. 6. 6. 6. 6.4. 6.6.3.2. 6.4.4. 3 Solutions and suggestions for SAQs Further reading 150 150 150 151 151 153 153 154 154 155 156 158 158 159 161 161 162 163 166 166 167 168 170 171 171 173 173 174 176 Proiectul pentru Învăţământul Rural 149 .4.3.1. 6.4. The Seasons William Cowper.2.2.4.3.1.1.7.2.
Neoclassicism*. as well as the preoccupation of 18th century analytic thought with the workings of the human mind. Literature was called to deal with matters of public interest. Pre-Romantic tendencies in 18th century poetry The eighteenth century. was eminently the Age of Reason. Addison. Pope. and Fielding). and the sensibility that it cultivated favoured the rise of the Gothic novel. The sentimental novel* (e. discipline. to bring the significant aspects of human life and behaviour into the light of public attention. From the Age of Reason to the Age of Feeling 150 Proiectul pentru Învăţământul Rural . One trend in the 18th century poetry of meditation was the preference for the expression of melancholy and dark thoughts. The concern with personal. which became the vehicle for the expression of private feeling and assumed a personal voice. however. and for night as a setting. harmony. For instance. The optimism and pragmatism of a rational age which believed in progress were reflected in literature as well. as is proved by the works of the great Augustan writers (Steele. The interest in individual psychology. and cultivated its public relevance. the century of the Enlightenment was not without paradoxes and contradictions.g. Swift. regarded art as the product of civilisation. subjective experience is displayed not only in fiction. Like any modern age. led to an increasing attention to emotional response. elegance and decorum*. the century of the Enlightenment*.English pre-Romantic poetry By the end of this unit you should be able to: ♦ explain the shift in literary taste that occurred in the latter half of the 18th century ♦ define the main interests and tendencies in pre-Romantic poetry ♦ point out elements of continuity and discontinuity between pre-Romantic poetry and Augustan literature ♦ compare the representation of the rural universe in the works of 18th century poets ♦ describe the pre-Romantic approach to the theme of nature ♦ specify pre-Romantic and Romantic features of William Blake’s work ♦ analyse Blake’s notions of Innocence and Experience in the context of particular poems ♦ describe the contrasting visions in poems by Blake Unit objectives 6. the cult of Reason favoured an attitude of humanitarianism and social benevolence. Samuel Richardson) is one manifestation of this tendency. but also in a new kind of meditative poetry. whose literary-artistic expression was the Neoclassical doctrine.1. This new poetic trend ran counter to the optimistic confidence of the Age of Reason. which in turn favoured the emergence of the cult of Feeling. with its emphasis on order.
wild. but its subject and mood are preRomantic. Edward Young (1683-1765) 6. He also claimed that their author was the (painted by Nicolai Abildgaard. The poetry of melancholy meditation Edward Young is one of the most important representatives of this new kind of reflective poetry. The perfect form of Gray’s poem shows his classical training. Its gloomy setting – the churchyard. and misty. with tombstones lit by the pale moon – contributed to the birth of the taste for Gothic. In 1765. The most spectacular manifestation of this interest is the volume Poems of Ossian. is the most outstanding expression of this new spirit in poetry. and the dominant tone is that of nostalgia and regret. imitating partly the cadence of biblical verses and of Milton’s blank verse.1. supposed to have lived in the 3rd century A.1. Macpherson claimed to have translated these poems from “the Gaelic or Erse* language. known as the Graveyard School of poetry.2. The interest in early poetry Another tendency which announced a change in literary sensibility was a new sense of the past.1. Reliques of Ancient English Poetry. but its influence on the birth of Romanticism* in England and on the Continent was huge. Proiectul pentru Învăţământul Rural 151 . It is in this tradition that one of the most popular poems in English must be placed: Elegy written in a Country Churchyard. Young and other poets formed a distinct trend in the mideighteenth century. and it exerted an immense influence both in England and on the Continent. It begins with the contemplation of the landscape. death and immortality.” and to have collected them in the Ossian Highlands of Scotland*. Thomas Percy published a collection of mediaeval ballads. which contrasts with the Augustan focus on contemporary civilisation. Macpherson’s “Ossianic poems” are pieces of highly rhetorical poetic prose. legendary Irish bard and hero Ossian. and folk literature in general. whose basic motifs were the shortness and sorrows of life and the inexorable passage of time. which leads the poet to a sad meditation on “the short and simple annals* of the poor” – the joys and sorrows of the country-folk. It consisted in long blank verse* meditations on such things as earthly vanity. Celtic* and Norse* legend and mythology. published in 1765 by James Macpherson (17361796). His long poem in nine books. The fascination with the Middle Ages is another feature which illustrated the rise of the Romantic sensibility. Night Thoughts (1742-1745). The lamentations of the blind bard evoke an ancient world of heroic virtue.English pre-Romantic poetry 6. 1782) What Macpherson presented as a great primitive Celtic epic turned out to be entirely his own imaginary creation. by Thomas Gray (1716-1771). which awakened a steady interest in older poetic styles. This new interest was reflected in the curiosity about “primitive* poetry” – biblical poetry. whose life had passed in complete anonymity. sublime landscapes.D.
b. … as well as Gothic fiction. with its gloomy atmosphere. d. … 3. published a volume of poems presented as belonging to the mediaeval poet-monk Thomas Rowley. in 1765. 1. regarding him as a martyr. … Chatterton is also the author of a literary “fraud. who claimed to have translated an ancient Celtic epic poem by the legendary Ossian. The completed sentences will describe aspects of the emergence of a pre-Romantic current in 18th century poetry. Check your answers by looking in the section Solutions and suggestions for SAQs. aspiring to poetic fame. If you have failed to make the right match for every sentence. read again the previous subchapters. 152 Proiectul pentru Învăţământul Rural . at the end of the unit. … the pre-Romantic interest in the Middle Ages and popular poetry. … for the pre-Romantic poetry of melancholy meditation. imagination. of Thomas Percy’s collection of ballads. with its taste for the macabre and the supernatural. The publication. reflected… 4. c. but they proved to be (like the Ossianic poems) entirely the product of Chatterton’s inflamed Death of Chatterton. Chatterton committed suicide. Write the correct sequel in the space provided for each sentence.” presenting his own poems as authentic mediaeval verse. the victim of an (1856) insensitive and hostile world.English pre-Romantic poetry In 1770. young Thomas Chatterton (1752-1770). When his literary fraud was exposed. The coming generation of Romantic poets turned by Henry Wallis him into a legend. The churchyard was a favourite setting … 2. Like James Macpherson. The melancholy poetry of the Graveyard School. is a pre-Romantic reaction against Neoclassic literary decorum. SAQ 1 Read the partial statements below and match them. Reliques of Ancient English Poetry. These poems displayed lyric grace and the promise of talent. … a.
In the following subchapters. The sentimental opposition between town and country was to become a convention in 18 th century literature. Samuel Taylor Coleridge). the interest in rural life and its contrast with civilisation. Henry Fielding) would often associate the turbulent. Under the influence of Jean Jacques Rousseau*. towards the highest achievement of man’s Reason: civilisation itself. A return to blank verse – for which Shakespeare and Milton were the great models – allowed greater flexibility of expression. The great novelists (e. and the simplicity of country life with moral virtue. The return to blank verse 6. the interest in the local and national past. Towards the end of the century. sometimes within the context of Augustan conventions. patriarchal society in which men could enjoy fully their natural right to freedom.2. Elements of a pre-Romantic sensibility can be found all along the century. busy life of the city with moral confusion. The pre. and indeed the tendency along the century was to abandon it for poetic forms that allowed more freedom. the state of nature began to be idealised. the new feeling for nature – these were features indicating that literary taste was changing. characteristic of the Enlightenment.1. and the 18 th century abounded in optimistic utopias about an idyllic. In the latter part of the century.English pre-Romantic poetry 6. the inspiration from folk myths and legends. There was a growing suspicion that civilisation may have a corrupting effect on man’s innate goodness. The rural universe in 18th century poetry The emerging Age of Sensibility oriented the critical spirit. an interest developed in popular forms of poetry. valued for their simplicity and directness by the first Romantics (William Wordsworth. we shall look more closely at two important pre-Romantic aspects of 18 th century poetry: the development of a sentimental interest in rural life.g. William Blake would call the heroic couplet* the “great cage” of Augustan poetry. such as the song and the ballad. Proiectul pentru Învăţământul Rural 153 . and the emergence of a distinct poetic attitude towards nature. The emphasis on sentimental response.3. but also literary forms.Romantic sensibility and the interest in new poetic forms The transition from the Augustan to the Romantic age was slow and long. This change in taste concerned not only themes and subjects.
English pre-Romantic poetry
6.2.1. The sentimental approach: Oliver Goldsmith
An idyllic view of the countryside is present in the poem The Deserted Village (1770), by Oliver Goldsmith (1728-1774). Goldsmith’s literary preferences were Neoclassic, but his remarkable achievement is to have combined a sentimental theme with the elegant, balanced form of the Augustan couplet. The poem is Goldsmith’s reaction to a social and economic reality: the enclosure* of land, a capitalist process which changed radically the life of the traditional village. Goldsmith sets in contrast the former happiness of Auburn (an idealised version of his native village, in Ireland) with the desolation of the present, when the land is concentrated in the hand of “one only The Deserted Village master.” He remembers the days gone by, with their “humble illustration by happiness” spent in the middle of a hard-working but cheerful and W. Lee Hankey warm-hearted community. Their life was measured then by the cycles (1900 edition) of agricultural labour, alternating with the simple “sports” (i.e. amusements) and pleasures of the moments of well-deserved leisure. Goldsmith gives an idyllic picture of a rural paradise, in which man lives in harmony with nature and enjoys “health and plenty,” “innocence and ease,” and in which toil becomes a pleasure. This sentimental image of the “loveliest village of the plain” is only a memory, and the poet constantly moves between the happy past and the sorrowful present. His evocation of the past charms of “sweet Auburn” has an elegiac tone, and he laments the disintegration of the traditional, stable rural civilisation. Goldsmith blames the decay of the former way of country life on the increasing greed of man, on the excessive concern with accumulation of wealth, and on the vice of “luxury.” His village was an idyllic microcosm, a small but organic universe sustained by temperance and virtue, but incapable to resist the pressure of the new economic tendencies.
6.2.2. Character sketch in The Deserted Village
The Deserted Village illustrates not only Goldsmith’s sharp sense of observation in the description of natural beauty and of the human scene, but also his art of character sketch. His remembrance of the old days in Auburn focuses now and then on some member of the community, whom he evokes in short, precise and vivid features. Among his notable miniature portraits is that of the village schoolmaster, whose small eccentricities are captured with affectionate humour. A memorable sentimental description is that of the village preacher. Goldsmith emphasises the decency, moderation and humility of his simple life, “remote from towns,” his complete lack of ambition and vanity, and his strong attachment to the place and community which he serves. Firm in his moral guidance and a severe judge of human “wanderings,” Goldsmith’s parson is, however, a truly charitable soul, “to all the country dear.”
154
Proiectul pentru Învăţământul Rural
English pre-Romantic poetry
SAQ 2 The portrait of the preacher in The Deserted Village completes the idyllic picture of Auburn in the old days. Below, there are several features of this character. Read Text 6.1., containing a fragment from Goldsmith’s poem, and identify those lines which illustrate or suggest these features. Write these lines down in the provided spaces, after each mentioned feature. 1. moderation (1 line): 2. strong attachment to the humble community that he served (2 lines):
3. complete lack of worldly ambition or vanity ( 2 lines):
4. selflessness and sincere concern for the fate and spirit of those in pitiful circumstances (1 line): 5. hospitality to the poor (2 lines):
6. severity in his judgement of human error, but unconditional charity (1 line):
Compare your answer with the one offered in the section Solutions and suggestions for SAQs, at the end of the unit. If they should differ significantly, read the fragment from Goldsmith again.
6.2.3. The realistic approach: George Crabbe
Goldsmith’s idealisation of rural life received a sharply realistic reply from a poet who also continues the Augustan tradition: George Crabbe (1754-1832). His poem in rhymed couplets The Village (1783) is an attack on those poetic conventions which created the illusion of the innocence and happiness of country life. Crabbe’s medical practice afforded him a first hand observation of the rural world, and the sentimental cult of its idyllic charm had little to do with the realities that he encountered. His poem aims to paint village life “as Truth will paint it and as bards will not”. Instead of the cheerful ease, the innocent pleasures and the rewarding toil described in Goldsmith’s Deserted Village,
Proiectul pentru Învăţământul Rural
155
English pre-Romantic poetry
Illustration to (1905 edition)
The Village
Crabbe presents a sordid reality. For him, the sad truth of village life is the people’s hopeless poverty, their many vices, their struggle with an unfriendly nature for the daily bread. Despised and neglected by the rich, they lead a bitter existence, whose miseries never end. Crabbe denounces the unreality and artificiality of pastoral poetry, whose Muse knows nothing of the real pains and cares of the peasants. The moralist in him could not accept to disguise their deplorable fortune “in tinsel trappings [i.e. glittering ornaments] of poetic pride.” The classical image of the happy shepherd playing his pipe in the fields is out of place in the contemporary world, only a “mechanic echo” of other literary times. To prolong this convention, painting everything in “fair colours,” means to deviate from “Truth and Nature.” Crabbe pleads for a change in the poets’ attitude towards the subject of country life, in the belief that its realistic reflection will at least awaken curiosity and sympathy in the reader. The superficial praise of an idealised, conventional world serves only the poet’s vanity. The peasant, “overcome by labour” and consumed with many cares, would not get any comfort from such praise. Crabbe’s poem is completely unromantic, removing the veil of poetic illusion from a subject that was already a conventional one. However, his realism and critical spirit did not exclude genuine compassion. His sympathetic interest in the life of humble people anticipates the radical attitude of the first great English Romantic poet, William Wordsworth.
6.2.4. Robert Burns and the popular tradition
At about the same time, the Scottish peasant-poet Robert Burns (1759-1796) was opening a path towards the Romantic revolution in poetry. Written in his native tongue, the collected poems he published in 1786 were the authentic expression of a passionate nature, whose experiences were fundamentally linked to the universe of rural life. These poems are greatly indebted to the popular tradition of poetic forms (songs, ballads, etc.) and they display either delicate sentimental lyricism or vigorous realism, spirit and humour. Their intensely personal tone and their vividness and warmth in the description of the natural scene contrasted sharply with the formal rigidity and didacticism of much late 18th century poetry. Burns’s success as a poet confirmed the early Romantic belief in the close connection between nature, spontaneity of feeling, and poetic imagination. It was Burns who provided the lyrics for the song Auld Lang Syne, whose title means “old times” or “times past”. They were partly Burns’s composition, partly his transcription, as he said, “from an old man’s singing.”
156
Proiectul pentru Învăţământul Rural
English pre-Romantic poetry
SAQ 3 Text 6.2. in the Reader contains a fragment from The Village, in which Crabbe invites those who idealise the countryside in “smooth” verse to take a closer look at its realities. Read the fragment and point out that the image he offers is an antithesis to the idyllic picture of “rural ease.” How does Crabbe’s description contradict the nostalgic image in Goldsmith’s poem? You might find it helpful to read again subchapter 6.2.1. for a better perception of the contrast. Answer in the space below, in no more than 15 lines / 150 words.
Compare your answer with the one provided in the section Solutions and suggestions for SAQs, at the end of the unit. If they should differ significantly, read the fragment from Crabbe again, making sure you have understood it correctly. Read again the paragraphs referring to Goldsmith in the preceding subchapter, as well.
Proiectul pentru Învăţământul Rural
157
more ready to awake the poetical enthusiasm. Samuel Johnson said. Each of the four parts of the poem describes seasonal aspects of nature and rural life. “The reader of The Seasons wonders that he never saw before what Thomson shows him. the peace of autumn – bringer of “Philosophic Melancholy” –.1. as well as his glorification of “retirement in solitude” as the best state in which to “sing the works of nature. It appealed both to the Augustans and to the Romantics. In spite of its eclectic nature. The Seasons In the Preface to the fourth part of The Seasons.English pre-Romantic poetry 6. the philosophical reflection. becomes an object of interest in itself. nature. the splendour of summer. an expression of national pride. His poem educated.” inspired many other poets along the 18th century. than the works of Nature. poetic renderings of current notions of natural history. etc. Thomson practically inaugurated the trend of descriptive-meditative poetry. in many generations of readers. 6. and the apparent cruelty of winter. It contains reflections on the natural and social condition of man and on Nature as the manifestation of the divine ordering mind. not only the perception of nature. in its magnificence and diversity. Britannia. patriotic enthusiasm. manifest as early as the 1730s.3.” Thomson’s ambitious poem in blank verse is remarkably inclusive: its descriptions of nature occasion indeed frequent meditations on a variety of contemporary ideas and interests. with a remarkable attention to detail and precision of notation.” Thomson confesses that he knows “of no other subject more elevating. James Thomson. but also the feeling for it. With James Thomson (1700-1748) and his long poem The Seasons (1726-1730). and the moral sentiment. James Thomson (1700-1748) 158 Proiectul pentru Învăţământul Rural . Thomson is also famous for the patriotic lyrics that he wrote for the song Rule.” The Seasons marked an important moment in 18th century poetry. The Seasons has a unity ensured by the recurrent themes and motifs related to the observable natural universe. As Dr. more amusing.3. and that he never yet has felt what Thomson impresses. The Augustans were interested in nature only to the extent that it helped them emphasise the conquests of civilization. praise of friends. in which the descriptive detail was often used in order to create a certain mood. Pre-Romantic nature poetry One of the most significant shifts in poetic sensibility was the new attitude to nature. The conventional Augustan “local” poem (or “topographical” poem*) looked at nature from the perspective of historical or classical mythological associations. “Winter. political comments. Thomson evokes the glory and joy of reviving nature in spring. exerting a considerable influence on both of them. His praise of nature and of the countryside.
and his feeling for Nature is that of a pre-Romantic. from the third part. with its short. William Cowper. Proiectul pentru Învăţământul Rural 159 . records his observations and reflections.3. How does the Philosophic Melancholy influence the poet? Answer below. Cowper displays an Augustan concern for elegance and refinement in expression.English pre-Romantic poetry SAQ 4 Read Text 6. He reaches perfection in his famous Ode to Evening (1746). in popular superstitions and the supernatural. One of Thomson’s great admirers was William Collins (17211759).2. He preferred the classical form of the ode*. Passages of moral and political commentary.” Autumnal nature favours a contemplative-meditative mood. which represents a fragment from Thomson’s The Seasons – more exactly.. The Task has actually been described as a spiritual autobiography. unrhymed stanzas. but his subjects anticipate the Romantic sensibility. but his blank verse poem has a much more personal tone. more carefully. living in retirement from the city. and he displayed the Augustan taste for stylistic refinement. He was interested in the mediaeval past. Like Thomson and Collins. read text C again. Compare your answer with the one given in the section Solutions and suggestions for SAQs. religious meditations and character sketches accompany Cowper’s celebration of rural domestic happiness and communion with nature. in a paragraph of no more than 6 lines / 60 words. at the end of the unit. William Collins 6. the poem The Task (1785) by William Cowper (1731-1800) reflects a similar attraction to the theme of nature. which actually inspired Thomson).3. social satire. in which he captures with precision and delicacy the crepuscular atmosphere. “Autumn. If there should be major differences. in which a sensitive and thoughtful Christian. whose work brings into harmony the various tendencies in 18th century poetry. The Task Much closer in time to the beginning of the Romantic Age. which the poet calls “Philosophic Melancholy” (remember Milton’s Il Penseroso*.
represents one of the most memorable statements. Read this fragment and explain why Cowper finds the countryside superior to the urban world. of the seasonal diversity of natural aspects. however. / Paradise that has survived the fall. extracted from Cowper’s The Task. and his expressions of gratitude for the spiritual comfort and superior joys that it offers anticipated the first generation of English Romantics (W. concerning the opposition country/town. in which he can find shelter against depression and anxiety. Your answer should not exceed 10 lines / 100 words. he becomes aware of the instability of this last retreat from the confusions and corruption of modern urban civilisation. Retirement to the countryside does not mean for him idle solitude – it is not isolation that he seeks in rural nature.English pre-Romantic poetry illustration by Birket Foster. but the joy of communion with friends. which he opposes to the civilisation of the city. indicate an affectionate observer. and of simple. The contemplation of nature has a healing effect on Cowper. Coleridge).e. in the Reader. 160 Proiectul pentru Învăţământul Rural . Cowper displays a remarkable eye for detail and a landscape-painter’s sense of perspective.4. Wordsworth. 1856 The Task. S. affected] the country. domestic activities. with its vices and follies. Cowper’s love of nature is closely linked to his love of the countryside. Read again the fragment if you answer is significantly different. He praises the simple pleasures. His meticulous descriptions of countryside scenery and animal life.” Sometimes. at the end of the unit. like gardening. Rural “domestic happiness” seems to him “the only bliss. T. fearing that “The town has tinged [i. As a poet of nature. Compare your answer with the one offered in the section Solutions and suggestions for SAQs. SAQ 5 Text 6. in the 18th century. the peace and quiet of village life.
A heart that is insensitive to nature is a hard heart. finding literary inspiration in the simplicity and directness of popular poetry. the rural setting. Blake as a pre-Romantic poet Blake is often regarded as a pre-Romantic poet. rendered in its pastoral simplicity. In Blake. our sense of a common fate for all humanity. represents symbolically the uncorrupt order of nature. whose attitudes and concerns define him sharply as an anti-Augustan. and his creative personality manifested itself in combined and complementary modes of expression. these various dimensions of his works shed light on each other. in the tone and rhythms of Biblical psalms and religious hymns. Gray. These beliefs – in Nature as a moral teacher and as a guide for imagination – were central to the creed of the first Romantics. and displays the same humanitarian spirit as his contemporaries. and this laborious process restricted the number of copies that Blake could produce. Blake’s late fame is due. picture and decoration reminds of the painful. Like other pre-Romantic poets. widening the range of meanings. Thomson. 6. Each copy was then coloured by hand. In his first great illuminated work. He was an admirer of Shakespeare. he turns his attention to the rural world. The combination of calligraphic text. Songs of Innocence and of Experience (1794). Blake did not publish his poems in conventional printed form. and Macpherson. He used a special method for engraving and printing the handwritten text. He was not only a poet.1. He was a relatively marginal figure during his lifetime. and being regarded as an eccentric artist. He associates nature with the Proiectul pentru Învăţământul Rural 161 . which was accompanied by drawings and decorations. It was in the latter half of the 19th century that he was rediscovered by a group of poets and painters. the visionary artist William Blake holds a unique place in the history of English literature. all Blake’s major poems were composed in this way. to a large extent. Nature “nurses” the sympathy for our fellow beings. minute work of mediaeval miniaturists and their illuminated* manuscripts. “unfit for human fellowship” and “dead” to “love and friendship both” (Cowper).civilisation. to the special way in which he produced his work. and he rejected the classical standards of style.4. exerting influence only on a small circle of friends and admirers.English pre-Romantic poetry Both Thomson and Cowper see a strong connection between love of nature and a humanitarian spirit. William Blake (1757-1827) 6. The theme of childhood in this work enables Blake to explore the opposition nature . and recognised as one of the most original creators. The charms of nature have also an almost magic influence on human creativity and depth of thought.4. Milton. but also a gifted painter and engraver. Apart from a volume of early verse. William Blake.
original and strange. Blake was a rebel. and his whole work. They are. for instance: “I copy Imagination.4. Los*. the Romantic visionary Blake is also frequently assimilated to the first generation of Romantic poets.2. The classical Muses were for him the “Daughters of Memory”*. which oppresses man in the name of Reason and Progress. Like the other English Romantics. says. He distrusted all systems of thought and institutions that restrained man’s freedom and imagination. One of Blake’s mythological creatures in these poems. in Blake’s last poem. a tribute to Milton. owing to the intensity with which he proclaimed the primacy of the Imagination over Reason and his deep conviction that the poet was a seer. unpremeditated act. whom Blake (like the other Romantics) venerated.” He is a true Romantic in his belief that poetic creation is a spontaneous. a prophet. 6. and whom he saw as the embodiment of the revolutionary impulse. and he denounces the evils of civilisation.English pre-Romantic poetry innocence of man in his condition before the Fall – the “childhood” of humanity –. or be enslaved by another man’s. / I will not reason and compare: my business is to create.” or “I write when commanded by spirits.” asserting that ”Imagination has nothing to do with Memory.” Blake worshipped Imagination as the only true way to spiritual freedom. He insisted on the visionary and inspired quality of his writings – he asserted. in which Blake creates a mythology of his own. is one of the most powerful assertions of Romantic creativity. His rebellion against the “systems” which limit the energies of the Imagination takes a literary form in his Prophetic Books*. Plate from the poem Jerusalem (1805-1820). by William Blake 162 Proiectul pentru Învăţământul Rural .” This is Blake’s own creed. and he opposed to them the “Daughters of Inspiration. Jerusalem: “I must create a system. Blake. in a way.
their clarity of expression and their musicality. 6. T F 3. 163 Songs of Innocence (1789) Title page of Proiectul pentru Învăţământul Rural . which echoed the rhythms of popular verse.English pre-Romantic poetry SAQ 6 Read the following sentences and identify the four true statements which describe features of Blake’s work. revise the whole subchapter. If you have made mistaken choices. and its origin was visionary experience. T F 7. or Cradle Song offer a glimpse into a world filled with simple. poetic creation was the spontaneous fruit of inspiration. enjoy] to hear. The subchapter that follows will acquaint you with some of the poems illustrating Blake’s “double vision” in Songs of Innocence and of Experience.3. these are “happy songs / Every child may joy [i. T F 2. that is. innocent delights. Blake enjoyed a great popularity during his lifetime. echoing with laughter and sustained by love and by the belief in the goodness of nature.4. Circle appropriately T (true) or F (false). the association of childhood with edenic nature is opposed to civilisation as the fallen condition of man. What chiefly impressed Blake in Milton’s Paradise Lost was its astonishing display of classical-humanistic erudition. The theme of childhood in Songs of Innocence In 1789 – the year of the French Revolution –. The Echoing Green. Blake is a creator of myths in his Prophetic Books. The Blossom. Spring. The Shepherd. It was the year of a revolution in poetry as well. T F Check your answers in the section Solutions and suggestions for SAQs. As the poet emphasises in the Introduction. and the three statements that are false. of the world seen through the eyes of the child. Laughing Song. T F 5. For Blake. The extreme formal simplicity and the apparent lack of sophistication of these short poems anticipated the Romantic rejection of poetic diction*. Blake composed his first significant work: Songs of Innocence. which are the expression of his Romantic rebellion against all forms of constraint. T F 6. Blake’s works combine the handwritten text with picture and decoration – a technique that reminds of mediaeval manuscripts. 1. at the end of the unit. The main influence in Blake’s work were the ancient Greek and Latin poets admired by the Augustans. As a poet. Songs of Innocence marked a new departure in English poetry. Poems like Infant Joy. with its repertoire of rhetorical conventions.e.” They build a charming picture of the universe of childhood. T F 4. In Songs of Innocence and of Experience. by their remarkable lyrical delicacy.
with which Blake was acquainted. associated with childhood. and absence of frustration or inhibition. in his natural tendency to virtue. taking care of his flock of innocent lambs.” Throughout his work. is a biblical allusion. the pressure of civilisation and an education which cultivates the intellect at the expense of the soul are likely to destroy in man the natural state of grace. Innocence. The pastoral figure of the shepherd receives in Blake a Christian connotation. in Nurse’s Song. According to him. Blake filtered these ideas through his own intense idealism and his unconventional religious beliefs. suggesting the child’s closeness to a protective divinity. with white hair. The world of Innocence is the paradise of freedom. and the perception of childhood was greatly influenced by Jean Jacques Rousseau’s ideas. In The Echoing Green. Blake identifies Jesus with the Imagination. Besides the children themselves. The adult figures represented in these poems share the child’s freshness of perception and capacity for joy. does not mean ignorance.e.” as the happiness of the children playing around him and the animation of nature in Spring enable him to recreate his own joys of childhood. The innocence associated with childhood is for him the equivalent of the original state of paradisal innocence. Infant Joy (Songs of Innocence) 164 Proiectul pentru Învăţământul Rural . Rousseau believed in the original innocence of man.” can “laugh away care. Blake rejected the praise of Reason as man’s supreme faculty and proclaimed instead the importance of man’s “Poetic Genius. the Songs of Innocence display protective figures like the caring mother or nurse.English pre-Romantic poetry Nurse’s Song (in Songs of Innocence) The theme of childhood emerged in late 18th century poetry in the context of the rising cult of Feeling. gratified desire. The nurse. the guardian angel. “Old John. meadow]”. The pastoral setting symbolises the closeness of man to a benevolent nature and the bliss enjoyed by man in Paradise. For Blake. or even Jesus. because she has the empathic understanding of the children’s need for freedom. although the sun has set. childhood represents the unfallen state of man. In these poems. the shepherd. The child has a kind of wisdom which comes from the freshness and freedom of his imagination. love. The good shepherd. which a proper education should develop. and every child is a manifestation of the Divine Imagination in the world. allows the children more time to play “on the green [i. It is a world in which evil has not penetrated and in which there is no suffering. who express their candid feelings of piety and uninhibited joy.
which reproduces Blake’s poem The Lamb.5.English pre-Romantic poetry SAQ 7 Read Text 6. in the Reader. Compare your answer with the one provided in the section Solutions and suggestions for SAQs. at the end of the unit. If there should be a significant difference between them. and in which he represents to himself its “making. Proiectul pentru Învăţământul Rural 165 . revise this subchapter and read the poem more attentively. Focus on the way in which the child imagines the creator of the lamb. What makes this poem a Song of Innocence? Start from the idea that The Lamb may be read as the vision of Innocence on the act of Creation.” Answer in the space below. in no more than 20 lines / 200 words.
4. society and divinity. the child has a wonderful vision of all souls freed from their “clouds” of flesh – black or white –.English pre-Romantic poetry 6. even sarcastic. hate. it is suggested that human suffering and oppression is the result of “mind-forged manacles*”. in which man’s lot is hard work. and Nurse’s Song shows the (1794) jealousy consuming an adult who has lost the vision of Innocence. or the mind of others. 166 Proiectul pentru Învăţământul Rural . but the child in the poem is comforted by the vision of the Angel. The world is seen through the eyes of an angry observer. The Clod and the Pebble Songs of Experience contrasts selfless with selfish love. for instance. which deny man his freedom. nature. The poet attacks the tyranny exercised on the individual by the church and state. The serene and peaceful pastoral setting of the world of Innocence is set in opposition with the sombre world of Experience. but. In The Little Black Boy – an anti-slavery poem –. standing equal before God. In London. A poem like A Poison Tree points out Title page of the murderous effects of secret hate. the greed of the powerful and their indifference to the sufferings caused by social injustice. often. The fall from the paradise of Innocence to Experience is the entrance in a world of rules and constraints. full of indignation and anger. the thirst for war. envy and deceit. The fall from Innocence: Songs of Experience Blake developed such implications into open statements. for instance. In The Chimney Sweeper*. in the poems that he added in 1794: the Songs of Experience.4. protesting against the evils of his time. the little black boy is “protected” by his imagination and finds the same comfort for the present sorrows in the Christian promise of a happy afterlife. a gloomy reality makes itself felt sometimes. Beyond the children’s innocent visions of happiness and harmony. In the fallen state of Experience. 6. the ethical and social implications are more obvious. when this life ends. of the prejudices and constraints with which man “enchains” his own mind. of “stony laws*”. disease. i. Ironic implications in Songs of Innocence Blake’s graceful Songs of Innocence may appear to be simple and transparent. the ironic implication in the poem is that the English colonisers “taught” Christianity to the natives only to be able to exert better control over them. Blake’s speakers in these poems are often bitter and ironic. poverty and oppression.5. The complete work offered now a set of contrary symbolic visions of man. which is a promise of divine mercy.4. the reader cannot help noticing paradoxes and contradictions. However. The source of corruption in the world of Experience and the impediments to happiness are as much in the systems regulating social life as in the individual heart and mind. In Songs of Experience. love and joy have been replaced by fear. the reader cannot miss the implicit reference to the social reality of children’s exploitation and cruel treatment. Like the chimney sweeper.e.
and the rhythms of the poems are also more difficult.English pre-Romantic poetry 6. revise this subchapter and read the poem more attentively. Proiectul pentru Învăţământul Rural 167 . at the end of the unit. Compare your answer with the one provided in the section Solutions and suggestions for SAQs.6. The speaker in the latter poem wonders not only who created the “fearful symmetry” of the powerful.4. innocent question (“Little Lamb. who made thee [i. you]?) and his own answer. in a paragraph of 10 lines / 100 words at the most. This suggests that the world of Experience is more opaque and uncertain.e. Quote the respective words or line(s) and give your comment in the space below. by ambiguity and even obscurity. The implication is that knowledge in the state of Experience is always incomplete and fragmentary.6. SAQ 8 In Blake’s poem Infant Sorrow. If it should differ in major respects. Read this poem – Text 6. The two stanzas of The Lamb contain the child’s simple. but also if this creator is also that of the gentle lamb. The counterpart of The Lamb in Songs of Experience is The Tyger* and this pair of poems illustrates very well the contrastive vision in Blake’s work. Knowledge in the world of Experience The clarity and directness of Songs of Innocence is replaced. the event of a child’s birth becomes the symbol of the fall into the world of Experience. with no explicit answer. provoking more anxiety than certainty. in the Reader – and find out in its lines suggestions for at least one aspect which defines this “dangerous” world. in Songs of Experience. while The Tyger consists only in an accumulation of questions. dangerous tiger.
and King” “make up a Heaven of our misery. The two poems entitled Holy Thursday* deal with the hypocrisy of the church.” Blake’s Songs suggest that Innocence and Experience are not only inevitable stages in human growth. like that of Hell as a punishment for sin. but he seems to be fully aware of his condition in an unjust world. indeed. but with ways of seeing and feeling. In the poem of Innocence. as Blake indicated in the subtitle. and His Priest.” In the counterpart poem.4. a stern. this sad reality is shadowed by the speaker’s idyllic description of the poor children of London. The former is represented in Blake’s work (the Prophetic Books included) as an “angry” God.” which lead to contrary visions. He sees nothing “holy” in the beautiful picture. seeing it as an instrument of oppression and a source of corruption. with its “mysteries”*. in Songs of Experience. was responsible. served by the institutionalised churches. the spectator to the same scene has a quite different vision. There is a Chimney Sweeper in Songs of Experience as well. but also complementary aspects of man’s imagination. which allows the rich and powerful of this world to ease their conscience and “buy” Heaven by occasional and festive acts of charity.” in a country that is “rich and fruitful. The Chimney Sweeper in Songs of Experience is bitterly ironic about the way in which “God. in Blake’s view: “Attraction and Repulsion. The church. He displays. A deeply religious person. tyrannical figure. Reason and Energy*.” The idea of Heaven as a reward of happiness for earthly misery. One of the targets of Blake’s critical attacks is the Church. compared with “flowers” and “Thames’ waters.” The angry speaker protests against the duplicity of a society that feeds its poor “with cold and usurous* hand. and he is also a child.7. in fact. Love and Hate are necessary to Human existence.” Such corresponding poems illustrate the fact that Innocence and Experience are not necessarily to be associated with ages in man’s life. Contraries are essential to progression. 168 Proiectul pentru Învăţământul Rural . This is the God of the world of Experience.” or with a “multitude of lambs. a double awareness of his own innocence and of the hypocritical and cruel world around him. The double vision in Blake’s Songs Several other poems in Songs of Experience have a counterpart in Songs of Experience.English pre-Romantic poetry 6. which are thus strengthening their own power. Blake made in fact a distinction between the God of the Old Testament and God of the New Testament. was seen by Blake as an instrument by which the church kept men in a state of obedience. imposing constraints and inflicting punishment. “contrary states of the human soul. for keeping man at a distance from God. Blake hated nevertheless the church as an institution. They reveal. since those are “babes reduced to misery. bearing even the same titles. in Blake’s view.
but he is no longer able to do that. and read the poem again more carefully.7. except as an act of remembering. at the end of the unit. Compare your answer with the one offered in the section Solutions and suggestions for SAQs. in the Reader – tells the story of the loss of Innocence and the entrance in the state of Experience. to 6. revise subchapters 6.English pre-Romantic poetry SAQ 9 The poem The Garden of Love – Text 6. Explain them in no more than 20 lines / 200 words.1.. If there should be major differences between them.4. to regain the vision of Innocence.4.2. The two “states of the human soul” are here set in contrast. Proiectul pentru Învăţământul Rural 169 . The speaker’s “journey” to the garden of Love is an attempt to revive the former state. Read the poem carefully and identify the symbols by means of which the two states are contrasted.
The same theme and situation acquires contrary implications. Their poetry displays an unprecedented attention to natural detail. presents the outstanding figure of William Blake. as Blake’s “double” poems suggest.English pre-Romantic poetry Summary This unit aims at enlarging your picture of the literary diversity of the 18th century. The first subchapter of this unit deals with two prominent features announcing the Romantic sensibility. deals with the way in which poets like James Thomson. In subchapter 6. His Songs of Innocence and of Experience are the testimony of the visionary artist. Subchapter 6. who sees the opposition nature-civilisation in the light of the myth of Paradise and of the Fall. 6. in whose work pre-Romantic and Romantic elements meet. He condemns the literary habit of idealising the countryside. the vision of Innocence and the vision of Experience completing each other. nature-civilisation. and they acknowledge Nature’s subtle influence on man’s thoughts. One of them is the emergence of a kind of meditative poetry fond of melancholy themes and gloomy settings. and seeks to arouse compassion for the life of labour and poverty of the English peasant. The last subchapter. The “Graveyard” poets (e. The other feature is primitivism.. Another feature of 18th century pre-Romantic poetry is the perception of rural life in its close connection with Nature.2. g. the interest in early poetry. William Collins and William Cowper approach the theme of Nature. The transition from the Age of Reason to the Age of Feeling in the 18th century was accompanied by changes in literary taste. Edward Young and Thomas Gray) illustrate this new trend.3. you have been acquainted with two poets who turned their attention to the rural universe. imagination and feelings. 170 Proiectul pentru Învăţământul Rural . and of Thomas Chatterton with the Middle Ages anticipates the Romantic spirit. The theme of Nature in pre-Romantic poetry is sometimes closely associated with the opposition country-town. Oliver Goldsmith emphasises the idyllic happiness of the traditional rural civilisation. now threatened by the march of Progress. The latter may be also seen as complementary aspects of poetic imagination.. in its relation with “the two contrary states of the human soul”: Innocence and Experience. The theme of childhood is examined in several Songs. George Crabbe adopts a more realistic and critical view.4. The fascination of James Macpherson with Britain’s Celtic past. by focusing on those tendencies in poetry which prefigure the Romantic Age.
for the sake of more profitable farming. Daughters of Memory: in Greek mythology. The Celtic variety spoken in Ireland and Scotland is called Gaelic. because the life of the poor was not actually reflected in such official records.2. and they were forced to find work in towns or to emigrate to America. It was a kind of work that contributed to the child mortality rate. the changes in agriculture led to the enclosing (i. Sometimes. blank verse: see again the Glossary in Unit 1. enclosed portions of land were turned into private parks and gardens. children were often employed for the cleaning of chimneys. putting fences round) common land. enclosure: in the latter half of the 18th century. Imagination was free Energy. for instance. goddess of Memory. Celtic: related to the Celts. Their father was Zeus. Ireland and Wales. favour melancholy or morbid themes. which has survived in parts of Scotland. decorum: see subchapter 4. which they could climb more easily. Energy: for Blake. the nine Muses were indeed the daughters of Mnemosyne. The first Gothic novel was Horace Walpole’s The Castle of Otranto (1764). in Unit 4. For the small farmers.e. while Reason was concerned with setting limits. civilisation rural universe primitivism melancholy sentimentalism humanitarianism childhood imagination Innocence and Experience double vision Glossary • • • annals: yearly record of events.2. Initially. A tendency in 18th century poetry went precisely against this rule. chimney sweeper: in the 18th century. Gray is sadly ironic. ruins. the term “Gothic” referred to the mediaeval inspiration of such tales of mystery. graveyards. or Erse. Haunted castles. passion. as the next subchapter will show. 171 • • • • • • • Proiectul pentru Învăţământul Rural . the members of an Indo-European people who inhabited Britain before the arrival of the Romans. Gothic novel: a type of fiction that emerged in opposition with the realistic novel in the 18th century. Enlightenment: see again the Glossary in Unit 1. Celtic refers also to the language spoken by the Celts.English pre-Romantic poetry Key words ● ● ● ● ● ● ● ● ● ● ● pre-Romantic nature vs. and horror. The Neoclassic principle of decorum did not. the enclosures meant ruin.
sentimental novel: see subchapter 5. Among the most important of them are America. luxury and materialism of urban civilisation. and he rejected the pretense of the Church to intermediate between man and God. The Book of Urizen. who attacked and sometimes settled in parts of Britain between the 8th and 11th centuries. used to secure the hands of a prisoner. belonging to the beginnings. illuminated (about a piece of writing): decorated by the application of colour. The Four Zoas. were typical settings in Gothic fiction. See also subchapter 4. Il Penseroso: see again subchapter 3.3. Neoclassicism: see the Glossary in Unit 1. etc. The custom in London was to bring the poor. unfeeling – is intensified by Blake’s allusion to Moses and the Tables of the Law. with His laws formulated as interdictions. Blake associated “mystery” with secrecy and deceit. The Book of Los.1. when the ascension of Christ is celebrated. the 39th day after Easter. the Passions. wild landscapes. 2 in Unit 4. and Proiectul pentru Învăţământul Rural 172 . philosophical and political convictions. A Prophecy. Prophetic Books: the generic name for Blake’s longer (and often obscure) epics.1.. in Unit 3. heroic couplet: see again subchapter 1.3. Norse: related to the ancient Scandinavian people. which have a complex structure of symbolism and analogies. or of gold or silver paint.2. Jerusalem. manacles: a pair of iron rings linked by a chain. Highlands of Scotland: the mountainous area in northern Scotland. on which the Ten Commandments were written. Pity. ode: see the Glossary in Unit 1. Most of Collins’s odes are addressed to personified abstractions (Fear. mysteries: the system of sacramental rites affording access to divinely revealed truths. in Unit 1. etc. concerning the typology of the novel in the 18th century. orphaned children from the charity schools to St. primitive: original. Paul’s Cathedral. as well as against the sophistication. which still preserves elements of the ancient Gaelic culture.English pre-Romantic poetry • • • • • • • • • • • • • • • • • secret chambers and corridors. The feeling of nostalgia for a supposed Golden Age and the praise of the “state of Nature” are also features of primitivism. Romanticism: see again Romantic in the Glossary in Unit 1. Primitivism in literature refers to the admiration for and revival of early forms. in Unit 5. Milton. Holy Thursday: another name for Ascension Day. Los: Blake’s mythological character represents human Imagination in his epics. especially to the Vikings (or Norsemen). and in which he gives an allegorical shape to his religious. It is associated with the reaction against Neoclassicism. stony laws: the figurative meaning of “stony” – heartless. Blake distinguished between the prohibitive divinity of the Old Testament. to attend the religious service.) poetic diction: see again the Glossary in Unit 1.
Pay special attention to the instructions for the task. 6.13. Remember that. Send-away assignment no. your tutor will take into account: • the closeness of your answer to the formulated requirement (30%).English pre-Romantic poetry • • • Jesus. and Holy Thursday (Texts 6. 6. • Read them and show that Blake’s treatment of the theme of childhood depends on the contrast between the vision of Innocence and the vision of Experience on the same reality. Point out the pre-Romantic themes and attitudes that these poems illustrate. • the coherence. He condemned social inequality and regarded the sovereignty of the people as the only legitimate form of political power. Pay special attention to the images in these poems and to their symbolic significance. topographical poem: a poem in which the description of a landscape is accompanied by meditation and historical retrospection. meant to win a patron’s favour.9. and 6.).. 6.. and consistence of your ideas (40%) • the accuracy of your grammar (20%) • the accuracy of your spelling (10%) Proiectul pentru Învăţământul Rural 173 . Jean Jacques: (1712-1778): French writer and philosopher. Gallery of personalities • Rousseau.12. The Chimney Sweeper. clarity. in grading your paper. 3 The Reader includes some of the “pair poems” from Blake’s Songs of Innocence and of Experience: Nurse’s Song. 3 will count as 10% in your final assessment. 6.10. with his law of love. Tyger: Blake’s spelling of “tiger.” usurous: from usury. SAA no. gardens or estates. Many topographical poems were praises of particular parks. the unlawful practice of lending money at an exorbitant rate of interest...8. whose radicalism strongly influenced the ideology of the French Revolution.11. Your commentary should not exceed 50 lines / 500 words. He is the precursor of Romanticism by his belief in the primacy of feeling over reason and in the necessity of the return to nature – a principle which he defended in his treatise on education Émile (1762).
Crabbe presents a desolate picture.e.English pre-Romantic poetry Solutions and suggestions for SAQs SAQ 1 1. SAQ 4 The personified Philosophic Melancholy exerts “his” influence on man’s imagination. the vagants’] wanderings. “passing rich with forty pounds a year” SAQ 3 In contrast with Goldsmith’s idealised image of rural happiness and ease. Meditation leads to illumination. love of nature. 3. the “drooping weary” father. There is a general sense of decay and exhaustion in the humble scene in the cottage: the “pale” mother. Nor e’er had changed. these gifts are “threatened” – the life of pleasure and luxury with which the city tempts man may corrupt his moral fiber. Health and virtue are God’s “gifts” to man. the country is therefore morally superior to the city. he focuses sharply on the withered tree. In the city. 174 Proiectul pentru Învăţământul Rural . 4. b. “He chid their [i. “More skilled to raise the wretched than to rise” 4. whereas what man makes is inevitably deficient. to enable him to bear more easily the burden of life. all intensified. “Remote from towns he ran his godly race. or seek for power. and love of man. and on his thoughts. 2. c SAQ 2 1. in which everything seems to be in decline. but relieved their pain” 6. “His house was known to all the vagrant train” “The long-remembered beggar was his guest” 2. “Unpractised he to fawn. a. the mind can see beyond the “dim” surface of things. The country is thus a substitute for Eden. SAQ 5 The first line of the fragment contains the implication that everything made by God is perfect. For Cowper. broken branches are a “sad emblem” of the unrewarding existence of the poor in the countryside. This heightened understanding is accompanied by “correspondent passions”: love of God. Their hard life has no room for illusions about the comforts of old age.” “expiring” fire suggest overwork. Crabbe’s descriptin of the old man’s weakness and of the pains of old age is meant to contradict the pastoral emphasis on the “health and plenty. By doctrines fashioned to the varying hour” 5. nor wished to change his place” 3.” vitality and cheerfulness of the idyllic village life. the place where “health and virtue” can be found abounding. disease and poverty. the “feeble. d. on his soul. Its bare. Crabbe also gives a reply to those who idealise rural nature: instead of the pleasing “smooth stream” sung in such poetry.
in the state of Experience. and his “tender voice” fills all nature with joy. At the same time. T. The mother “groans” with the pains of delivery. If the child’s play suggests the freedom and pleasure enjoyed in the state of Innocence. and is itself one more care in the family. meadow. “Struggling in my father’s hands / Striving against my swaddling bands” – The new born infant is practically a “prisoner” from his first moments in the world. In the simple economy of the poem. T. gentle and humble like the lamb itself. F. and the father weeps perhaps because his new baby comes into a world of trouble and cares. 2. It is the intuition of Innocence that dictates the confident answer to the child: the Creator is Jesus. 7. 6. In the second stanza. 4. SAQ 9 The “garden” where he “used to play” – the Eden of childhood – is the symbol of the state of Innocence. which he has lost. 2. This is also suggested by the gloomy figure of the priests. my father wept” – In the vision of Experience. 5. The pain and sorrow accompanying birth are symbolic anticipations of the suffering. The vision of Experience reveals to him the perspective of death: the garden turns out to be a graveyard. being thus a source of oppression. in Blake’s vision. and the beauty of the “sweet flowers” – symbols of life – is replaced by the grim image of the tombstones. T. Experience brings about inhibition and constraint. but are symbols of limitation. the lamb is God’s gift to the child: it is a “delight” to look at and to touch. T. therefore. the few elements of the natural setting (stream.English pre-Romantic poetry SAQ 6 1.” The child imagines the making of the lamb as the act of love of a generous and protective creator – “making” and “giving” are made somehow equivalent in the first stanza. the child identifies himself and the lamb with Jesus. against which man. “walking their rounds” like soldiers guarding a Proiectul pentru Învăţământul Rural 175 . a child’s birth is no cause for joy. and. it controls man’s relationship with Divinity. F. In a vision of Innocence. the God of Love. SAQ 8 Examples: 1. 3. “My mother groaned. The church as an institution belongs to the world of Experience. Nature and Divinity form a harmonious whole. disappointments and frustrations that await man in the world of Experience.” that is. incarnated in a child and having the Lamb as a symbol. His swaddling bands and his father’s arms do not suggest care and protection. The interdiction “Thou shall not” on the door of the chapel suggests repression and limitation. The shut gates of the chapel symbolise the estrangement of man from God. struggles in vain. the “Lamb of God. confinement and oppressive authority. no longer able – or permitted – to relate to God “naturally” and directly. F SAQ 7 The child cannot imagine the Creator of the lovely and tender creature otherwise than “meek and mild. vales) emphasise the close connection between Innocence and Nature. Man.
1991 (pp.. Penguin Books Ltd. 652-658.. vol. A Critical History of English Literature. 671-684. The New Pelican Guide to English Literature.English pre-Romantic poetry restricted area. Daiches.. 3 (“The Restoration to 1800”). 84-94) 3.). Further reading 1. London: Secker and Warburg Ltd. 1969 (pp.).5 (“From Blake to Byron”). Ford. The New Pelican Guide to English Literature. vol. Boris (ed. 1991 (pp. Penguin Books Ltd. David. 692-699) 2. 6987) 176 Proiectul pentru Învăţământul Rural . vol. and conditioning man’s access to the mystery of Divinity on the suppression of his desire. Ford.4 (“From Dryden to Johnson”). Boris (ed.
Reader READER in Seventeenth and Eighteenth Century British Literature Proiectul pentru Învăţământul Rural 177 .
this brave* overhanging* firmament*. the earth. cum să spun. Ce minunată lucrare e omul. how express and admirable! In action how like an angel. shape canopy a large or wide covering (e. the sky) brave minunat. in apprehension* how like a god!! The beauty of the world! The paragon* of animals! And yet. – lost all my mirth*.Reader UNIT 2 THE LATE RENAISSANCE AND THE BAROQUE TEXT 2. this majestical roof fretted* with golden fire. cât de chibzuit şi de admirabil e în faptele sale. Hamlet (Act II. it appears no other thing to me but a foul* and pestilent congregation of vapours.excelent. sufletul îmi este atât de apăsat. – but wherefore* I know not. ce înseamnă această chintesenţă a ţărânii? Omul nu mă desfată (…). William Shakespeare. literary) the sky fretted decorated foul very bad or unpleasant apprehension understanding. acest preaminunat baldachin. pildă a vieţuitoarelor. forewent.g. of late recently wherefore why. văzduhul. and indeed it goes so heavily with my disposition that this goodly* frame*. what is this quintessence of dust? Man delights me not (…). foregone* all custom of exercises. acest mândru firmament ce senalţă deasupra noastră. ce fără de număr îi sunt facultăţile. nu ştiu – mi-am pierdut toată voioşia. for what reason mirth happiness and laughter foregone to forego. într-adevăr. m-am lăsat de toate obişnuitele exerciţii. îmi pare un promontoriu sterp. cât de asemenea unui înger în puterea sa de înţelegere. the air. seems to me a sterile promontory. această boltă falnică împodobită cu scântei de aur. What a piece of work is man! How noble in Reason! How infinite in faculty! In form. cât de nobilă îi este inteligenţa. alcătuirile şi mişcările. ability to understand paragon a model of excellence Romanian translation (by Leon Leviţchi and Dan Duţescu) Hamlet: În ultima vreme – de ce. încât acest frumos tărâm. şi totuşi. this most excellent canopy*. cât de asemenea unui zeu: frumuseţea lumii. to me. şi. foregone: to give up goodly pleasant or satisfying in appearance frame form. strălucitor overhanging hanging over firmament (archaic. pământul. in moving. Scene II) Hamlet: (…) I have of late*. nu-mi pare alta decât un vălmăşag odios şi infect de miasme. pentru mine.1. 178 Proiectul pentru Învăţământul Rural . vedeţi. look you.
out. a poor player. And then is heard no more. The death of each day’s life. principal nourisher that which gives (someone) what is needed to grow. to be in a state of anxiety and agitation (a se agita. methought past tense from methinks (archaic): it seems to me to knit up a împleti.2. ţanţoş. sore* labour’s bath.3. and tomorrow. Creeps* in this petty* pace from day to day. moartea vieţii fiecărei zile. scalda grelei trude şi balsamul Durerii sufleteşti. full of sound* and fury. Balm of hurt minds. To the last syllable of recorded time. That struts* and frets* his hour upon the stage. neînsemnat) out (interjection) termină. cu un aer important to fret to be distressed. William Shakespeare. to creep. And all our yesterdays have lighted fools The way to dusty death. isprăveşte (stinge-te) brief short in duration candle lumânare to strut a umbla/păşi/călca mândru. crept to move quiety and slowly (a se târî. şi-a doua mană A marii firi. trivial. brief* candle*! Life’s but a walking shadow. a înnoda ravelled destrămat. cel ce desface Fuiorul încâlcit al grijii – somnul: El. desfirat. and tomorrow. chinuitor) course fel de mâncare chief most important. great nature’s second course*. desfăcut sleeve mânecă sore causing grief or sorrow (dureros. Macbeth (Act II. trifling (mărunt. TEXT 2. live or stay healthy feast ospăţ Romanian translation (by Ion Vinea) Macbeth: Mi s-a părut c-aud un glas strigând: “Nu mai dormi! Macbeth ucide somnul” Nevinovatul somn. William Shakespeare. Out*. El. scene V) Macbeth: Tomorrow. semeţ.Reader TEXT 2. Sleep that knits up* the ravelled* sleeve* of care. it is a tale Told by an idiot. scene II) Macbeth: Methought* I heard a voice cry “Sleep no more! Macbeth does murder sleep. iar la ospăţul vieţii Cel mai de seamă fel.” the innocent sleep. Chief* nourisher* in life’s feast* (…). Signifying nothing. a se furişa) petty inessential. a se frământa) sound zgomot Proiectul pentru Învăţământul Rural 179 . Macbeth (Act V.
therefore* wast thou* Deservedly* confined* into this rock Who hadst deserved more than a prison. had that in it which good natures Could not abide* to be with. netrebnic. redus. Took pains to make thee speak. Know thine* own meaning. Though thou didst learn*. E o poveste spusă de-un nătâng. for that reason wast thou were you deservedly rightly learning teaching vile 180 Proiectul pentru Învăţământul Rural . Cu pas mărunt se-alungă zi de zi. lumânare de o clipă! Ni-e viaţa doar o umbră călătoare. Caliban: You taught me language. savage. I endowed thy purposes With words that made them known: but thy vile* race*. and my profit on it Is I know how to curse: the red plague rid you. stupid (necioplit. tot mereu. TEXT 2. Being capable of all ill! I pitied thee*.Reader Romanian translation (by Ion Vinea) Macbeth: Dar mâine şi iar mâine. abject. a bâigui) brutish coarse. mărginit) shameful and evil. a suporta therefore as a result. Din vorbe-alcătuită şi din zbucium Şi nensemnând nimic. William Shakespeare. ticălos) race neam. sălbatic. taught thee each hour One thing or other: when thou didst not*. mârşav. but wouldst* gabble* like A thing most brutish*. Şi fiecare “ieri” a luminat Nebunilor pe-al morţii drum de colb. Te stinge. scene II) Prospero: Abhorred* slave. For learning* me your language! abhorred detested vehemently print mark made on a surface thee you thou didst not you did not thine / thy your wouldst would gabble to utter words rapidly and indistinctly (a bolborosi. nasty (josnic.4. tagmă thou didst learn you did learn to abide a răbda. The Tempest (Act I. ce-n ceasul lui pe scenă Se grozăveşte şi se tot frământă Şi-n urmă nu mai este auzit. Un biet actor. Spre cel din urmă semn din cartea vremii. Which any print* of goodness will not take. cruel.
Cu tot ce-a moştenit. These our actors. duşi. consistency. avea ceva Ce bunul simţ nu rabdă. like this insubstantial pageant* faded*. We are such stuff As dreams are made on. William Shakespeare. TEXT 2. a se dizolva baseless unfounded (fără bază. când meritai Mai mult decât o temniţă. all which it inherit. As I foretold* you. ţi-am arătat Al vorbei meşteşug. scene I) Prospero: Our revels* are now ended. colour. ca-nchipuită scena-aceasta. pe drept.Reader Romanian translation (by Leon Leviţchi) Prospero: Slugoi scârbavnic. Te-am surghiunit aici. afară doar De-un dram de bunătate! Mi-a fost milă. se vor topi Şi. alcătuire) cloud-capped towers towers whose tops are capped (covered) by clouds yea (archaic.5. The solemn temples. duhuri. toţi. chiar pământul. Yea*. a spune dinainte melted to melt: a se topi. turnuri Cu turlele în nori. temelie) fabric building. Actorii Ţi-am spus. Nici spulber n-au să lase-n urma lor. Leave not a rack* behind. rack a floating cloud Romanian translation (by Leon Leviţchi) Prospero: Serbarea noastră s-a sfârşit. framework (clădire. Scoteai doar mugete. the great globe itself. were all spirits and Are melted* into air. The Tempest (Act IV. când tu. literary) truly. palate mândre. The cloud-capped towers*. Biserici maiestoase. structure. nepricepând Nici tu ce bălmăjeşti. like the baseless* fabric* of this vision. into thin air: And. revels festivitate teatrală pentru curteni foretold to foretell. Deşi-ai fost dăscălit. dar proasta-ţi fire. fiară. M-am străduit sa te deprind cu graiul. În stare de orice. Plămadă suntem precum cea din care Proiectul pentru Învăţământul Rural 181 . indeed pageant splendid public show or ceremony faded to fade: to lose brightness. Caliban: M-ai învăţat vorbi. etc. foretold: a anunţa. dar. au fost. shall dissolve And. and our little life Is rounded with a sleep. the gorgeous palaces. cu singurul folos Că ştiu acum să-njur – dea ciuma-n tine Şi-n limba ce m-ai învăţat. Şi întocmai Ca funigeii viziunii. Te-am învăţat de toate. şi-n văzduh S-au destrămat cu toţii.
they are two so As stiff* twin* compasses are two. But we by a love so much refined. and hands to miss. because it doth* remove* Those things which elemented* it. It leans*. nor sigh-tempests* move. That our selves know not what it is. But trepidation of the spheres. And whisper* to their souls. Thy* soul the fixed foot. Thy firmness makes my circle just*. and make no noise. Dull* sublunary* lovers’ love (Whose soul is sense*) cannot admit Absence. And grows erect*. makes no show To move.6. And makes me end. and hearkens* after it. TEXT 2. Such wilt* thou* be to me. Though greater far. Like gold to aery thinness beat. The breath goes now. to go. but an expansion. Whilst* some of their sad friends do say. as that comes home. where I begun. but doth. John Donne. No tear-floods. Our two souls therefore. Men reckon* what it did and meant. If they be two. Inter-assured of the mind*. who must. Moving of the earth* brings harms and fears. ‘Twere* profanation of our joys To tell the laity* our love. And though it in centre sit. şi scurta viaţă Împrejmuită ni-e de somn. 182 Proiectul pentru Învăţământul Rural .Reader Făcute-s visele. Yet when the other far doth roam*. Though I must go. and some say. obliquely run. which are one. Care less eyes. if the other do. Like the other foot. A Valediction: Forbidding Mourning As virtuous men pass mildly* away*. no: So let us melt*. lips. endure* not yet A breach*. is innocent.
o’erthrow me*. with no result viceroy governor of a territory who acts for and rules in the name of his sovereign (Reason is the viceroy of God in man) untrue disloyal fain (archaic) willingly. but oh. exact Text 2.Reader pass away to die mildly gently. a fi atent la (here: to seek to join. and bend Your force*. blow. to another due*. me should defend. Batter My Heart Batter* my heart. you As yet* but knock. gladly betrothed unto logodit cu to untie a dezlega. Reason your viceroy* in me. That I may* rise. overthrew. hotărât twin îngemănat thy your to roam a hoinări. apply your force due cuvenit. a silui Proiectul pentru Învăţământul Rural 183 . rupture stiff rigid. and seek to mend. a ajunge în poziţie verticală wilt will thou you just corect. to make disappear which elemented it which constituted/founded it inter-assured of the mind we are both assured that our love is primarily the union of our minds to endure to suffer. burn. a fi supus (the speaker urges his beloved to face the separation calmly and quietly) tear-floods. for. overthrown: a nimici. and make me new. Labour* to admit you. untie*. leant a se apleca. and proves weak or untrue*. furtuni de suspine) these are Petrarchan conceits – see the Glossary) ‘twere it were (it would be) the laity those who do not know how strong their love is (from lay: profan. never shall be free.7. or break that knot again. a înrobi. for I Except your enthrall* me. three-personed God*. except you ravish* me. a se înclina to hearken a asculta. and would be loved fain*. imprison me. a subjuga to ravish a răpi. to struggle to no end vainly. breathe. Nor ever chaste. I. to break. John Donne. softly to whisper a şopti whilst while to melt a-şi înmuia firea. precis.: inflexibil. to undergo breach break. sigh-tempests şuvoaie/potop de lacrimi. mirean) moving of the earth earthquake to reckon a gândi. Take me to you. and stand. shine. like an usurped town. a rătăci to lean. ferm. But am betrothed* unto your enemy. Divorce me. datorat to labour to work hard. to no end*. batter to hit or beat someone heavily three-personed God the Trinity as yet până acum that I may in order that I may o’erthrow to overthrow. a înfrânge bend your force concentrate. to long for) to grow erect a se îndrepta. a lua cu sila. therefore subject to change whose soul is sense in which physical presence is essential doth does to remove to take away. Yet dearly I love you. a elibera to enthrall a supune. a presupune dull not intense sublunary: beneath the moon. But is captived. fig.
And the last age should show your heart. Thy beauty shall no more be found. This coyness*. Nor would I love at lower rate. And tear* our pleasure with rough strife* Thorough* the iron gates of life. Thou* by the Indian Ganges’ side Shouldst* rubies* find. But none. yet we will make him run. To His Coy Mistress Had we but* world enough. I would Love you ten years before the Flood*. I think. And yonder* all before us lie Deserts of vast eternity. and on thy* forehead gaze. An age at least to every part.Reader TEXT 2. But thirty thousand to the rest. 184 Proiectul pentru Învăţământul Rural . and time. refuse Till the conversion of the Jews*. like amorous birds of prey. shall sound My echoing song. and pass our long love’s day. Nor. Rather at once our devour Than languish* in his slow-chapt power*. Thus. I by the tide Of Humber* would complain. Andrew Marvell. My vegetable* love should grow Vaster than empires and more slow. Let us roll all our strength and all Our sweetness up into one ball. were no crime. Lady.8. Now let us sport* while we may. And your quaint* honor turn to dust. Now therefore. in thy marble vault*. But at my back I always hear Time’s winged* chariot* hurrying near. An hundred years should go to praise Thine* eyes. And into ashes all my lust*: The grave*’s a fine and private place. you deserve this state*. And while thy willing* soul transpires At every pore with instant fires*. And now. while the youthful* hue* Sits on thy skin like morning dew*. And you should. We would sit down. though we cannot make our sun Stand still. For. then worms shall try That long-preserved virginity. and think which way To talk. Two hundred to adore each breast. if you please. do there embrace. Lady.
a lua cu de-a sila strife violent struggle thorough through Proiectul pentru Învăţământul Rural 185 . tineresc hue culoare. groapă youthful de tinereţe. fast chariot ceremonial carriage (car) yonder (poetic) over there vault burial chamber (cavou) quaint odd. peculiar. a lâncezi. inappropriate (nefiresc) ashes cenuşă lust strong sexual desire (dorinţă. which. a se plictisi slow-chapt power the power of its slowly devouring jaws to tear (tore. sfială. indicates her “willing soul” to sport a petrece. thy your state ceremonial treatment winged having wings. a se veseli to languish a se ofili. inclined instant fires the flush in her face. fig. modestie thou you shouldst should ruby rubin Humber an estuary in the north-east of England the Flood Potopul the conversion of the Jews considered to be one of the events at the end of history vegetable growing slowly as a plant thine. patimă) grave mormânt.: swift. nuanţă. tentă dew rouă willing favourably disposed. torn) a smulge. in spite of her coyness.Reader had we but… if only we had coyness timiditate.
chide*. Ere* half my days. to endue: a înzestra (Inward ripeness. they serve him best. who best Bear his mild yoke*. if I have grace to use it so. which endues some more timely-happy spirits. to prevent That murmur*.2. a strict overseer TEXT 3.” 186 Proiectul pentru Învăţământul Rural . the subtle* thief of youth. soon replies: “God doth not need Either man's work or his own gifts. That some more timely*-happy* spirits endueth*. or soon or slow. lest he. destiny mean humble. rush bud mugur. Toward which time leads me. though my soul more bent* To serve therewith* my maker. That I to manhood* am arrived so near. '”Doth God exact* day-labour. Yet be it less or more. speed. Stolen on his wing my three and twentieth year*! My hasting days fly on with full career*. It shall be still* in strictest measure even To that same lot*. John Milton. insignificant ever eternity task-master the one who imposes tasks. light denied*?” I fondly* ask. All is. but Patience. John Milton. hath has subtle difficult to perceive or describe because fine or delicate my three and twentieth year my twenty-third year career swift movement ahead. lucky endueth endues. Sonnet XVII When I consider how my light* is spent*. But my late spring no bud* or blossom showeth*. obscure. in this dark world and wide.e to a lesser extent) still always lot fortune. Perhaps my semblance* might deceive* the truth. his state Is kingly – thousands at his bidding* speed* And post* o'er land and ocean without rest*: They also serve who only stand and wait.Reader UNIT 3 THE WORKS OF JOHN MILTON TEXT 3. returning. And inward ripeness* doth* much less appear. appears [in me] much less – i. opportune happy fortunate. Sonnet VII How soon hath* time. vârstă adultă ripeness maturitate doth does timely occuring atjust the right moment. And that one talent* which is death to hide Lodged with me useless*. As ever* in my great task-master's* eye. however mean* or high. and present My true account. and the will of heaven. boboc showeth shows (My late spring shows no bud or blossom) semblance outward appearance to deceive to mislead (a înşela) manhood bărbăţie.1.
Reader
light eyesight spent used up, exhausted (When I think that my eyesight is gone, before I have even reached the middle of my lifetime… I fondly ask…) ere (poetic) before talent an allusion to the biblical parable of the talents in Matthew (25: 14-30 – parabola talanţilor). Its moral is that a gift from God must not be stored and left unused, but must be multiplied. Milton felt that his “talent” – his gift for poetry – lay useless in darkness, as he had not begun the great epic poem he intended to write. lodged with me useless [talantul/talentul] mi-a fost încredinţat în zadar bent to bend, bent: to incline therewith with that lest he… chide să nu mă dojenească to exact to demand as a right light denied if he denies me (deprives me of) eyesight fondly foolishly (cu naivitate) murmur complaint who…bear his mild yoke cei care-I îndură jugul blând (allusion to Matthew, 11: 30) at his bidding la porunca sa to speed (sped) to hurry, to hasten to post to travel with speed o’er over rest odihnă, repaus
TEXT 3.3. John Milton, Paradise Lost .
hail an exclamation of greeting thy your hath has the Almighty Atotputernicul hence (archaic) from here; away (will not drive us hence: nu ne va alunga de aici) to reign a domni, a stăpâni secure liniştit, în siguranţă
TEXT 3.4. John Milton, Paradise Lost (Book III)
[God is speaking to His Son, foreseeing man’s fall] Whose fault? Whose but his own? Ingrate, he [i.e. man] had of me All he could have; I made him just and right, Sufficient to have stood*, though free to fall. Such I created all the Ethereal* Powers And Spirits, both them who stood and them who failed; Freely they stood who stood, and fell who fell. …. I formed them free, and free they must remain Till* they enthrall* themselves: I else* must change Their nature, and revoke the high decree
Proiectul pentru Învăţământul Rural
187
Reader.
stood to stand, stood: a rămâne, a rezista, a se menţine într-o anumită poziţie ethereal celestial, spiritual til until to enthrall to enslave else altfel, altminteri ordained to ordain: to order, to establish, to predestine irrevocably the first sort the angels who had fallen to excel to increase
TEXT 3.5. John Milton, Paradise Lost (Book III)
Not free, what proof could they have given sincere Of true allegiance*, constant faith, or love, Where only what they needs must* do appeared, Not what they would*? What praise could they receive, What pleasure I, from such obedience paid, When Will and Reason (Reason is also Choice), Useless and vain, of freedom both despoiled, Made passive both, had served Necessity, Not me?
allegiance loyalty needs must trebuie neapărat not what they would nu ceea ce ar vrea / ar voi despoiled (of freedom) lipsit (de libertate)
TEXT 3.6. John Milton, Paradise Lost (Book IV)* 188
Proiectul pentru Învăţământul Rural
Reader ‘sdained subjection*, and thought one step higher Would set me highest, and in a moment quit* The debt immense of endless gratitude. ………. O sounds of deadly hate have pierced* so deep; Which would but lead me to a worse relapse* And heavier fall: ………. So farewell hope, and with hope farewell fear, Farewell remorse! All good to me is lost; Evil, be thou* my good; by thee* at least
Proiectul pentru Învăţământul Rural
189
Reader
Divided empire* with heaven's king I hold By thee, and more than half perhaps will govern; As man ere long, and this new world shall know.
grieved mâhnit, întristat full-blazing în plină strălucire/splendoare meridian the peak, zenith; noon much revolving with many thoughts revolving in his mind sighs suspine nd look’st look (2 person sg.) beams rays of light warring…against războindu-se/purtând război cu…, matchless unequalled, incomparable wherefore why return recompensă, răsplată eminence position of superiority, distinction, high rank upbraided to upbraid: a mustra, a dojeni his service serving him (i.e. God) to afford him praise a-i aduce/oferi laudă due cuvenit, datorat wrought but malice worked/produced only evil intent, the desire to do harm I ‘sdained [disdained] subjection: am dispreţuit supunerea to quit a părăsi, a abandona I had stood I would have stood unshaken neclintit miserable unhappy, depressed (nenorocit, nefericit) to relent to show pity, to become less severe or cruel repentance căinţă, părere de rău pardon iertare sumbission supunere (to submit: a se supune) vaunt laudă, preamărire de sine boasting to boast: a se lăuda to subdue to defeat and gain control (a supune, a subjuga) ay me (archaic) an expression of unhappiness (vai mie!) to abide a suporta (consecinţele) to groan a geme, a se văita, a suspina, a ofta to adore to worship (a preamări, a se închina la) say să zicem; închipuindu-mi că feigned prefăcut, simulat to recant a retracta, a se dezice de, a se lepăda de vow jurământ, legământ, făgăduială void empty pierced to pierce: a pătrunde relapse recădere thou you by thee by you empire stăpânire, putere
TEXT 3.7. John Milton, Paradise Lost (Book VII)
In his hand He took centre hung.
bounds limits, margins brooding covering perfectly to outspread a întinde, a desfăşura to purge a curăţi, a limpezi, a spăla, a purifica tartareous of the underworld, infernal (from Tartarus: Hades) dregs impurităţi, drojdii, rămăşiţe conglobed formed into a ball or a globe like asemănător; de aceeaşi natură several mai mulţi/multe; diferiţi, diferite to dispart a distribui spun to spin, spun: a ţese, a urzi
190
Proiectul pentru Învăţământul Rural
for this fair* Earth I see. Them nothing. these and many more Causes import* your need of this fair fruit. Goddess humane. ye you (pl. that seem so clear Yet are but dim*. yet both live And life more perfect have attained than Fate Meant me. Shall that be shut to Man which to the beast Is open? 2. modest thereof din ace(a)sta. then. Queen of the Universe. How should ye? by the fruit? it gives you life To knowledge. producing every kind. a se încumeta forbid forbidden low humble. What can your knowledge hurt him. your eyes. do not believe Those rigid threats of death. in the day Ye eat thereof*. by venturing* higher than my lot. if all be his? Or is it envy? and can envy dwell In heavenly breasts? These. to emerge fair beautiful to import a însemna to reach a întinde mâna. that Man may not become As they. reach* then. as they know. And what are Gods. by the Threatener? look on me. Me who have touched and tasted. was this forbid*? Why but to awe? Why but to keep ye low* and ignorant. Paradise Lost (Book IX) 1. Why.Reader TEXT 3. participating* godlike* food? The Gods are first. John Milton. His worshippers? He knows that. din el/ea (eat from the Tree of Knowledge) dim having weak or indistinct vision participating sharing godlike divine to proceed (from) to originate. and that advantage use On our belief.8. Knowing both good and evil. and ye shall be like Gods. shall perfectly be then Opened and cleared. a apuca Proiectul pentru Învăţământul Rural 191 . and freely taste. Warmed by the Sun. ye* shall not die.) venturing to venture: a îndrăzni. or this tree Impart against his will. I question it. 4. that all from them proceeds*. 3.
Reader TEXT 3. so late* their happy seat*. literary): to look at so late până nu demult seat locaş. They. Paradise Lost (Book XII) They. care arde natural firesc 192 Proiectul pentru Învăţământul Rural . Through Eden took their solitary way. but wiped them soon. looking back. beheld to behold. hand in hand. beheld (archaic. with wandering steps and slow. John Milton. where to choose Their place of rest. all the eastern side beheld* Of Paradise. and Providence their guide. The world was all before them.9. Waved over by that flaming brand*. sălaş flaming brand sabia de foc/flăcări thronged (with dreadful faces) plină (de chipuri de temut) fiery în flăcări. the gate With dreadful faces thronged* and fiery* arms: Some natural* tears they dropped.
you shall always knock at the door before you come in. dine in my dressing room when I’m out of humour*. so far trifle fleac. and as well bred as if we were not married at all. to write and receive letters. Mirabell: Have you any more conditions to offer? Hitherto* your demands are pretty reasonable. To have my closet* inviolate*. without interrogatories or wry faces* on your part. Come to dinner when I please. Let us never visit together. reserved well-bred binecrescut. nor go to Hyde Park together the first Sunday in a new chariot*. tender folks people chariot trăsură to provoke eyes and whispers to attract attention and provoke gossip (bârfă) strange distant. let us be as strange as if we had been married a great while*. nor go to a play together. like my Lady Faddler and Sir Francis. manierat. and ashamed of one another ever after. Millamant: Trifles* – as liberty to pay and receive visits* to and from whom I please.1. which you must never presume* to approach without first asking leave*. politicos a great while a long time hitherto until this time. as if we were proud of one another the first week. bagatelă to pay…visits a face vizite wry faces grimase (to make wry faces: a strâmba din nas) wit a person who has the ability to say things that are both clever and amusing relation relative (rudă) out of humour prost dispus. and then never be seen there together again. don’t let us be familiar or fond*. wherever I am. William Congreve. to wear what I please. because they may be your relations*. without giving a reason. and choose conversation with regard only to my own taste. or to be intimate with fools. nor kiss before folks*. to provoke eyes and whispers*. abătut closet a small private room inviolate in which nobody intrudes sole only. (…) fond affectionate.Reader UNIT 4 THE RESTORATION AND THE AUGUSTAN AGE TEXT 4. to have no obligation upon me to converse with wits* that I don’t like. And lastly. but let us be very strange* and well bred*. because they are your acquaintance. The Way of the World Millamant: (…) Good Mirabell. to be sole* empress of my tea table. the only oneto presume to dare (a îndrăzni) to ask leave to ask permission Proiectul pentru Învăţământul Rural 193 .
a livra. descendenţi to supply a oferi. pungaş. and the mind can only repose on the stability of truth. His characters are not modified by the customs of particular places. but the pleasures of sudden wonder are soon exhausted. by the peculiarities* of studies or professions. potlogar villain nemernic. The Preface to Shakespeare Nothing can please many.Reader TEXT 4. successfully irregular neuniform.2. and the fineness* of a stroke* that separates the head from the body. Shakespeare is. at least above all modern writers. secătură. escroc. fantezist awhile for a short period satiety the state of being too much filled or satisfied peculiarity particularitate but only transient temporary. or a knave* without using any of those opprobrious* terms! (…) There is (…) a vast difference betwixt* the slovenly* butchering* of a man. the poet of nature. above all writers. perfecţiune stroke lovitură TEXT 4. the poet that holds up to his readers a faithful mirror of manners and of life. and therefore few only can judge how nearly* they are copied. cap sec knave escroc. unpractised by the rest of the world. manners moravuri nearly faithfully. dobitoc. and please long. ticălos. variabil fanciful capricios. a blockhead*. a furniza 194 Proiectul pentru Învăţământul Rural . Samuel Johnson. The irregular* combinations of fanciful* invention may delight awhile* by that novelty of which the common satiety* of life sends us all in quest. rogue pungaş. lichea wittily in a witty manner (cu mult spirit) blockhead nătâng. transitory (trecător) progeny urmaşi. Particular manners* may be known to few. which can operate but* upon small numbers. His persons act and speak by the influence of those general passions and principles by which all minds are agitated and the whole system of life is continued in motion. A Discourse Concerning the Original and Progress of Satire How easy is it to call rogue* and villain*. nemernic opprobrious insulting betwixt between slovenly neglijent butchering căsăpire.3. and that wittily*! But how hard to make a man appear a fool. but just representations of general nature. măcelărire fineness eleganţă. John Dryden. such as the world will always supply* and observation will always find. In the writings of other poets a character is too often an individual: in those of Shakespeare it is commonly a species. and leaves it standing in its place. or by the accidents of transient* fashions or temporary opinions: they are the genuine progeny* of common humanity.
as the more acute wits* of Europe have done. The learning of this people is very defective. And as to ideas. Jonathan Swift. whereof* in Europe we can have no conception.. to the speedy* determination* of civil and criminal causes. unnecessary scruple. He confined* the knowledge of governing within very narrow bounds*: to common sense and reason. yet he would rather lose half his kingdom than be privy* to such a secret (…). and esteem. let slip* an opportunity put into his hands that would have made him absolute master of the lives. and the fortunes of his people. where an enemy or some rival nation were not in case. of strong parts. poetry. endued* with admirable talents for government. He professed both to abominate* and despise all mystery*. and profound learning. it gave him (directly contrary to my intention) a very mean opinion* of our understandings. so that among us would be little esteemed. history. the liberties. great wisdom.Reader TEXT 4. For I remember very well. to justice and lenity*. refinement and intrigue. and mathematics. love. and almost adored by his subjects. wherein* they must be allowed to excel. He was amazed how so impotent and grovelling* an insect as I (these were his expressions) could entertain* such inhuman ideas. he protested* that although few things delighted him so much as new discoveries in art or in nature. abstractions. with some other obvious topics* which are not worth considering. in a discourse one day with the King. when I happened to say there were several thousand books among us written upon the art of government. But the last of these is wholly applied to what may be useful in life. to the improvement of agriculture and all mechanical arts*. consisting only in morality. I could never drive* the least conception into their heads. chapter VII) The King was struck with horror* at the description I had given of those terrible engines* and the proposal I had made. and in so familiar a manner as to appear wholly unmoved at all the scenes of blood and desolation which I had painted as the common effects of those destructive machines (…) As for himself. should from a nice*. Gulliver’s Travels (Book II. and transcendentals*. (…) I take* this defect among them to have risen from their ignorance. they not having hitherto reduced politics into a science. entities. A strange effect of narrow principles and short views*! that a prince possessed of every quality which procures veneration. He could not tell what I meant by secrets of state. Proiectul pentru Învăţământul Rural 195 . either in a prince or a minister.4.
and the reason usually assigned* was the odiousness* of their own shapes. and our actions. greu de mulţumit) whereof of which to let slip (an opportunity) a lăsa să-i scape. driven) an idea into one’s head a băga în cap. which all could see in the rest. and mischievous* in disposition. as in fear or humility (a se târî) to entertain (an idea) a nutri (o idee) to protest a declara. (…) As to learning. but not in themselves.5. a asigura. government. and when part of these stones are fixed in the earth. a încredinţa to be privy to a fi făcut părtaş la. from the representation I had given him of our lives. whose employment was to lick* his masters feet and posteriors. he found as near a resemblance in the disposition* of our minds. He had heard indeed some curious Houyhnhnms observe that in most herds* there was a sort of ruling* Yahoo (as among us there is generally some leading or principal stag* in a park*) who was always more deformed in body. a face să priceapă TEXT 4. VII) He observed that I agreed* in every feature of my body with other Yahoos. than any of the rest. fall together by ears*. manufactures*. to dislike intensely mystery urzeli tainice to confine to limit. That this leader had usually a favorite as like himself as he could get. boundary (hotar) lenity tolerance (îngăduinţă) speedy quick. and hide them by heaps* in their kennels*. a scăpa din mână (o ocazie) I take I think. to restrict bound limit. and therefore* to protect himself. Ch. except where it was to my real disadvantage in point of* strength. without delay determination rezolvare. if (said he) you throw among five Yahoos as much food as would be sufficient for fifty. in some fields of his country. Jonathan Swift. for fear their comrades should find out their treasure. they will dig with their claws for whole days to get them out. as sometimes happens. each single one impatient* to have all to itself. For he only meant to observe what parity* there was in our natures. and drive the female Yahoos to his kennel. and that the dissensions of those brutes in his country were owing to the same cause with ours.Reader struck with horror cuprins de groază engines maşini (piese de artilerie) grovelling to grovel: to crawl. arts. subiect ear of corn spic de grâu blade of grass fir de iarbă spot of ground petec de pământ wherein in which mechanical arts meşteşuguri transcendentals categorii metafizice to drive (drove. excessively particular about details (pretenţios. încheiere (a unei cauze juridice) topic temă. I suppose acute wits spirite luminate (acute: pătrunzător. and some other particulars* where Nature had no part*. a i se încredinţa (e. they will instead of eating peaceably. (…) But he now found he had been mistaken. so. our manners. and the like. for which he was known and then rewarded with a piece of ass’s flesh*. there are certain shining stones of several colors. perspicace) mean opinion părere nefavorabilă to abominate to detest. Gulliver’s Travels (Book IV. un secret) short views concepţii înguste endued înzestrat nice fastidious.g. a fi iniţiat în. He said the Yahoos were known to hate one another more than they did any different species of animals. my master confessed he could find little or no resemblance between the Yahoos of that country and those in ours. and activity. (…) That. This favorite is hated by the whole herd. speed. but still looking round with great caution. the shortness of my claws*. keeps always near the 196 Proiectul pentru Învăţământul Rural . and carry them away. whereof the Yahoos are violently fond*. For. as I had described them.
Reader
person of his leader. (…) But how far this might be applicable to our courts and favorites, and ministers of state, my master said I could best determine. (…), and wanted* neither food nor water; nor did the servants (…). His Honor had farther back, and with a counterfeit* show of fear, run off into some convenient place where she knew the male would follow her. At other times, if a female stranger came along them, three or four of her own sex would get about her, and stare* and chatter*, and grin*, and smell her all over; and then turn off with gestures that seemed to express contempt and disdain.
I agreed I corresponded in point of în ceea ce priveşte claws gheare particulars details no part no role, no contribution near close disposition predispoziţie, înclinare to assign (a reason) to give, to attribute (a reason) odiousness hidoşenie they will fall together by ears se vor lua la bătaie impatient zorit, grăbit whereof of which to be fond of a fi amator, a-i plăcea mult by heaps în grămezi kennel culcuş, vizuină manufacture meşteşuguri parity corespondenţă, asemănare, analogie herd cireadă ruling dominant, conducător stag cerb park parc cinegetic mischievous răutăcios, rău intenţionat, pus pe rele to lick a linge ass’s flesh carne de măgar therefore that is why likewise also unaccountable inexplicable a fancy would sometimes take a Yahoo din când în când i se năzare câte unui Yahoo to howl a urla to groan a geme to spurn (away) a îndepărta, a refuza, a alunga to want a duce lipsă de to ail a durea, a deranja to set (somebody) to work a pune la muncă infallibly negreşit he would come to himself îşi revenea, îşi venea în fire partiality părtinire, slăbiciune, înclinaţie my own kind cei de-un neam cu mine seeds seminţe (fig.: izvor, cauză) spleen ipohondrie, melancolie seizes on se abate asupra, îi cuprinde pe bank movilă bush tufiş to gaze to look long and fixedly antic grotesque offensive unpleasant, disgusting counterfeit simulated; a counterfeit show of fear: prefăcânduse că îi este teamă to stare a se holba to chatter a flecări to grin a rânji
Proiectul pentru Învăţământul Rural
197
Reader
TEXT 4.6. Jonathan Swift, Gulliver’s Travels (Book IV, chapter VIII)
As these noble Houyhnhnms are endowed by Nature with a general disposition to all virtues, and have no conceptions or ideas of what is evil in a rational creature; so their grand* maxim is to cultivate reason, and to be wholly governed by it. (…)ows* on him one of their own colts, and then go together* a second time, until the mother necessary actionsling*, or discontent*. Temperance*, industry*, exercise*, and cleanliness* are the lessons equally enjoined* to the young ones of both sexes; and my master thought it monstrous in us to give the females a different kind of education from the males, except in some articles of domestic management (…).
198
Proiectul pentru Învăţământul Rural
Reader
grand principal, capital, supreme remote distant, far away looks upon himself considers himself civility amabilitate, curtenie, politeţe, bună creştere ceremony protocol, etichetă fondness duioşie, afecţiune, dragoste colt, foal mânz to proceed (from) to come from, to originate in (a izvorî) issue odrasle, progenituri, urmaşi they will have that they say that matron mamă de familie to acompany (with) a se împreuna casualty accident, nenorocire, năpastă seldom rarely the like accident o năpastă de felul acesta to befall (befell, befallen) a se abate asupra is past bearing nu mai poate zămisli to bestow to give, to offer they go together se împreunează pregnant grea, însărcinată caution măsură de prevedere overburdened with numbers overpopulated upon this article în această privinţă, la acest capitol to produce a zămisli domestic servitor present dar, cadou jointure averea cuvenită soţiei după moartea soţului settlement contract whereby by which determination decision violation necinstire unchastity infidelitate quarreling ceartă discontent nemulţumire temperance cumpătare industry hărnicie exercise exerciţii fizice cleanliness curăţenie enjoined imposed, prescribed
Proiectul pentru Învăţământul Rural
199
Reader
UNIT 5 THE AGE OF THE ENLIGHTENMENT: THE RISE OF THE NOVEL
TEXT 5.1. Daniel Defoe, Robinson Crusoe like a child. (…).* to me that these words were to me. Why else* should they be directed in such a manner, just at the moment when I was mourning over my condition as one forsaken of* God and Man? (…) From this moment I began to conclude in my mind that it was possible for me to be more happy in this forsaken, solitary condition than it was probable I should have ever been I any other particular state in the world; and with this thought I was going to give thanks to God for bringing me to this place.
sensibly în mod apreciabil, destul de mult wicked păcătos cursed nelegiuit, ticălos abominable odios to alter to change gust răbufnire, explozie, izbucnire anguish pain, misery, agony to break out a se dezlănţui, a izbucni on a sudden suddenly, abruptly bars gratii, zăbrele bolt zăvor redemption mântuire, izbăvire, salvare midst middle composure linişte, calm, cumpăt, stăpânire de sine to wring (wrung) a frânge; to wring one’s hands: a-şi frânge mâinile de durere comfort mângâiere, consolare, încurajare thee you to forsake (forsook, forsaken) to abandon to occur (to someone) a-i veni în minte, a-i trece prin gând why else? altfel de ce? forsaken of forsaken by
200
Proiectul pentru Învăţământul Rural
No joy at a thing of so mean a nature* was ever equal to mine when I found I had made an earthen pot that would bear the fire. and. vas to miscarry a da greş design intenţie pot vas. In the morning I had three very good – I will not say handsome* – pipkins and two other earthen pots as hard burned as could be desired (…). which it did admirably well. yet I made several smaller things with better success – such as little round pots. in a word how. such as the potters* burn in. I found a broken piece of one of my earthenware vessels* in the fire burned as hard as a stone. I could not make above* two large earthen* ugly things – I cannot call them jars* – in about two months’ labour. after having laboured hard to find the clay. and placed my firewood* all round it. when I went to put it out* after I had done with it. and observed that they did not crack at all*. But all this would not answer my end*. to bring it home and work it. It happened after some time. misshapen*. and I had hardly patience to stay till they were cold before I set one upon the fire again with some water in it to boil me some meat. I was agreeably surprised to see it. Robinson Crusoe It would make the reader pity* me. de pământ jar oală. to tell how many awkward* ways I took to raise this paste*. This set me to studying how to order* my fire.Reader TEXT 5. When I saw them clear red. I had no notion of a kiln*. argilă stiff tare weight to bear its own weight: să reziste la propria greutate to crack a crăpa set out too hastily expuse prea devreme with only removing doar ce le-am mişcat to dig. dug a săpa to temper a amesteca. and how many fell out*. making a pretty large fire for cooking my meat. being set out too hastily*. a frământa. and pipkins*. oală Proiectul pentru Învăţământul Rural 201 . and the heat of the sun baked* them strangely hard*. which none of these could do. to temper* it. and how many fell in pieces with only removing* as well before as after they were dried. what odd. to pity a căina awkward incomod. dificil paste cocă misshapen diform fell in to fall. one upon another. flat dishes*. a se desprinde clay lut. though I had some lead to do it with. I plied the fire* with fresh fuel round the outside and upon the top till I saw the pots in the inside red-hot quite through*. and said to myself that certainly they might be made to burn whole if they would burn broken. which was to get an earthen pot to hold what was liquid. and any things my hand turned to*. and bear* the fire. I let them stand in that heat about five or six hours(…). to dig* it.2. a cădea fell out to fall. pitchers*. or rather laugh at me. fallen) in: a se prăbuşi. (fell. or glazing* them with lead*. ugly things I made. fallen) out: a se desface. (fell. with a great heap of embers* under them. how many of them fell in*. Daniel Defoe. but I placed three large pipkins and two or three pots in a pile. and red as a tile*.. the clay* not being stiff* enough to bear its own weight*. anevoios. a prelucra above more than earthen de lut. so as to make it burn me some pots. (…) Though I miscarried* so much in my design* for large pots*. how many cracked* by the over-violent heat of the sun.
intenţie to bear (bore. unanimated style of a person relating difficulties and dangers surmounted*. and before I knew what was the matter. farfurie pitcher ulcior ulcea pipkin gavanos to turn to a se apuca de lucru. This was a good fortune. and of so much honour too. placă de ceramică how to order the fire cum să potrivesc focul kiln cuptor potter olar to glaze a smălţui lead plumb firewood lemn de foc embers jăratec I plied the fire am întreţinut focul quite through cu totul. that I shall never be able to think of any body in the world but him! Presumption*! you will say. I must own* to you. apogeu distress nefericire.3.] This letter. în întregime at all deloc handsome frumos. crept.4. doubtful lively vivid (însufleţit. will ye* not in some 202 Proiectul pentru Învăţământul Rural . I am quite overcome*. the womb of fate: incertitudinea sorţii dry sec. plin de viaţă) height culme. so much affection. Samuel Richardson. has greatly affected me. and tender years*. durere. She seems taken by surprise by her own feelings. I beseech* you. Pamela [Pamela receives a letter from Mr. a depăşi) TEXT 5. than the dry*. like a thief. to my grief*. born) a rezista. the mind tortured by the pangs* of uncertainty (the events then hidden in the womb* of fate). I had no reason to expect. For here plainly* does he confess his great value for me. I imagine. however. my dear father. before. Much more lively* and affecting must be the style of those who write in the height* of a present distress*. but with what may be called instantaneous descriptions and reflections (…). arătos a thing of so mean a nature un lucru atât de mărunt TEXT 5. to find him capable of so much openness. nay*. when I expected some new plot*. chinuri womb pântece. a ţine la to put out (the fire) a stinge (focul) earthenware vessels vase de lut tile ţiglă. but it has crept*. and accounts for his rigorous* behaviour to me. dubious uncertain. Samuel Richardson. it looked like love. narrative. O my unguarded* youth. […] O my dear parents. Preface to Clarissa All the letters are written while the hearts of the writers must be supposed to be wholly engaged in their subjects (the events at the time dubious*): so that they abound not only with critical situations. but now. forgive me! but I found. that my heart was too partial* in his favour. neutru to surmount to overcome (a birui. B_. can be. upon me. […] Forgive. nenorocire pangs mâhnire. a se pune pe lucru to bake a coace strangely hard neobişnuit de tare end ţel. and so it is: but love. is not a voluntary thing – Love. nor when it began. punct culminant. a învinge. forgive your poor daughter! How am I grieved* to find this trial so severe* upon me. But to be sure*.Reader dish blid. did I say! […] I know not how it came. in which he confesses his affection for her. scop.
mâhnit severe trial încercare grea unguarded imprudent tender years vârstă fragedă ye you (pl. întristat. burlesque itself may be sometimes admitted. mai mult chiar to overcome a depăşi. before summons* came. when I get home. unless* in writings of the Proiectul pentru Învăţământul Rural 203 . I could have no notion of what it was to be so affected! But prayer.e. O my treacherous*. for giving up so weakly. so in the other they are light* and ridiculous: it differs in its characters by introducing persons of inferior rank. containing a much larger circle of incidents. îndrăzneală crept to creep (crept): a se strecura. But though we have sometimes admitted this in our diction. a se furişa to beseech (besought) a ruga cu stăruinţă. and consequently. In the diction. and to one too. and therefore*. torn) out a smulge. or tear* it out of my writing. It differs from the serious romance in its fable* and action. in this. treacherous heart! How couldst thou serve* me thus! And give no notice* to me of the mischiefs* thou wert* about to bring upon me! How couldst thou thus inconsiderately* give thyself* up to the proud invader. differing from comedy.] plot uneltire.5. who had used me so hardly. mâhnire partial to având o slăbiciune pentru nay (literary) ba mai mult. Yet.my heart] fully deserve to suffer summons chemare. for there it is never properly introduced. and resignation to the Divine Will.) couldst thou could you serve how couldst thou serve me thus? Cum ai putut să te porţi astfel? notice to give notice: a preveni. în mod clar rigorous aspru. a înştiinţa mischief neajuns. a implora grieved amărât. and introducing a greater variety of characters. whereas the grave romance sets the highest* before us: lastly. only dangerous attacks! After all. necaz wert were inconsiderately (în mod) nesocotit. intrigă plainly în mod deschis. a comic romance* is a comic epic poem* in prose.) treacherous trădător (adj. I must either not show you this confession of my weakness. of inferior manners. as the serious epic from tragedy: its action being more extended and comprehensive*. and the benefits of your good lesson and examples. Henry Fielding. I think. a copleşi to be sure cu siguranţă to own a mărturisi presumption cutezanţă. sever grief durere. [Memorandum*. în consecinţă to tear (tore. a rupe memorandum notă. without ever consulting thy poor mistress* in the least*! But thy punishment will be the first and the greatest: and well. Joseph Andrews (Preface) Now. will enable me to get over this heavy trial. and when likewise* thou hadst* so well maintained thy post* against the most violent and avowed*. nicidecum traitor trădător (noun) deservest well …deservest thou to smart: you [i. we have carefully excluded it from our sentiments and characters. I hope. perfidious traitor*! deservest* thou to smart. in its sentiments and diction*. by preserving the ludicrous* instead of the sublime. însemnare TEXT 5. nechibzuit thyself yourself thy poor mistress biata ta stăpână (not) in the least câtuşi de puţin. as I thought. of which many instances will occur in these works […]. that as in the one these are grave and solemn. avertizare likewise de asemenea hadst (you) had thou hadst so well maintained thy post you put up resistance successfully avowed făţiş therefore aşadar.Reader measure excuse me? I never before knew. thy whole self. to consider of this.
though. that affectation doth* not imply an absolute negation of those qualities which are affected. yet it sits less awkwardly* on him than on the avaricious man. affectation proceeds from one of these two causes. and where our delight. is more surprising. And though these two causes are often confounded (for there is some difficulty in distinguishing them). in order to purchase* applause. From the discovery of this affectation arises the Ridiculous. no two species of writing can differ more widely than the comic and the burlesque. for as the latter is ever* the exhibition* of what is monstrous and unnatural. where we shall find the true excellence of the former to consist in the exactest copying of nature. if we examine it. in so much that a judicious eye instantly rejects anything outré*. for the Monstrous is much easier to paint than describe. vanity or hypocrisy: for as vanity puts us on affecting false characters*. to the degree he would be thought to have it. […] Now. 204 Proiectul pentru Învăţământul Rural . by concealing* our vices under an appearance of their opposite virtues. Now. so in the former we should ever confine* ourselves strictly to nature. for though the vain man is not what he would appear. yet when it comes from vanity only. who is the very reverse of what he would seem to be. […] Let us examine the works of a comic history painter. so they are as clearly distinct in their operations: for indeed. as in the former the painter seems to have the advantage. that. so hypocrisy sets us on an endeavour to avoid censure*. and consequently more ridiculous. which always strikes* the reader with surprise and pleasure. arises from the surprising absurdity. and in the same manner the comic writer and painter correlate to each other. from the just* imitation of which will flow all the pleasure we can this way convey to a sensible* reader. as it hath not that violent repugnancy* of nature to struggle with. with those performances which the Italians call Caricatura. therefore. […] The only source of the true Ridiculous (as it appears to me) is affectation. or e converso*. Indeed. as they proceed* from very different motives. and all distortions and exaggerations whatever are within its proper province*. it be nearly allied to deceit*. as in appropriating the manners of the highest to the lowest*. Burlesque is in writing. any liberty which the painter hath* taken with the features of that alma mater*. which this is not intended to be. or hath not the virtue he affects. for to discover any one to be the exact reverse of what he affects. the affectation of liberality* in a vain* man differs visibly from the same affectation in the avaricious. than to find him a little deficient in the quality he desires the reputation of. when it proceeds from hypocrisy. not men. which that of the hypocrite hath. yet. whereas in the Caricatura we allow all licence* – its aim is to exhibit monsters. And here I shall observe. and the Ridiculous to describe than paint. what Caricatura is in painting. It may be likewise noted. and. than when from vanity. and that in a higher and stronger degree when the affectation arises from hypocrisy. it partakes* of the nature of ostentation: for instance.Reader burlesque kind. the affectation which arises from vanity is nearer to truth than the other. so it is in the latter infinitely on the side of the writer.
or lameness* endeavours to display* agility. but affectation appears to me the only true source of the Ridiculous. but when ugliness aims at the applause* of beauty. intrigă light uşor highest sets the highest before us aduce în faţa ochilor pe cei de rang superior diction stil ludicrous grotesc unless except ever always exhibition display (expunere) appropriating the manners of the highest to the lowest atribuirea obiceiurilor din lumea bună unor oameni din popor e converso (Italian)and viceversa to confine oneself to a se limita la just faithful. The poet carries this very far: None are for being what they are in fault. of our pity. sferă affecting false characters pretending to be in a way that one is not. / Ci de-a nu fi ceea ce vrea să pară. comic romance roman comic comic epic poem poem eroicomic comprehensive cuprinzător fable subiect. […] Great vices are the proper objects of our detestation. smaller faults. it is then that these unfortunate circumstances. şchiopătat to display to show to tend a tinde mirth laughter thought the lines quoted by Fielding are from Alexander Pope’s Essay on Criticism (1711): “Nimeni nu este vinovat de a fi ceea ce e. putting on a flattering mask to purchase to obtain censure so hypocrisy sets us on an endeavour to avoid censure tot astfel ipocrizia ne îndeamnă/ne face să ne străduim a evita critica to conceal to hide to proceed from to come/to emerge from repugnancy incompatibility. face parte din liberality generosity (mărinimie.Reader […] Much less are natural imperfections the objects of derision. exact sensible endowed with common sense (cu judecată.” Proiectul pentru Învăţământul Rural 205 . fig. contradiction doth does deceit înşelătorie it partakes of se înrudeşte cu.: the primary source licence liberty province domeniu. it sits less awkwardly on him than: îi şade mai puţin rău decât strikes the reader with surprise and pleasure îi oferă cititorului plăcerea surprizei applause when ugliness aims at the applause of beauty: când urâtul/urâţenia aspiră la aplauzele meritate de frumuseţe lameness şchiopătare. But for not being what they would be thought*. cu bun simţ) outré (French) exaggerated hath has alma mater (Latin) the nourishing mother. tend* only to raise our mirth*. cu stângăcie. which at first moved our compassion. dărnicie) vain vanitos awkwardly stângaci.
the ungracious* Duchess has pelted* me with a set of as pitiful* misadventures* and cross* accidents as ever small HERO sustained. brought forth* into this scurvy* and disastrous world of ours. rămăşiţe not but the planet is well enough nu că n-ar fi bună planeta provided a man could be born to a great title cu condiţia să te naşti cu un titlu însemnat estate avere to contrive a o brodi. […] The machinery* of my work is of a species by itself. nefericit TEXT 5. I take to be made up of the shreds* and clippings* of the rest. on my conscience. a reuşi public charges însărcinare. my work is digressive.6. Chapter V) On the fifth day of November. not for want of penetration* in him. răspundere publică employment slujbă sport jucărie weight greutate. yet with all the good temper* in the world I affirm it of her that in every stage of my life. Tristram Shandy (Vol. remarcabil good temper voie bună turn cotitură to get at (somebody) to irritate. In a word. a asalta pitiful jalnic misadventure nenorocire cross potrivnic. as in my all digressions (one only excepted) there is a master-stroke* of digressive skill. Tristram Shandy (Vol I. which. as you observe. […] 206 Proiectul pentru Învăţământul Rural . Gentleman. – and it is this: That though my digressions are all fair*. provided a man could be born in it to a great title* or to a great estate*. two contrary motions are introduced into it. or expected indeed. and at every turn* and corner where she could get* fairly at me. which were thought to be at variance* with each other. a izbuti. that my main business does not stand still in my absence. I wish I had been born in the Moon. yet I constantly take care to order affairs so. abject vile ticălos with reverence be it spoken fie spus cu tot respectul shreds zdrenţe clippings resturi. and it is progressive too. – not but the planet is well enough*. as far and as often too as any writer in Great-Britain. lipsit de cordialitate/amabilitate to pelt a bombarda. the merit of which has all along. Chapter XXII) For in this long digression which I was accidentally led into. 1718 […] was I Tristram Shandy. I fear. with reverence be it spoken*. to annoy ungracious răutăcios. and that I fly off* from what I am about. and reconciled. Laurence Sterne. in a digression.7. – and at the same time. I can truly say that from the first hour I drew my breath into it […] I have been the continual sport* of what the world calls Fortune. or could any how contrive* to be called up to public charges* and employments* of dignity or power – but that is not my case […]. been overlooked* by my reader. or in any of the planets […] than in this vile*. dirty planet of ours. and though I will not wrong her by saying she has ever made me feel the weight* of any great or signal* evil. brought forth born scurvy păcătos. povară signal însemnat. Laurence Sterne.Reader TEXT 5. but because it is an excellence seldom* looked for.I.
and if he goes on with his main work. artă culinară distress stare jalnică pitiable vrednic de milă to stand stock-still a încremeni. slavă! dexterity îndemânare cookery gătit. his whole work stands stock-still*. what’s more. is truly pitiable*: For. în contradicţie to reign a domni to step forth a păşi bridegroom mire to bid (bade. one wheel within another*. This is vile work*. if he begins a digression. bidden) a ura all hail trăiască!. All the dexterity* is in the good cookery* and management of them. are the sunshine. incontestably. you see. – take them out of this book for instance. that the whole machine. it shall be kept a-going these forty years. a trece cu vederea for want of penetration din pricina lipsei de pătrundere/înţelegere seldom arareori fair fără cusur. in general. brings in variety. For which reason. so as to be not only for the advantage of the reader. but also of the author. if it pleases the fountain of health to bless me so long with life and good spirits*. then there is an end of his digression. he steps forth* like a bridegroom*. from that moment. and have so complicated and involved* the digressive and progressive movements. from the beginning of this. and forbids the appetite to fail. master-stroke mişcare măiestrită skill meşteşug to overlook a-i scăpa. the soul of reading. – they are the life. I observe. restore them to the writer. has been kept agoing. a încâlci one wheel within another cu rotiţele îmbucându-se una întralta good spirits voie bună Proiectul pentru Învăţământul Rural 207 . cum trebuie.Reader Digressions. a sta pe loc vile work ticăloasă treabă adventitious întâmplător to involve a încurca. – one cold eternal winter would reign* in every page of it. you might as well take the book along with them. whose distress*. in this matter. I have constructed the main work and the adventitious* parts of it with such intersections. bids* All hail*. sadea to fly off a-şi lua zborul machinery mecanism at variance potrivnic. – and.
distant godly pious. Oliver Goldsmith.2. Whose beard descending swept his aged breast. a linguşi) fashioned potrivit. a mângâia) TEXT 6. By doctrines fashioned* to the varying hour.1. If peace be his – that drooping* weary* sire*. the matron* pale. a mustra) wandering rătăcire to relieve to bring alleviation (a uşura. Go. fiind considerat bogat pound liră remote far away. Nor e’er* had changed. cucernic) e’er ever to fawn to seek attention and admiration by flattering (a se ploconi. a aprecia the wretched cei sărmani/nenorociţi vagrant vagabond. to all the country dear. Or hers. 208 Proiectul pentru Învăţământul Rural . Far other aims his heart had learned to prize*. whose age Can with no cares except his own engage. His house was known to all the vagrant* train*. but relieved* their pain: The long-remembered beggar was his guest. cerşetor train alai. he climbed the loftiest bough*. passing rich trecând drept bogat. The Deserted Village A man he was. Go! if the peaceful cot* your praises share. The Village Ye* gentle* souls who dream of rural ease*. look within. nor wished to change his place. Unpracticed he to fawn*. that offspring* round their feeble* fire. George Crabbe. Whom the smooth* stream and smoother sonnet please. Or theirs. Remote* from towns he ran his godly* race. and ask if peace be there. And passing rich* with forty pounds* a year. a boy.Reader UNIT 6 ENGLISH PRE-ROMANTIC POETRY TEXT 6. hoinar. looks up to see The bare arms* broken from the withering* tree On which. a alina. chid: to rebuke. cortegiu şir chid to chide. croit to prize a preţui. He chid* their wanderings*. modelat. to scold (a dojeni. More skilled to raise the wretched* than to rise. or seek for power. Who. propped* on that rude* staff*. devout (evlavios. Then his first joy. but his sad emblem now. whose trembling hand Turns on the wretched* hearth* the expiring* brand*! (…) (…) yonder* see that hoary swain*.
încovoiat weary exhausted (istovit) sire (poetic) tată. lacking adornments staff toiag bare arms ramurile/crengile desfrunzite withering decaying. dumbravă Proiectul pentru Învăţământul Rural 209 . disdain (dispreţ) tyrant pride the arrogance of arbitrary or unjust power the social offspring of the heart the community. nenorocit hearth vatră. to excite swelling expanding rapture ecstasy. liniştit cot căsuţă drooping aplecat. sorbitură grove crâng. As varied. chief*. (…) As fast the correspondent passions rise. What wonder then that health and virtue. ales. through the breast Infuses every tenderness. generos ease tihnă. gifts That can alone make sweet the bitter draught* That life holds to all. jalnic.3. The Seasons (from Autumn) He comes! he comes! in every breeze the Power Of Philosophic Melancholy comes! (…) O’er* all the soul his sacred influence breathes. slab matron mamă de familie wretched biet. and far Beyond dim earth exalts* the swelling* thought. The love of Nature. ecstatic joy unconfined unlimited chief most important suffering worth men of merit and virtue who suffer scorn contempt.4. to elevate. părinte offspring vlăstar. (…) The sympathies of love and friendship dear. the sigh for suffering worth* Lost in obscurity. urmaş feeble plăpând. o’er over to exalt to raise. and as high: Devotion. Inflames imagination. whom the heart feels as a family TEXT 6. rezemat rude rudimentary. and man made the town. and. sprijinit. With all the social offspring of the heart*. James Thomson. coarse.) gentle nobil. Of human race. The Task (1785) God made the country. unconfined*. the large ambitious wish To make them blest. linişte. to stimulate. should most abound And least be threatened in the fields and groves*? draught înghiţitură. pace smooth calm. the noble scorn* Of tyrant pride*. losing vitality (care se usucă) loftiest bough ramura cea mai înaltă TEXT 6. William Cowper. simple. cămin expiring dying (care se stinge) brand tăciune yonder (poetic) there hoary swain săteanul cărunt/nins/venerabil propped proptit. raised To rapture* and divine astonishment.Reader ye you (pl.
my father wept*. Infant Sorrow (from Songs of Experience) My mother groaned*. Helpless. Bound* and weary*. Little Lamb. leapt: a sări. Struggling in my father’s hands. a se arunca piping to pipe: to utter something in a high and thin voice fiend demon hid hidden swaddling bands scutece bound to bind. William Blake. supus) mild gentle.The Lamb (from Songs of Innocence) Little Lamb who made thee*? Dost thou know* who made thee? Gave thee life. a înlănţui. Making all the vales rejoice*! Little Lamb. Softest clothing.5. who made thee? Dost thou know who made thee? Little Lamb. Gave thee clothing of delight. a închide weary tired. Striving against my swaddling bands*. Little Lamb. Like a fiend* hid* in a cloud. God bless thee. For he calls himself a Lamb: He is meek*. piping* loud. and he is mild*. William Blake. Into the dangerous world I leapt*. a fi supărat/îmbufnat 210 Proiectul pentru Învăţământul Rural . God bless thee. exhausted to sulk to be silent and resentful a se bosumfla. a suspina wept to weep (wept): a plânge leapt to leap.Reader TEXT 6. îngăduitor) TEXT 6. By the stream and o’er* the mead*. I’ll tell thee: He is called by thy* name. luncă) wooly made of or feeling like wool (lânos) to rejoice to feel or show great joy thy your meek very quiet. gentle and uncomplaining (blând. He became a little child: I a child and thou a lamb. We are called by his name. and bid thee feed*. to groan a geme. who made thee who made you dost thou know do you know bid thee feed ţi-a oferit hrană. not violent (blajin. cuminte. I’ll tell thee. wooly* bright. te-a poftit să te hrăneşti o’er over mead meadow (pajişte. Gave thee such a tender voice.6. Little Lamb. a ţâşni. naked. I thought best To sulk* upon my mother’s breast. bound: a lega strâns.
bound: to tie briar a wild bush with branches that have thorns (măceş. a ţopăi to echo a răsuna Proiectul pentru Învăţământul Rural 211 . My heart is at rest* within my breast. And the dews* of night arise. at ease dew rouă let us away să megrem to fade away to die.7. And binding* with briars* my joys and desires. And laughing is heard on the hill. come leave off play. And the hills are all covered with sheep. And every thing else is still. And tomb-stones* where flowers should be. green pajişte verde at rest calm. borne: to give birth to grave mormânt tomb-stone piatră funerară gown mantie. And the gates of the Chapel were shut. William Blake. Nurse’s Song (from Songs of Innocence) When the voices of children are heard on the green*. So I turned to the Garden of Love. Come. midst middle ‘Thou shalt not’ ‘You shall not’ (the interdictory formula beginning the ten commandments in the Bible) writ written bore to bear. William Blake. and let us away* Till the morning appears in the skies. to disappear to leap (leaped/leapt) a sări. in the sky the little birds fly. let us play. Where I used to play on the green. Besides. iarbă neagră) TEXT 6. That so many sweet flowers bore*. the sun is gone down. And then go home to bed. tranquil. well. go and play till the light fades away*. for it is yet day. a sălta. The Garden of Love (from Songs of Experience) I went to the Garden of Love. And Priests in black gowns* were walking their rounds*.8. And we cannot go to sleep. bore. robă walking their rounds făcându-şi rondul binding to bind. And I saw it was filled with graves*. “Then come home my children.” “No. no.Reader TEXT 6. And ‘Thou shalt not’* writ* over the door.” “Well. And saw what I never had seen: A Chapel was built in the midst*.” The little ones leaped* and shouted and laughed And all the hills echoed*.
the sun is gone down.9. And he opened the coffins and set them all free. He'd have God for his father and never want* joy. and we rose* in the dark. And your winter and night in disguise. a irosi TEXT 6. all their bags left behind. and in soot* I sleep. Tom was happy and warm. if he'd be a good boy. they run. William Blake. Though the morning was cold. for when your head's bare. weep!” So your chimneys I sweep. Were all of them locked up in coffins* of black. The Chimney Sweeper* (from Songs of Innocence) When my mother died I was very young. And the Angel told Tom. Ned and Jack. My face turns green* and pale. was shaved: so I said “Hush*. Dick.” And so he was quiet. There’s little Tom Dacre. freamăt dale vale. 212 Proiectul pentru Învăţământul Rural . You know that the soot cannot spoil your white hair. Tom. William Blake. And wash in a river. The days of my youth rise fresh in my mind. And the dews of night arise. weep.10. Then come home. Then down a green plain leaping. he had such a sight*!– That thousands of sweepers. and that very night. And my father sold* me while yet my tongue Could scarcely cry “weep*. and shine in the Sun. my children. foşnet. weep. they need not fear harm. Then naked and white. And by* came an Angel who had a bright key. whisperings şoapte. As Tom was a-sleeping. And got with our bags and our brushes to work. who cried when his head That curled* like a lamb’s back. and sport* in the wind. never mind it. laughing. Joe. Your spring and your day are wasted* in play. Nurse’s Song (from Songs of Experience) When the voices of children are heard on the green And whisperings* are in the dale*. They rise upon clouds. And so Tom awoke. vâlcea my face turns green as in “green with envy” to waste a pierde.Reader TEXT 6. So if all do their duty.
And are gone to praise God and his Priest and King. a se juca to want to feel the need or longing for something. They clothed me in the clothes of death. Now like a mighty* wind they raise to heaven the voice of song. fii liniştit sight vision coffin sicriu. Beneath them sit the aged men. They think they have done me no injury*. nedreptate misery intense unhappiness or suffering TEXT 6.Reader chimney sweeper coşar. lest* you drive* an angel from your door. în preajmă to sport a zburda. these flowers of London town! Seated* in companies they sit with radiance* all their own*. potoleşte-te. Proiectul pentru Învăţământul Rural 213 .” weep see explanation above woe intense grief/sorrow/unhappiness thy your say? ia spune! heath câmpie stearpă injury rău. Then cherish* pity. coşciug by aproape. The children walking two and two in red and blue and green. to be lacking something rose to rise (rose. a se deştepta TEXT 6. alături.11. Holy Thursday (from Songs of Innocence) ‘Twas* on a Holy Thursday*. O what a multitude they seemed. hornar sold to sell. And because I am happy and dance and sing. The Chimney Sweeper (from Songs of Experience) A little black thing among the snow. Till into the high dome* of Paul’s* they like Thames’ waters flow. Or like harmonious thunderings* the seats* of heaven among. sold: a vinde (the boy’s father has put him to work to bring money in the family) weep the boy is so young that he could scarcely cry “sweep!” )to advertise his work in the streets). their innocent faces clean. William Blake. The hum* of multitudes was there. Because I was happy upon the heath*. weep!” in notes of woe*! “Where are thy* father and mother? say*?” “They are both gone up to church to pray. but multitudes of lambs. Crying “weep*. with wands* as white as snow. wise guardians of the poor. risen): a se scula. And taught me to sing the notes of woe. William Blake.12. Grey-headed beadles* walked before. it is ironic that “sweep” becomes “weep” (a plânge) soot funingine to curl a se încreţi/cârlionţa hush taci. Who make up a Heaven of our misery*. Thousands of little boys and girls raising their innocent hands. And smiled among the winter’s snow.
and to the Last Judgement. when the ascension of Christ to heaven is celebrated beadle an officer in British churches in the past. who helped the priest in various ways. And their fields are bleak* and bare*. especially by keeping order wand baghetă dome hemispherical roof St Paul’s Cathedral the largest cathedral in London.13. sterp. rece. fertil. a monument of baroque architecture seated aşezaţi radiance great happiness that shows in someone’s face. a iubi) lest ca să nu. gentle light (strălucire) all their own coming from inside themselves hum a low continuous murmuring sound mighty very strong and powerful thundering tunet the seats of heaven among among the seats of heaven: in the sky (allusion to judgement seat. ghimpe where-e’er wherever to appal to make someone feel shocked and upset (a îngrozi) 214 Proiectul pentru Învăţământul Rural . soft. William Blake. Nor poverty the mind appal*. Babe can never hunger there. Holy Thursday (from Songs of Experience) Is this a holy thing to see. It is eternal winter there. in the Revelation) to cherish to treasure something (a preţui. And their ways are filled with thorns*. For where-e’er* the sun does shine. In a rich and fruitful* land Babes reduced to misery. roditor fed to feed (fed): a hrăni usurous cămătăresc (see again the Glossary) bleak sterp. Fed* with cold and usurous* hand? Is that trembling cry a song? Can it be a song of joy? And so many children poor? It is a land of poverty! And their sun does never shine. the 40 day after Easter. fruitful fecund.Reader ‘twas it was th Holy Thursday Ascension Day. And where-e’er the rain does fall. neroditor thorn spin. lugubru bare gol. re-built th in the late 17 century. ca nu cumva to drive (from) a alunga. a goni TEXT 6.
Penguin Books Ltd. edited with an Introduction by Angus Ross. 1983 Proiectul pentru Învăţământul Rural 215 . with and introduction by Margaret Ann Doody. 1985 Richardson. Laurence. ed. or the History of a Young Lady. Samuel. Vols. Paradise Lost. vol. The Complete Works. Daniel. 5 (Hamlet). 1986 Shakespeare. London and Melbourne: J. 1980 Shakespeare. or. Gentleman. 1996 Richardson. Henry. W.J. Clarissa. edited with an introduction by Ian Campbell Ross. Craig.. Oxford University Press.English pre-Romantic poetry Sources Abrams.. 1988 Shakespeare. 7 (Macbeth). Opere complete. Penguin Books Ltd. Samuel. M. with a glossary by W. H (Gen. Bucureşti: Editura Univers. 1987 Milton. edited with an introduction by Angus Ross. Ltd. William. I. William. vol. M. William. The Norton Anthology of English Literature. edited with an introduction by Arthur Humphreys. London: Henry Pordes. William. Joseph Andrews and Shamela. Leviţchi. Penguin Books.. edited. Bucureşti: Editura Univers. vol. Opere..). Virtue Rewarded. John. II New York. 1965 Fielding. London: W. Dent and Sons Ltd. Mariner. Pamela. Opere complete. by Peter Sabor. The Life and Adventures of Robinson Crusoe of York. ediţie îngrijită şi comentată de Leon D. XI (Furtuna) Bucureşti: Editura pentru Literatură Universală. Leviţchi.. Norton & Company. 1993 Defoe. 1984) Sterne. 1963 Shakespeare. Ed. ediţie îngrijită şi comentată de Leon D. Penguin Books Ltd. The Life and Opinions of Tristram Shandy.
Los Angeles. 1996 Day. Norton and Company. David. The Oxford Companion to English Literature. The English Novel. Hubert. London: Penguin Books Ltd.). 1992 Daiches. Romanticism.F. 1963 Drabble. Michael. Margaret (ed. 1969 Day. Romul. Jacobean Poetry and Prose: Rhetoric. Ioan Aurel Preda (eds. 1988 Butt.. 1991 Alter. 1993 Allen. Robert A. 1993 Coveney... Cornelia. Boris (ed. The English Eighteenth Century. Norton & Company. 5). (vols. David. Penguin Books. 1974 Nokes. 1975 Bloom. John. 1965 Macsiniuc. Literatura europeană în epoca luminilor. The Metaphysical Poets. Inc.R. Martin. Macmillan Education Ltd. Twayne Publishers. The Penguin Dictionary of Literary Terms and Literary Theory. Berkeley. Representation and the Popular Imagination. Penguin Books. Leavis). Coulson). 1979 Cartianu.. London: Secker and Warburg Ltd. 1970 Corns. Robert. Novel and Romance. The Novel as a Self-Conscious Genre. The Mid-Eighteenth Century.). 2003 McDermott. Dicţionar al Literaturii Engleze. J. Gerald (ed. Jonathan Swift. Ana. The Image of Childhood (with an introduction by F. 1967 Cuddon. W. W. Gulliver’s Travels. A Short History of English Literature (transl. Partial Magic. Thomas N (ed. 3). The Norton Anthology of English Literature. Aiden.. The Cambridge Companion to English Poetry. Bucureşti: Editura Enciclopedică Română. A. H (Gen. The Poetry of Alexander Pope. London: The Macmillan Press Ltd. Penguin Books Ltd.Bibliography SELECTED BIBLIOGRAPHY Abrams. Oxford: The Clarendon Press. Penguin Books Ltd..). London and New York: Routlege.. Garden City: Doubleday & Company. Donne to Marvell¸ Cambridge University Press. New York. 4. 2. Oxford: The Clarendon Press.. 3. Boyson and J. Joseph Andrews. The Poetry of William Blake. 1989 Ferber. (ed. Peter. II New York. I. Émile. A Critical History of English Literature. Clive (ed. Oxford University Press. London: W. Inc. History of English Literature. 1660-1837. London: Penguin Books.. Robert.. David. 1985 Fairer. 1988 Hunting. 1989 Munteanu. The Macmillan Press Ltd.). V.. 1991 Greenberg. 1961 Hammond.).).). 1987 216 Proiectul pentru Învăţământul Rural . The Odyssey to Tom Jones. 1971 Legouis. The New Pelican Guide to English Literature (vols. The Novel in Its Beginnings. Walter. Penguin Books Ltd. 1991 Ford. Ed. Editura Universităţii Suceava. New York: W. Bucureşti: Editura Ştiinţifică. An Annotated Text with Critical Essays.). Vols. London: University of California Press. Jonathan Swift. M.
Bibliography Olteanu. Cambridge University Press.). Ian. From Beowulf to Paradise Lost. 1983 Sampson. 2003 Raine. 1983 Preda. Studies in Eighteenth Century Fiction and Romantic Poetry. 1994 Protopopescu. Richardson and Fielding. Studies in Defoe. Bucureşti: Editura Didactică şi Pedagogică. Ian. The Literature of the Beginnings. 1974 Preda. Bucureşti: Editura “Grai şi suflet – Cultura naţională”. The Renaissance and the Restoration Period.” 2000 Watt. Editura Universităţii Suceava. English Literature and Civilisation. Blake and the New Age. The Cambridge Companion to the EighteenthCentury Novel. 1979 Richetti. Editura Universităţii Bucureşti. Marthe. Kathleen. Dragoş. John (ed. studiu introductiv şi note de Dan Grigorescu. 3). Ioan-Aurel.). 1996 Robert. Chatto & Windus. 1991 Watt. Romanul începuturilor şi începuturile romanului. Bucureşti: Editura Fundaţiei “România de Mâine. The Concise Cambridge History of English Literature. Morfologia romanului european în secolul al XVIIIlea. ediţie îngrijită. Tudor. A Survey of English Literature from Beowulf to Jane Austen. 2003 Volceanov. George. Cambridge University Press. 1974 Proiectul pentru Învăţământul Rural 217 . Bucureşti: Editura Univers. Bucureşti: Editura Univers. London: George Allen and Unwin. Fenomenul englez (vol. The Rise of the Novel. Four Myths of Individualism. Cambridge University Press. Ioan-Aurel (ed. 1970 Turcu. George. Luminiţa Elena. | https://www.scribd.com/doc/44902013/17-and-18-Century-British-Literature | CC-MAIN-2017-09 | refinedweb | 78,895 | 61.22 |
Terraform Cloud estimates costs for many resources found in your Terraform configuration. It displays an hourly and monthly cost for each resource, and the monthly delta. It also totals the cost and delta of all estimatable resources.
In this tutorial, you will enable cost estimation and
For this tutorial you will need:
- A Terraform Cloud Team & Governance tier account or a Terraform Enterprise account
- A GitHub account
- An AWS account to create example resources
You should also be familiar with how to create and destroy Terraform Cloud workspaces.
Warning: Do not apply this policy to a production workspace as it may impact your production environment.
Note: Terraform Cloud will not estimate cost on runs or applies targeted against a subset of resources.
»Fork the sample repository
Fork the sample repository, which contains an example Terraform configuration to provision an EC2 instance.
Note: If you completed the Upload Your Sentinel Policy Set to Terraform Cloud tutorial, you may already have a fork of this repository. Feel free to use it.
>.
Note: If you completed the Upload Your Sentinel Policy Set to Terraform Cloud tutorial, you may already have a workspace for this configuration. Feel free to use it.
<<
»Verify costs using policies
To verify cost estimates using policies, you need to define your policy and update your policy set.
Create a fork of the example repository, which contains a Sentinel policy that flags any resource changes that increase costs by greater than \$100.
The
sentinel.hcl file in this repository declares the new policy in your policy set. Note that
the
enforcement_level is set to
soft-mandatory: this allows team members
with explicitly set permission to override the policy check and logs and
overrides.
policy "less-than-100-month" { enforcement_level = "soft-mandatory"}
The
less-than-100-month.sentinel file contains the policy definition.
import "tfrun"import "decimal" delta_monthly_cost = decimal.new(tfrun.cost_estimate.delta_monthly_cost) main = rule { delta_monthly_cost.less_than(100)}
This policy uses the
tfrun import
to check that the cost delta for a Terraform run is no more than \$100. The
decimal import is used for more precise calculations when working with
currency numbers.
Terraform Cloud will run checks for policies defined in
sentinel.hcl in all workspaces associated with the policy set.
»Create a policy set
In Terraform Cloud, navigate to "Settings" > "Policy Sets" and select "Connect
a new policy set". Configure your fork of the
learn-terraform-cost-estimation
repostiory as the source.
Tip: The search bar for policy repositories is case sensitive.
In Terraform Cloud, you can apply policy sets either across your organization, or to specific workspaces.
On the "Configure Settings" page:
- Select "Policies enforced on selected workspaces" under "Scope of Policies"
- Select your
learn-sentinel-tfcworkspace and click the purple "Add workspace button"
- Click "Connect policy set"
»Trigger a run
Tip: For a full list of supported resources in Terraform Cloud cost estimation, refer to the AWS, Azure, and Google Cloud Cost Estimation Documentation.
Navigate to your
learn-sentinel-tfc workspace. Select "Start new plan" from
the "Actions" menu, and run the default "Plan (most common)" option.
»View cost estimate
After queueing a new run, Terraform Cloud will estimate changes to your resource costs and display them in the run UI. There you will find the list of resources, their price details, and the list of un-estimated resources. You will also find the new total to determine the proposed overall monthly cost once the run is applied.
In this case, the new resource definition satisfies the Sentinel policy check you defined.
Note: This is just an estimate; some resources do not have cost information available or have unpredictable usage-based pricing.
Click "Discard run" to cancel the run.
»Delete the policy set
Navigate back to your policy set under "Settings" > "Policy Sets". Under workspaces, click "Delete policy set". Confirm by clicking "Yes, delete policy set".
Congratulations — you have enabled cost estimation and used it in a policy check! This provides another tool to manage your infrastructure spending.
To learn more about cost estimation, refer to the Cost Estimation documentation.
If you would like to learn more about Terraform Cloud, refer to the following resources:
-. | https://learn.hashicorp.com/tutorials/terraform/cost-estimation | CC-MAIN-2021-39 | refinedweb | 688 | 55.84 |
in reply to use Very::Long::Module::Name as Foo;
$ perl .
It is in gross violation of the "do the simplest thing that can possibly work" principle.
I don't agree there. I still think my approach is the cleanest from the user's point of view. It doesn't need the definition of any extra variables or constants, which I think are cruft from an API point of view. And therefore, it is the simplest thing that can possibly work in my eyes.
Under the hood, Perl is already using rather heavy weaponry to DWIM. Constants are one (first create a subroutine, then inline the constant later). Tieing variables is another one. And what about $&? All can be done in other ways, yet everyone likes the fact that they're there if they want to take the performance penalty.
Personally, I think it would not be a real big issue to implement the "as modulename" feature in the C-code that handles "use" in Perl (which would put the namespace aliasing stuff under the hood there). And I think the effect on compiling would be negligeble (only extra complexity while compiling a "use"). However, the reason I'm not going to pursue this, is the global namespace problem. I don't see a simple solution for making the short name local to the package in which it "defined".
Liz
Your approach isn't transparent: references will be blessed into the shortname package.
shell> perl -le '*a::=*b::; print bless [], "a"'
b=ARRAY(0x8107f70)
[download]
_________broquaint
Yes!
No way!
Results (109 votes). Check out past polls. | https://www.perlmonks.org/?node_id=299293 | CC-MAIN-2018-26 | refinedweb | 266 | 74.9 |
Brewing in Beats: Enrich events with Kubernetes metadata
Welcome to Brewing in Beats! With this weekly series, we're keeping you up to date with what's new in Beats, including the latest commits and releases.
Enrich each event with Kubernetes metadata
Thanks to Vijay Samuel, there is a community contribution to add support for Kubernetes as a processor for Beats. The Kubernetes processor allows Beats to enrich events with metadata coming from the Kubernetes Pod from which the event originated. By default, the Kubernetes processor adds the following metadata:
- pod name
- pod namespace
- container name and labels
Depending on the Beat, the Kubernetes processor can add additional information. For example for Filebeat, it takes the
source fields, extracts the container ID, and uses it to retrieve metadata about the Pod from which the log message originated.
This will be released as Beta in 6.0.
Monitor Elasticsearch with Metricbeat
A new module is added to Metricbeat for monitoring Elasticsearch. It exports metrics about:
- Node info (
nodemetricset) by interrogating the Cluster API of Elasticsearch to get cluster nodes information. This metricset only fetches the data from the
_localnode, so it must run on each Elasticsearch node.
- Node stats (
node_statsmetricset) by calling Cluster API of Elasticsearch to get the cluster nodes statistics. This metricset only fetches the data from the
_localnode, so it must run on each Elasticsearch node.
The Elasticsearch module in Metricbeat exports only a few basic metrics, and for a better monitoring experience, we recommend you to use X-Pack monitoring.
This will be released as Beta in 6.0.
New community Beat: Kafkabeat
Kafkabeat is built on top of libbeat infrastructure to read the streaming events stored in Kafka and send them to Elasticsearch. An option would be to use Kafkabeat in the following scenario: Filebeat >> Kafka >> Kafkabeat >> Elasticsearch.
Other changes
Repository: elastic/beats
Affecting all Beats
Changes in master:
Metricbeat
Changes in 5.x:
- Make system process metricset honor cpu_ticks config option #3776
- Adding support for custom http headers and TLS for metricbeat modules #3945
- Fixing panic on prometheus collector when label has , #3947
Changes in master:
Packetbeat
Changes in 5.x:
Winlogbeat
Changes in 5.x:
Filebeat
Changes in 5.x:
- Filebeat syslog module: support for lines without a program name #3944
- Don't stop Filebeat when modules + logstash are used together #3929
Packaging
Changes in 5.x:
Infrastructure
Changes in master:
Documentation
Changes in 5.0:
- Remove yellow box redirecting users to master for dev docs #3958
- Remove outdated content from packetbeat dev guide #3963
Changes in 5.3:
Repository: elastic/gosigar
Changes in master: | https://www.elastic.co/blog/brewing-in-beats-enrich-events-with-kubernetes-metadata | CC-MAIN-2019-30 | refinedweb | 431 | 53.92 |
Generics Safety
Java has always given you the ability to create generalized classes, interfaces, and methods by operating through references of type Object. Because Object is the superclass of all other classes, an Object reference can refer to any type object. Thus, in pre-generics code, generalized classes, interfaces, and methods used Object references to operate on various types of objects. The problem was that they could not do so with type safety.
Generics added the type safety that was lacking. They also streamlined the process, because it is no longer necessary to explicitly employ casts to translate between Object and the type of data that is actually being operated upon. With generics, all casts are automatic and implicit. Thus, generics expanded your ability to reuse code and let you do so safely and easily. For example, consider the following generic class:
Given that the same functionality found in the generic GenClass can be achieved without generics, by simply specifying Object as the data type and employing the proper casts, what is the benefit of making GenClass generic? The answer is that generics automatically ensure the type safety of all operations involving GenClass. In the process, they eliminate the need for you to enter casts and to type-check code by hand. To understand the benefits of generics, first consider the following program that creates a non-generic equivalent of GenClass :
Program
Notice that NonGenClass replaces all uses of T with Object. This makes NonGenClass able to store any type of object, as can the generic version. However, it also prevents the Java compiler from having any real knowledge about the type of data actually stored in NonGenClass, which is bad for two reasons.
1) Explicit casts must be employed to retrieve the stored data. Notice the line :
Because the return type of getob( ) is Object, the cast to Integer is necessary to enable that value to be auto-unboxed and stored in getInt. If you remove the cast, the program will not compile. With the generic version, this cast was implicit. In the non-generic version, the cast must be explicit. This is not only an inconvenience, but also a potential source of error.
2) Many kinds of type mismatch errors cannot be found until run time. Notice the line :
Here, sob is assigned to iob. However, sob refers to an object that contains a string, not an integer. This assignment is syntactically valid because all NonGenClass references are the same, and any NonGenClass reference can refer to any other NonGenClass object. However, the statement is semantically wrong, as the next line shows. Here, the return type of getob( ) is cast to Integer, and then an attempt is made to assign this value to getInt2. The trouble is that iob now refers to an object that stores a String, not an Integer. Unfortunately, without the use of generics, the Java compiler has no way to know this. Instead, a run-time exception occurs when the cast to Integer is attempted. As you know, it is extremely bad to have run-time exceptions occur in your code.
The preceding sequence can’t occur when generics are used. If this sequence were attempted in the generic version of the program, the compiler would catch it and report an error, thus preventing a serious bug that results in a run-time exception. A key point to understand about generic types is that a reference of one specific version of a generic type is not type compatible with another version of the same generic type. For example, the following line of code is in error and will not compile :
Even though both ‘iob’ and ‘sob’ are of type GenClass<T>, they are references to different types because their type parameters differ. This ability to create type-safe code in which type-mismatch errors are caught at compile time is a key advantage of generics. Although using Object references to create “generic” code has always been possible, that code was not type safe, and its misuse could result in run-time exceptions. Generics prevent this from occurring. In essence, through generics, run-time errors are converted into compile-time errors. This is a major advantage.
Program Source
class NonGenClass { Object ob; NonGenClass(Object obj) { ob = obj; } Object getOb() { return ob; } void showType() { System.out.println("T Type : "+ob.getClass().getName()); } } public class Javaapp { public static void main(String[] args) { NonGenClass iob = new NonGenClass(50); iob.showType(); int getInt = (Integer)iob.getOb(); System.out.println("Value : "+getInt); NonGenClass sob = new NonGenClass("hajsoftutorial"); sob.showType(); String getString = (String)sob.getOb(); System.out.println("Value : "+getString); iob = sob; int getInt2 = (Integer)iob; System.out.println("Value : "+getInt2); } } | https://hajsoftutorial.com/java-generics-safety/ | CC-MAIN-2019-47 | refinedweb | 780 | 55.13 |
Search the Community
Showing results for tags 'tilemap'.
Found 300 results
Dynamic TileMap
CaptainCannabis posted a topic in PhaserTook me some time to understand the example with a blank tilemap. Maybe because it comes along with mouse input and extraction of tiles from a predefined source. So i thought i'll leave this here. assets/bg.png is an image with 32x32 pixels holding 4 different background sprites. Dynamic tile map created from an array (found in another example): var game = new Phaser.Game(1280, 1024, Phaser.AUTO, 'eAnt', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.image('background', __dirname+'/assets/bg.png'); } var cursors; var map; var sand; var layer1; var obstacks; var tileset1; var tileset2; function create() { game.stage.backgroundColor = '#2d2d2d'; // Create some map data dynamically // Map size is 128x128 tiles var data = ''; for (var y = 0; y < 24; y++) { for (var x = 0; x < 24; x++) { data += game.rnd.between(0, 3).toString(); if (x < 23) { data += ','; } } if (y < 23) { data += "\n"; } } //console.log(data); // Add data to the cache game.cache.addTilemap('dynamicMap', null, data, Phaser.Tilemap.CSV); map = game.add.tilemap('dynamicMap',16, 16); //, Maße durch das data-Array vorgegeben layer1 = map.createLayer(0);() { } Dynamic tile map with "on the fly" created random tile: var game = new Phaser.Game(1280, 1024, Phaser.AUTO, 'eAnt', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.image('background', __dirname+'/assets/bg.png'); } var cursors; var map; var layer1; var obstacks; var tileset1; function create() { game.stage.backgroundColor = '#2d2d2d'; // Eine leere TileMap erstellen map = game.add.tilemap(); //, 24 x 24 Tiles die jeweils 16 x 16 px groß sind layer1 = map.create('background', 24, 24, 16, 16);); // Das Layer mit Tiles füllen for (var y = 0; y < 24; y++){ for (var x = 0; x < 24; x++){ // Zufälliges Bild aus dem Hintergrund-Tileset var SpriteIndex = game.rnd.between(0, tileset1.total-1).toString(); var t = new Phaser.Tile(layer1, SpriteIndex, x, y, 16, 16); map.putTile( t, x, y, layer1); } } //; }
Preserving order of Tiled map layers in Tilemap object
Dannflower posted a topic in Phaser!
[Solved] Collision glitch with player body and tilemap
Electrk posted a topic in PhaserSo I'm getting these weird collision glitches, where I get knocked back randomly. This only seems to happen when I set my sprite's body's width to 8, as opposed to the sprite's width of 16. I'm using Arcade physics, if that makes a difference.
-!
collide How i can do collide everything inside on a layer with my character
jopcode posted a topic in PhaserHi
Can a tile from a tilemap be moved?
Dark Nemesis posted a topic in PhaserSo I am trying to make a platformer game using Phaser. The game contains a lot of blocks (tiles) which are loaded from the tilemap. Now what I want is that these blocks can be moved dynamically during the game (for ex. if the player bangs their head against it). The thing is, I don't know how? My first question is, is this possible? Because I tried changing the position, it didn't work (but I successfully changed its alpha). Moreover, I tried using Physics P2, but it has a null sprite value, so all the changes done are done to the body and the sprite still remains there. I can use any physics system, I am open to all. All I need is a way to work this out.
Phaser Plugin: NavMesh Generation
pixelburp posted a topic in Phaser.
Tilemap gets clipped
Cramer posted a topic in PhaserHello all, if i display a tilemap and then move the camera the tilemap gets clipped. When i first load the tilemap everything is rendered properly (red border is the canvas size) but then when i move the camera a bit it looks like this The tilemap is still in the canvas but it doesn't get fully rendered. Here is also a modified example from Phaser.io to demonstrate that problem: just draw some tiles and then move the camera with the arrow keys Any help would be appreciated.
- 510/5000 Good night people! I'm developing a game where the character needs to climb a ladder. The problem I am facing is when he needs to enter a tile that is down the ladder, as I try to illustrate in the image below. When hitting the tile the pesonagem stops to move because the tile needs to be solid so the character can walk on it, but when he is on the stairs he must pass over this tile. Could someone show an example of how I can do this? Since then, thank you very much.
Replace tilemap tile with tile from tileset
Tchom posted a topic in PhaserHey guys, I'm having trouble swapping tiles in a Tilemap. In all the examples it seems like to get a tile object (to pass into map.putTile) it has be selected from an already instantiated tile that's part of the map. What I'd like to do is create a new tile from the map's tileset. Is this possible?
what is the advantage of using pixi-tilemap?
mobicfly posted a topic in Pixi.jsI am trying to use this lib: and it seems using shader rather than sprites to render tilemap? is it more efficiency? why? the memory usage is the same, right? thanks.
Collisions between tilemap using P2 physics and player using Arcade physics
Durden posted a topic in PhaserHi, I'm using a tileset for my maps. Not all tiles fill their whole square though, like the top and bottom blocks there, for example. The player character is a simple square guy. Here's my problem : for example in this part of one of the map, as long as there's one tiny bit of rock in a tile, Arcade will consider the whole tile should detect collisions. Meaning the player will effectively bounce back against thin air. To have more precise collisions, I'd like to have the character using Arcade physics as it's a simple square and I don't need anything fancy for its physics, and I'd like to use P2 to add detailed physics for collision with the "not entirely filled" map tiles. Is that even possible ? How would you go about doing it ? For now, I've made a json file with physics applied to the whole tileset (using PhysicsEditor) and imported it in the preload method of the Preload state like that : //Preload.js InteractiveResume.Preload.prototype = { preload: function() { //... //load Tiled map this.load.tilemap('grottoMap', 'assets/tilemaps/testGrotto.json', null, Phaser.Tilemap.TILED_JSON); //the terrain tileset and its physics this.load.image('mainTileset', 'assets/png/mainTileset.png'); this.game.load.physics("mainTileset-physics", "assets/json/mainTileset-physics.json"); } } I setup my game maps with an external method located in a "global namespace", the method looks like this : //gameFunctions.js var funcs = { mapSetup: function(map) { config.currentState.map = config.currentState.game.add.tilemap(map); //the first parameter is the tileset name as specified in Tiled, the second is the key to the asset config.currentState.map.addTilesetImage('mainTileset', 'mainTileset', 16, 16); //create layers config.currentState.firstBackgroundLayer = config.currentState.map.createLayer('firstBackgroundLayer'); config.currentState.secondBackgroundLayer = config.currentState.map.createLayer('secondBackgroundLayer'); config.currentState.blockedLayer = config.currentState.map.createLayer('blockedLayer'); //resizes the game world to match the layer dimensions config.currentState.firstBackgroundLayer.resizeWorld(); config.currentState.secondBackgroundLayer.resizeWorld(); config.currentState.blockedLayer.resizeWorld(); //collision on blockedLayer config.currentState.map.setCollisionBetween(1, 100000, true, 'blockedLayer'); config.currentState.game.physics.p2.convertTilemap(config.currentState.map, config.currentState.blockedLayer); } } (I had to define a global variable 'config.currentState' to access the 'this' keyword representing the current state outside of it, if anyone knows a better solution I'd be very thankful as its quite heavy to use) And then in my Grotto state : // Grotto.js InteractiveResume.Grotto.prototype = { create: function() { //Creating the map, player sprite and everything... //setup Arcade physics for the player character this.game.physics.arcade.enable(this.player); }, update: function() { //collisions this.game.physics.arcade.collide(this.player, this.blockedLayer); //... } } Could anyone point me to the correct direction here ? I must admit I'm totally lost
-
Need help scaling TilemapLayer
Tufan posted a topic in PhaserI'm trying to scale a tilemap using TilemapLayer.setScale but it blurs tiles, is there any way to scale tilemap with full quality? Phaser's scaling: Tiled zoom::
Making looped tilemap
gridranger posted a topic in PhaserI am using a tilemap that is draggable and the world bounds are currently equal to the tilemap size. My goal to achieve is converting this simple tilemap to one that is looped by its eastern and western edges so if you scroll over the bounds to east or west you would see the map repeated with all the tiles and sprite objects on it. To describe it more technically I would like the user to feel that all tiles and objects showing up at any ((x % mapWidth), y) position. To fake this effect in case of tilemaps bigger than the screen, I suppose that I require at least two copies of the tilemap and all objects on it side by side. With that and the tricky repositioning of the camera over the two clones I could fake the seamless looping effect. But unfortunately I have no idea how to double the whole map content and make the other one show p when the bounds are crossed. Any hint on how to do that would be a great help.
Collision with Tilemap not working
Leprosy posted a topic in PhaserH, I'm just beginning a Boulder Dash type of game to teach myself phaser...so far seems to be a fun and easy library but I've found myself unable to make the player sprite collide with the tilemap representing the level. Perhaps the answer is pretty obvious, but I can't manage to see it. I will share my code: /** * Super fun gamez */ // Main namespaces and definitions var Engine; var Game = Game || {}; Game.name = "_lepdash"; Game.version = "0.1"; Game.width = 800; Game.height = 600; /*User*/ Game.tileSize = 32; // Load assets state Game.loadState = { preload: function() { console.info(Game.name + " loading assets"); // Put your assets loader logic here... /*User*/ Engine.add.text(10, 10, "Loading...", { font: "20px Arial", fill: "#ffffff" }); //Engine.load.image('bg', 'img/bg0.png'); Engine.load.spritesheet("player", "img/player.png", Game.tileSize, Game.tileSize); Engine.load.spritesheet("terrain", "img/terrain.png", Game.tileSize, Game.tileSize); Engine.load.tilemap("map", "maps/map1.json", null, Phaser.Tilemap.TILED_JSON); }, create: function() { Engine.state.start("main"); } }; // Main menu state Game.mainState = { preload: function() { console.info(Game.name + " main menu"); }, create: function() { // Create your main menu logic here... /*User*/ // Draw main menu Engine.add.text(10, 10, Game.name, { font: "20px Arial", fill: "#ffffff" }); Engine.add.text(10, 50, "press space to start", { font: "12px Arial", fill: "#ffffff" }); // Set game parameters Game.level = 1; Game.score = 0; Game.lives = 3; // Wait for user input var key = Engine.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); key.onDown.addOnce(function() { Engine.state.start("play"); }, this); } }; // Play loop state Game.playState = { cursors: null, //player: null, preload: function() { console.info(Game.name + " play loop"); }, // Create your play logic here /*User*/ create: function() { console.info("Game params", Game); Engine.physics.startSystem(Phaser.Physics.ARCADE); // build map Game.map = Engine.add.tilemap("map"); Game.map.addTilesetImage("tiles", "terrain"); //"tiles name in JSON", "tileset" defined in preload state Game.map.setCollision(1, "map" + Game.level); /*Game.map.setTileIndexCallback(2, function(a, b, c) { console.info("callback", this, a, b, c) }, this);*/ Game.layer = Game.map.createLayer("map" + Game.level); Game.layer.resizeWorld(); Game.layer.debug = true; // add player Game.player = this._createPlayer(); Game.player.animations.play("tap"); Engine.physics.enable(Game.player); //Game.player.body.setSize(10, 14, 2, 1); this.cursors = Engine.input.keyboard.createCursorKeys(); // add HUD Game.HUD = Engine.add.text(10, Game.height - 15, "", { font: "15px Arial", fill: "#ffffff" }); }, update: function() { Engine.physics.arcade.collide(Game.player, Game.layer); this._checkInput(); this._updateHUD(); }, render: function() { Engine.debug.body(Game.player); }, _updateHUD: function() { Game.HUD.text = "Map:" + Game.level + " Score: " + Game.score + " Lives: " + Game.lives; }, _checkInput: function() { Game.player.body.velocity.set(0); if (this.cursors.left.isDown) { Game.player.body.velocity.x = -100; Game.player.play("left"); } else if (this.cursors.right.isDown) { Game.player.body.velocity.x = +100; Game.player.play("right"); } else if (this.cursors.up.isDown) { Game.player.body.velocity.y = -100; Game.player.play("up"); } else if (this.cursors.down.isDown) { Game.player.body.velocity.y = 100; Game.player.play("down"); } else { Game.player.play("still"); } }, _createPlayer: function() { var player = Engine.add.sprite(Game.tileSize, Game.tileSize, "player"); player.animations.add("left", [ 7, 8, 9, 10, 11, 12, 13 ], 20, false); player.animations.add("right", [ 14, 15, 16, 17, 18, 19, 20 ], 20, false); player.animations.add("up", [ 7, 8, 9, 10, 11, 12, 13 ], 20, false); player.animations.add("down", [ 14, 15, 16, 17, 18, 19, 20 ], 20, false); player.animations.add("still", [ 0 ], 10, false); player.animations.add("blink", [ 0, 1, 2, 1 ], 10, false).onComplete.add(function() { player.animations.play("still"); }); player.animations.add("tap", [ 3, 4, 3, 4, 5, 6, 5, 4, 3, 4, 3, 4, 5, 6, 5, 4 ], 10, false).onComplete.add(function() { player.animations.play("still"); }); return player; } }; // Setting up main states Engine = new Phaser.Game({ //enableDebug: false, width: Game.width, height: Game.height, renderer: Phaser.AUTO, antialias: false, //transparent: true, parent: "game" }); //Engine = new Phaser.Game(Game.width, Game.height, Phaser.AUTO, "game"); Engine.state.add("load", Game.loadState); Engine.state.add("main", Game.mainState); Engine.state.add("play", Game.playState); // Let's roll window.onload = function() { console.info(Game.name + " init"); Engine.state.start("load"); }; Attached are the assets I'm using for this project. Thanks in advance map.tmx map1.json
tilemap not displaying properly
wizardeddas posted a topic in PhaserSo I'm having an issue trying to get a tilemap working properly. I made my tilemap in Tiled. JSON: Image: Code: Any ideas what I'm doing wrong? I've used multiple tilemaps from different sources and they all have similar display errors. Thank you.
TileMap doesn't show correctly
jopcode posted a topic in Phaser)
Tilemap render bounds don't update when changing game size
Eendhoorn posted a topic in Phaser!
Tilemap Copy/Pasted tiles not rendering
johann_dev posted a topic in Phaser
Use tilemap as spritesheet
microcipcip posted a topic in PhaserI am building a platformer game Mario Style, and I have a tiled tilemap. I know how to set collisions and place it in the game statically, but I don't understand if it is possible to reuse the same tilemap to, for example, move platforms up/down left/right or load the character spritesheet that is inside the tilemap and animate it. So, basically...do I need a separate spritesheet for dynamic sprites (for example bundled with texturepacker)? Or should I use the same tilemap but load it again as a spritesheet so I reuse the same PNG? Would that improve performance?
CSV Tilemap Collisions not Working
bobonthenet posted a topic in Phaser? | http://www.html5gamedevs.com/tags/tilemap/ | CC-MAIN-2017-47 | refinedweb | 2,534 | 59.7 |
From: williamkempf_at_[hidden]
Date: 2001-07-02 08:39:07
--- In boost_at_y..., "Alexander Terekhov" <terekhov_at_d...> wrote:
>
> > namespace thread {
> >
> > namespace detail {
> > void __cdecl thread::fun(void* arg) {
> > try {
> > (*(boost::function0<void>*)arg)();
> > } catch(...) {
> > terminate();
> > }
> > }
> > }
> >
> > ref create(boost::function0<void> f) {
> > return ref(_beginthread(detail::fun,(void*)&f));
> > }
> >
> > class ref {
> > HANDLE id;
> > ref(HANDLE id) : id(id) {}
> > ...
> > };
> > }
>
> you are passing the address of creator's _local_
> variable to another (new) thread. you can not do
> it without extra synchronization. in the code above
> the local variable "f" could be reclaimed
> (create() returns) even before new thread would
> have a chance to use it in thread::fun. the code
> above is incorrect.
>
> correct solution (w/o extra synch) could be to "copy"
> "f" into C++ thread _OBJECT_ and let him manage it.
Ahem. That's only one correct solution. Beyond using extra synch
code you can also just copy f onto the heap and let the
detail::thread::fun() delete it.
Bill Kempf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk | https://lists.boost.org/Archives/boost/2001/07/14137.php | CC-MAIN-2020-29 | refinedweb | 182 | 69.79 |
got administrative rights and want to do
it yourself, you can use the
Code Access Security Policy Tool (Caspol.exe)
that ships with the .NET framework (helpful instructions can be found
here and
here).
Ext/Icons
No, this is not possible. In order to edit attachments, you need to save them to a
(temporary) file, edit it using an external application, import it back to KeePass as
attachment, and finally delete the temporary file.
There will no feature be implemented that automates these steps, because of security
problems. To see the problems, let's assume that KeePass would support editing attachments.
When you click a button, KeePass would save the attachment to a file and open it using
its associated external application. When the external application is closed, KeePass would
import the temporary file and delete it securely. But what happens when KeePass is closed
before the external application? KeePass cannot delete the file because it's eventually
locked by the external application. Theoretically KeePass could tell the user this fact
before closing, but what to do when the computer shuts down? Here, there's no time left to
ask the user what to do. The temporary file would have been leaked, i.e. left unencryptedly
on disk, which is obviously very bad.
One could argue that the leakage would only be temporary: at the next start, KeePass
could scan the temporary directory for remaining files and delete them. Anyway, the
files would be freely accessible (unencrypted) by all other applications during a complete
computer shutdown and boot process. If you don't start KeePass on this computer ever again,
the file is leaked forever. As KeePass is designed to be portable, i.e. may be securely
used on many computers, this temporary leakage is unacceptable.
KeeMiniMode=True
KeePass.ini automatically tries to lock its workspace when Windows is locked, with one
exception: when a KeePass sub-dialog (like the 'Edit Entry' window) is currently opened,
the workspace is not locked.
To understand why this behavior makes sense, it is first important to know what happens
when the workspace is locked. When locking, KeePass completely closes the database
and only remembers several view parameters, like the last selected group, the top visible
entry, selected entries, etc. From a security point of view, this achieves best
security possible: breaking a locked workspace is equal to breaking the database itself.
Now back to the original question. Let's assume an edit dialog is open and the
workstation locks. What should KeePass do now? Obviously, it's too late to ask the user
what to do (the workstation is locked already and no window can't be displayed),
consequently KeePass must make an automatic decision. There are several possibilities:
Obviously, none of these alternatives is satisfactory. Therefore, KeePass implements the
following simple and easy to understand behavior:
When Windows is locked and a KeePass sub-dialog is opened, the KeePass workspace
is not locked.
This simple concept avoids all the problems above. The user is responsible for the
state of the program.
Security consequence: the database is left open when Windows locks. Does this matter?
Normally, you are the only one who can log back in to Windows. When someone else logs in
(like administrator), he can't use your programs anyway. By default, KeePass keeps
in-memory passwords encrypted, therefore it does not matter if Windows caches the process
to disk at some time. So, your passwords are pretty safe anyway.
KeePass creates a temporary HTML file when printing password lists and showing
print previews. This file is securely erased (i.e. overwritten multiple times
before being removed from the file system tree). | http://www.keepass.info/help/base/faq_tech.html | crawl-001 | refinedweb | 611 | 56.76 |
” value. assign what is.
2) What’s wrong with this snippet of code?.
Dear Beloved Teachers Mr.Alex/Nas!
since a pointer is a variable that holds the address of a variable as its value,does the CPU instantiate a memory space for pointer it self ,to hold the value of another memory address that it points to? To make it clear Is there anything wrong with the below code please? please evaluate my understanding depend on the comments at the below code.
with huge respect and deepest love my dears!!
Pointer variables, just like all other variables, are stored somewhere in memory and thus have an address.
> Is there anything wrong with the below code please?
Yes. Every time you have that question you can just try to compile the code.
@ptr is an int*. @pointer is a pointer to an int* and needs to be of type int**.
Dear Mr Nas!
Thank you so much! I will read section 6.14. but please I kindly ask you to explain more starting from line 20. Specially how line 24( cout<<value)prints the &pointer(0x..f0)?
With respect sir.
I got line 24 wrong. It prints 7.
Line 20: abc is a variable, &abc is the address of that variable, *&abc gives you the value at the address of abc, which is the value of abc.
Line 22: @pointer is a pointer to a pointer to an int. *pointer is a pointer to an int. **pointer is an int. **pointer is equivalent to value.
Dear Mr.Nas
Thank you so much! You enable me to realize where my mistake was!
God bless you always!
Hi,
Quote 1:
"A dereferenced pointer evaluates to the contents of the address it is pointing to."
Quote 2:
"When a pointer is dereferenced, the application attempts to go to the memory location that is stored in the pointer and retrieve the contents of memory.
Or - Pointers are variables that hold a memory address. They can be dereferenced using the dereference operator (*) to retrieve the value at the address they are holding."
Let's start with the illustration in this lesson. Here are what I understand about ptr and variable value in the illustration:
. ptr holds address of variable value WITHOUT the content(5 is the content).
. Variable value has both address and the content.
Quote 1 makes more sense to me because *ptr gets the content that ptr is pointing to. It sounds to me like ptr is "looking at/pointing to" the address of variable value and trying to get the content from this variable value's address.
Quote 2, I am very confused with everything said in this quote because ptr holds only a memory address without the content, then how can *ptr retrieve the content at the address it is holding?
Hi Nguyen!
> ptr holds address of variable value WITHOUT the content
Correct
> Variable value has both address and the content
No. The variable value is 5, but this 5 is located at a specific address in memory. The variable doesn't know where it is stored, just like your house doesn't need to know where it is built. That's just where it lives. You can get the address of the variable by using @std::addressof or the addressof operator (&).
> It sounds to me like ptr is "looking at/pointing to" the address [...]
Correct
> how can *ptr retrieve the content at the address it is holding?
@ptr stores the address, so your computer goes to that address in memory and reads whatever is stored there.
You said "The variable value is 5, but this 5 is located at a specific address in memory (agreed). The variable doesn't know where it is stored (I am confused)"
Why am I confused? Please see below from lesson 1.3.
Yes, but that all happens at compile time. The compiler replaces every use of the variable @x with the address it chose to allocate @x at. The variable itself doesn't store this address.
As you can see from the code, we can manipulate the address and change its content.
My question is what if a malicious virus intentionally overwrites the address content to some
damaging instruction. Why would C/C++ allow this from happening?
[coded]
#include <iostream>
int main()
{
int x = 5;
std::cout << x << '\n'; // print the value of variable x
std::cout << &x << '\n'; // print the memory address of variable x
std::cout << &x+1<< '\n'; //add sizeof(int) bytes to the address
std::cout << *(&x+1) << '\n'; //dereference and show the content in the address
*(&x+1) = 9; //modify the content
std::cout << *(&x+1) << '\n'; //show the content again
return 0;
}
[/code]
Modern operating systems generally disallow programs from tampering with the memory spaces of other running programs for precisely this reason.
Your example only works because &x and (&x+1) are both allocated to the same program.
Hi,
Here are what I understand about the code step by step. I think I understand everything well except the last statement. I'm going to comment what I think is right in the last statement.
Please let me know what I understand about *ptr is correct.
Thanks, Have a great day.
You got everything correct!
Memory addrese is of type integer, right?
And we can assign any integer value to *ptr(which is an integer pointer and we are dereferencing it), right?
So in quiz ques 2,
*ptr=&value; (&value is of type integer), why does the compiler complain?
Thanks.
Hi Sagar!
> Memory addrese is of type integer, right?
No, integers can be any size and addresses can be any size. Usually integers are 4 bytes and addresses 4 or 8 bytes. If you need a data type that's guaranteed to be the same size as an address use @std::uintptr_t. It's an unsigned integral type.
> &value is of type integer
It's of type int*.
What's the basic difference between type int and int* ?
int* is a pointer type I know but can't we assign address of any variable to a integer variable like
int x ;
int y=&x;
And if we can, then the statement(*ptr=&value) in ques 2 should be valid
int is a integer, int* is an address in memory at which an integer is stored.
> but can't we assign address of any variable to a integer variable
You might be able to store an address in an int on some systems, but that's based on luck.
Alex and nascardriver! Does pointer just support copy assignment? Why?
I got *ptr = 7; as warning: 'ptr' is used unitialized in this function. Why?
Hi Samira!
You're trying to assign 7 to whatever @ptr is pointing to. But since you didn't point @ptr to anything it's uninitialized and will cause undefined behavior.
Will call the @operator= of the object or type @ptr is pointing to.
Hey there,
it is stated that putting the asterisk next to the variable name is preferred, i.e.
This seems unintuitive to me. First of all, I assume that I'll write functions which return a pointer more often than declaring several pointers in one line, so that
would be a more common use case than
If that assumption is true, then putting the asterisk next to the data type would lead to increased consistency.
Also, putting the asterisk next to the variable name makes it look like a dereference, which could be avoided.
And finally, for
the part before the whitespace indicates the data type, the part afterwards the variable name. I would argue, that
and
are distinct data types, rather than that the asterisk is part of the variable name.
Of course, I can do it whichever way I want, but as no explanation is stated above, I would like to hear your reasoning.
The recommendation for putting * next to the variable name and not the type is based solely on the multiple variable instantiation use case. The Google style guide says either way is fine, and recommend avoiding the multiple declaration case whenever mixed types are involved (which is a good recommendation). Practically speaking, either way is fine, and it's really your preference that dictates which you choose.
It didn't crash. it just printed out 1528349827. I'm disappointed; I was expecting fireworks.
Please open your computer. Next, strike it several times with a large hammer.
Dear LearnCPP,
May I ask if "Something *somethingPtr;" means the struct Something is initialized as a pointer in somethingPtr?
Hi VEDDEV!
Creates an uninitialized pointer that's supposed to be pointing to an object of type @Something. Variables should always be initialized.
Would you mind to elaborate further the usage of array pointers because I'm curious of getting nX, nX, and nZ via the array pointers.
I started to learn programming by manipulating memory of games. However, I have moved on to replicate game code by understanding how the game works so I can tell the game what to do like getting Entities' XYZ coords to create a map of where enemies are.
And, are you scraping every page of LearnCPP to be notified if there are new comments or you are a friend of Alex?
> Would you mind to elaborate further the usage of array pointers because I'm curious of getting nX, nX, and nZ via the array pointers.
> are you scraping every page of LearnCPP to be notified if there are new comments
Yes
You elaborated it very clearly, thanks! I'll try to apply this knowledge to practical code, game memory manipulation is a damn hard topic :<
Wow I assumed you must have struck a deal with Alex to give you some privileges in the comments. Never woulda thought you manually open every page to find new comments. That's some dedication!
> you must have struck a deal with Alex
Nope, I'm a regular user who wrote a script to get notified about new comments.
This doesn't work; I don't particularly want it to, but I do want to understand exactly why this breaks the program.
I think it's similar to the 'garbage pointer' example; we get 'permission' for a pointer to a pointer, but what the pointed-to pointer points to (is there clearer wording for this? :$), we never got 'permission' to access, it's uninitialized garbage, and to protect other applications the OS shuts my program down.
Alternatively, I thought that maybe whatever value ends up being accessed cant be implicitly cast to an int, causing the program to crash, but I'd expect the compiler to give me a warning or an error if that's the case, so my first guess seems more likely to me.
Am I understanding this correctly, or is this a different case? Thanks in advance!
EDIT: Messing about a bit more, it seems that dereferencing a pointer to location CDCDCDCD crashes it, which is (on my machine) the default for an uninitialized pointer. The garbage pointer in the example here points towards CCCCCCCC on my machine, also crashing on running. Are these default locations to prevent garbage output? Are they the 'protected' memory? Why is the one CDCDCDCD and the other CCCCCCCC (Probably has to do with one being a pointer and the other a pointer to a pointer?)?
I'm not sure if this knowledge will be useful to me at all, but at this point I can't back down from trying to understand what's going on!
Hi Mireska!
Your program consists of many different memory pages. Those pages have different flags:
- read (You're allowed to read from this page)
- write (You're allowed to write to this page)
- execute (You can execute code in this page)
Executable pages are usually not writable. Constants are stored in read-only pages. Non-readable pages are rare. Your program only uses as many pages as it needs, all addresses outside those pages cause a crash.
The binary produced by the code below has just 0x1140 readable addresses. That's 0.0001028% of all possible addresses in an x86 program, let alone x64. That's why it's unlikely to end up with a valid address.
How does the binary produce 0x1140 readable adresses? Or is that something unexplainable in a comment?
*ptrptr is undefined, but consistently gives me CDCDCDCD as output. What does this mean? I suppose, by definition, it doesn't mean anything due it being undefined, but it just feels weird to me that it still works, Trying to access, to dereference what is in location CDCDCDCD (which is not a good idea) causes the program to crash. Should I just see CDCDCDCD (and CCCCCCCC) as not memory locations at all, even though they, to my untrained eye, look like one? I suppose that makes it make sense that it crashes, as you can't go to a place that doesn't exist.
But then I still don't quite understand the 'A warning about dereferencing invalid pointers' part of the tutorial; this says the crash could be the OS protecting other applications. Is the CCCCCCCC/CDCDCDCD then just a placeholder name for an actual, protected location given to all uninitialized pointers? I'm sorry if I'm not making much sense; I'm new to the world of 0s and 1s and the shift from real to virtual is sometimes hard to make.
> How does the binary produce 0x1140 readable adresses?
The compiler decided that this is the amount of memory required to run the program.
> consistently gives me CDCDCDCD
Some compilers initialize all memory with a specific value (In your case 0xCD, msvc uses 0xCC) when building in debug mode to make it easier to sport uninitialized variables.
> should I just see CDCDCDCD (and CCCCCCCC) as not memory locations at all
They are memory addresses, they're just not in use by your program so you can't access them. It's like walking through a street and looking for a house number that doesn't exist, although it could potentially exist.
> OS protecting other applications
Each process has it's own virtual address space that is not shared with other processes. How this is done is OS specific.
could I know why the function is void foo(int *&p) but not void foo(int *p)?
Hi Aron!
Sample output
0x559c2bd6ae70
0
In your code, if you didn't pass @p by reference there would be no way to assign a value to @p.
Nascardriver's answer is good, but doesn't really nail the point succinctly.
The *& is syntax that allows the function to potentially modify the value of the pointer (even though it doesn't).
We're using this to trick the compiler into thinking foo() might assign a value to the pointer, so it won't complain about p being uninitialized.
Of course, we don't actually do that, so p is still uninitialized.
#include <iostream>
void foo(int *p)
{
}
int main()
{
int *p; // Create an uninitialized pointer (that points to garbage)
foo(p); // Trick compiler into thinking we're going to assign this a valid value
std::cout << *p; // Dereference the garbage pointer
return 0;
}
i run it in codeblocks(without using *& operator in foo i used only * operator) but compiler is not complaining at compile time so what is the need to trick the compiler.although it may crash at run time.
some compiler like visual studio will through an error on compile time if you try to perform any operation on uninitialized pointer variable.
void foo(int *p)
{
}
int main()
{
int *p;
foo(p);
}
pointer is variable which holds the address of another variable.
but since here uninitialized pointer variable is passing as pass by value
so it is like
int *p;
int *p2 = p;
here p2 is supposed to hold the address which is stored in p but p itself is not holding any address
Thats why visual studio compiler will through an error. To make this code in compile state we are cheating with compiler by writing the code like this 'void foo(int *&p)', here p is passing as a pass by reference so the compiler will think that foo will modify the value so it will not complain.
I dont have any idea about the codeblock, may be internally codeblock compiler is assigning nullptr to uninitialized pointer. Thats why the code is running fine with void foo(int *p) in codeblock.
This comment is about editing comments: if you have
in the comment and then edit the comment, those tags don't seem to work anymore. My workaround was to copy the comment, delete the comment, and then create a new comment where I can paste the old edited comment.
In fact, that is how I got those tags to show properly in this comment!
Hi Peter!
Refresh the page after editing the comment. It's just a client-side issue.
Aha! Yes, my mistake. Thank you.
Not your mistake. It's something I need to fix. 🙂
The reason this happens is because when the lesson page is generated, the syntax highlighter plugin generates the code for all of the code snippets on the page. When you edit your comment dynamically (as text), the content of the comment gets updated dynamically, but the syntax highlighter doesn't get run again (it was never built to do dynamic updating). So you end up seeing the raw text rather than the snippetized version.
I need to figure out how to make the page refresh automatically after editing a comment.
In the section "Assigning a value to a pointer" I think it might be helpful to go over the various combinations of ordinary variable names and the * and & operators. Consider the following code and lines 7 through 10 in particular. I suggest an explanation of why each of those lines works or does not work.
In section "Assigning a value to a pointer" - in the sentence
"One of the most common things to do with pointers is have them hold the address of a different variable."
I did not understand why the word "different" was used. Wouldn't it be very rare to have an application that required a pointer to point to itself? In any case, an example of such an application might be interesting and helpful.
> an example of such an application
I doubt the existence of such an application.
Yes, I struggled with it as well, which is why I wondered why "different" was in there at all. The only thing I could think of was that doing so might be used to represent a null pointer that would always guaranteed that the address was accessible.
That's what nullptr is for (Lesson 6.7a)
I had not read the next lesson yet, so I went there at your good suggestion. However, I didn't see where Alex explained how nullptr was implemented. That would be both helpful and interesting.
I'm the kind of person who likes to know how things work. Another example is with the descriptions about scope. Rather than just memorizing a bunch of rules, it is easier for me to learn if I understand what the compiler and linker are actually doing.
I am worried there's not much to research about it's implementation.
Quote from cplusplus.com:
"Even though nullptr_t it is not a keyword, it identifies a distinct fundamental type"
> "One of the most common things to do with pointers is have them hold the address of a different variable."
The word "different" was used to indicate that pointers are rarely (never?) self-referential. Having the pointer point to null/nullptr is also common, but not what this particular statement is referencing.
As Nascardriver mentions, nullptr_t is a unique type that was designed to help disambiguate null pointers from integer 0. There's not much else to say about it, as the implementation details are compiler specific.
Hi Alex,
is there a convention for naming pointers?
especially those that point to dynamically allocated memory.
what would be an appropriate prefix or suffix?
Hi David!
There any many naming conventions.
I like hungarian notation (Modified to my liking) where pointers start with a lower case 'p' followed by the actual name.
Here's a table of 'normal' hungarian notation:
There isn't a standard prefix for these kinds of things. As Nascardriver points out, some users use a "p" prefix or "Ptr" suffix to denote that a variable is a pointer. This doesn't tell you whether the pointer is pointing to dynamically allocated memory or not though.
Personally, I don't think adding the prefix or suffix is valuable, since the strong typing system will rarely let you interchange a pointer and non-pointer value. Better to focus on making your variable names actually good.
PLZ ALEX reply this .
as per explanation of quiz question 2 in 6.7 introduction to pointers
int value = 5;
int *ptr = &value; // ptr points to value
*ptr = 7; // *ptr is the same as value, which is assigned 7(HOW A '7' CAN BE ASSIGNED TO '5' AS *ptr RETRIEVES THE VALUE OF VARIABLE "value" i.e. 5)
std::cout << value; // prints 7
the 3rd line also should not compile as [quiz 2nd question solution]:
the asterisk here represents a dereference, which is used to get the value that a pointer is pointing to. So this line says, “retrieve the value that ptr is pointing to (an integer here 5), and overwrite it with the literal 7). That doesn’t make any sense -- you can’t assigna literal to an integer literal!
Hi prince GUPTA!
Nascardriver's answer is correct. Just to be clear, *ptr is the same as value. We can use value in two contexts: as an l-value (e.g. value = 5) or as an r-value to be evaluated to produce a value (std::cout << value). *ptr works identically. We can use it as an l-value (*ptr = 7) or an r-value (std::cout << *ptr).
pointers don't store values [expletive removed]
From wikipedia ()
"... a pointer is a programming language object, whose value refers to (or "points to") another value stored elsewhere in the computer memory using its memory address".
Seems pretty clear that pointers have values, those values are just addresses.
Well that is true but I am sure that's not the context I was getting
[ Not nice comment removed ]
This is a lovely thread.
hey alex, this question is a bit off topic. I hope you won't mind.
So, I am having problem with this code
#include<iostream>
using namespace std;
int main()
{
char ch = 'a';
cout<<&ch;
}
when I ran it, it gave "a )"
what does this mean?"ch" does not take a valid address in memory?
std::cout treats objects of type char* as C-style strings, and will print characters until it hits a null terminator.
You've essentially told the compiler to print the character 'a' as a string -- so you get the 'a' as the first character, and then everything else beyond that is junk in memory.
Hi Alex
So how would you print out the address of ch in above?
Static_cast it to a void* and print that.
Hi Alex
Thanks for the rapid reply.
void* seems to work as a proxy for other data types too:
This question on address of a char has been a great aid to me in my learning of c++. Std::strings can be iniatialised with char pointers. Pointers even find use in other situation to mean a set of elements. Eg: sf::Text *text is an array of sf::Text elements. Because pointer is not smart you need to specify a size type for the number of elements. In the case of char pointers, the last element is a NULL value of 0
Name (required)
Website | http://www.learncpp.com/cpp-tutorial/67-introduction-to-pointers/ | CC-MAIN-2018-43 | refinedweb | 3,994 | 72.16 |
Introduction:
Sometimes we may need to make repeat single image(ex.21x20) across the windows phone background.It is very simple process and also may be useful requirement for you in future.Because it is good way for providing nice background in a page.lets understand the sample
Here i have following three small size images
Tile21x20.png Tile60x60.png Tile64x32.png
So output is after repeating above small images:
Source File at:RepeatImageSample
Building the Sample:
This sample is targeted on WindowsPhone 7.1 OS.
Description:
XAML
<Window.Background> <ImageBrush ImageSource="Images/Tile21x20.png" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"/> </Window.Background>
The WPF TileBrush has properties such as TileMode, Viewbox, and ViewportUnits that can be used to tile an image as a fill or as a background for a UI Element. For some reason, they’re not implemented in Silverlight/WindowsPhone. And please read more about this. So the only way of achieving this are writing something yourself or using a component .OK lets start with following steps:
Step1:
After downloading this sample,unzip it and add TilePanel.cs class to your project.
Step2:
Add the namespace to your xaml page
XAML
xmlns:Repeat="clr-namespace:ReapetImageinWP"
Step3:
Then you can use it as follows in your XAML:
XAML
<Repeat:TilePanel <Repeat:TilePanel.Image> <ImageBrush ImageSource="Images/Tile21x20.png" /> </Repeat:TilePanel.Image> </Repeat:TilePanel>
The panel will be filled with the image specified in your XAML. Adjust image and size as needed. sharing such an informative article. I really enjoyed it. Please visit | http://bsubramanyamraju.blogspot.com/2014/05/windowsphone-tilepanel-repeatingtiling.html | CC-MAIN-2017-34 | refinedweb | 258 | 52.36 |
!
!!!
There
Many times I have been asked about the new features in Team System 2010.
I have recently read a post by Brian Harry giving an overview of the new features in Team System 2010.
You can read the post here. overwriting local changes, so if you have deleted a file than the system sees it as an intention of making a change with the file, at that case deleting the file from the project. So at that case when doing Get Latest Version you will not get the deleted file.
Get Latest Version works in a check list method, means that when it gets a file from the server to your local file system it writes down the file and its version, it will not get that file again until the file version will be changed on the server.
In case you made local changes and changes have been made on the server the Get Latest Version will trigger the merge window in order to merge your local changes with the server changes.
Here are some examples:
Scenario 1: changes and you can still see them.
Scenario 2:
You trigger a Get Latest Version and get all the files from the server, one of the files is test.txt and its version on the server is V5. You delete the file. you don’t check in the deletion. file system and you find that the file is missing.
Scenario 3:6 for test.txt and on the last Get Latest Version you got V5. The source control also see that your local version contains changes, so it triggers the merge tool.
So we can see the most common scenarios that can happen with the Get Latest Version, I hope that now its mechanism is clear and there will be less night work for me ;-)
The…
I.
I will start by explaining what is a test plug-in and than I will show how to create one.
Web Test Plug-in is used to do the following:
So, how do I create a Web Test Plug-in?
Step 3: Add the following using: using Microsoft.VisualStudio.TestTools.WebTesting; using System.ComponentModel;
Step 4: Next step is to add the following, see that you override only what you need:
namespace TestPlugin {
[DisplayName("Web Test Plug-in Name")] [Description("Web Test Plug-in Description")] public class MyWebPlugin : WebTestPlugin { public override void PreRequest(object sender, PreRequestEventArgs e) { base.PreRequest(sender, e); }
public override void PostRequest(object sender, PostRequestEventArgs e) { base.PostRequest(sender, e); }
public override void PreWebTest(object sender, PreWebTestEventArgs e) { base.PreWebTest(sender, e); }
public override void PostWebTest(object sender, PostWebTestEventArgs e) { base.PostWebTest(sender, e); }
public override void PrePage(object sender, PrePageEventArgs e) { base.PrePage(sender, e); }
public override void PostPage(object sender, PostPageEventArgs e) { base.PostPage(sender, e); }
public override void PreTransaction(object sender, PreTransactionEventArgs e) { base.PreTransaction(sender, e); }
public override void PostTransaction(object sender, PostTransactionEventArgs e) { base.PostTransaction(sender, e); } } }
Step 5: Now add a reference from your test project to the Web Test Plug-in project.
Now the Web Test Plug-in is available.
So How can I use it?
Step 1: Click the “Add Web Test Plug-in” button.
Step 2: Choose the Web Test Plug-in to use and click OK
Run the test and see the result of the Web Test Plug-in.
I.
Scrum!!! | http://blogs.microsoft.co.il/blogs/srlteam/archive/2009/04.aspx | crawl-003 | refinedweb | 561 | 72.97 |
Overview
Atlassian Sourcetree is a free Git and Mercurial client for Windows.
Atlassian Sourcetree is a free Git and Mercurial client for Mac.
Signature Survey
This is an adoption of Ward Cunningham's Signature Survey.I am using it as a kata whenever I wan't to learn a new programming language.
A signature survey is a print of all Statements (;) and Blocks ({}) of a program that was written in a C-Family language (Java, CSharp, C, Cpp, etc. ). It is supposed to be a method to browse the source code of a large and unfamiliar software. Although it is meant to generate browsable, nested reports, I found that it does not have to be browsable to be useful. The 'signature' of a program is the simplest form of visualization one can create and can be interpreted as a simple form of code metric. Rather than installing NDepend or a large measurement solution on a foreign machine, you can easily checkout or download the 50 LOC python script and run it. It gives you immeadiate feedback on the health of a solution. Look out for patterns, repetitions and other things. You can quickly identify unhealthy spots.
Use
For a C# program, the signature might look like this:
LogOff.cs (21): ;{{{}{}{;;}}}
MainViewModel.cs (103): ;;;;;;{{;;;;;;;;;{;;;}{{;}{;}}{{;}{;}}{{;}{;}}
MainWindow.xaml.cs (42): ;;;;;{{;{;;;}{{;}}{;;;}{;;}}}
MenuItemExtension.cs (17): ;;;{{{{;}}}}
MouseWheelGesture.cs (56): ;{{{}{}{;;}{{{};}}{{{};}}{{{};}}{{{};}}{;;;
MutuallyExclusiveCheckBoxes.cs (42): ;;{{{;}{;}{;;;;}{;}{;}{;}}}
Each Line shows the signature of a single file like this:
<Name> (Lines Of Code): ;;;; {;;} {;;}
Where ;; are statements and { } are code blocks (Namespaces, Classes, Methods, If-Blocks and so on)
What to look out for
In different languages different patterns emerge.
MainWindow.xaml.cs (42): ;;;;;{{;{;;;}{{;}}{;;;}{;;}}}
Imports (Usings)
This file is quite short (42) lines of code. The first couple of semicolons in a C# file are the usings. In Java these might be the imports. The first opening curly brace is usually the namespace, the second opening curly brace just after that is the class in that file. For the same most files end with }} (closing curly of the class and namespace).
If the file starts with a myriad of semicolons you can tell without ever visiting the file, that the class inside must be doing a lot, since it has so many different namespaces to include.
Constructors and Fields
Depending on the author's programming style, the first opening curly brace inside the class is the constructor. A big constructor is a bad thing. You want it to be short. Also look out for everything inbetween the constuctor and the namespace/class declaration, these are usually data fields. Too many data fields indicate a data structure, rather than an object and could show violations of the OO paradigm from a high level perspective.
Properties
Especially auto properties in C#, which look like this:
public string Name { get; set; }
Result in a pattern like this {;;}. Just like a lot of data fields, too many properties could show that the class publishes data, rather than hiding it.
Repetitions
Apart from the code-related patterns above, you should look out for anything that might look suspicious. The overall look of the report will indicate whether the solution is healthy. Many short files are good, too many big files are bad. Long streams of curlybraces indicate deep nesting (bad), long streams of semicolons indicate too many statements or too long methods (also bad, at least for OO code). The overall differences count. If you find something like this in a report, you might wan't to check it out:
MainViewModel.cs (180): ;;;;;;{{;;;;;;;;;{;;;}{{;}{;}}{{;}{;}}{{;}{;}}{{;}{;}}{;;;;;}{;;}{;}{;{;;}}{;}{;;}{;;;;}}}{;;}{;}{;{;;}}{;}{;;}
MainWindow.xaml.cs (42): ;;;;;{{;{;;;}{{;}}{;;;}{;;}}}
Look out for averages. If the overall solution contains hundreds of files with an average LOC count of 50 and suddenly there is a file with LOC > 3000, you might want to check out exactly that file. Maybe some time I will actually make this browsable with hyperlinks, but so far it's already a really helpful tool to get a good overview for a random solution. Thanks, Ward! | https://bitbucket.org/marcells/signaturesurvey | CC-MAIN-2018-17 | refinedweb | 658 | 64.61 |
High performance computing made quite some progress lately. Maybe you heard about the reactive manifesto (you should if you are a reader of this blog ;-)), if not, it is an interesting readying … if nothing else as a conversational icebreaker.
Basically the manifesto preaches for systems more responsive and reliable by reacting to requests and dusting it into smaller requests processed by smaller and autonomous systems. This is nothing new, but quite far from traditional processing where single monolitic application took care of requests from reception to response.
There are several programming patterns useful for implementing a reactive system, channels (and streams which are quite the same thing) are one of them. A channel allows you to define a data flow with inputs, computation units, merge, split and collector of information coming in sequence into your system. Once the dataflow is defined, the data flows into it and results come out from the other end.
In this talk Felix Petriconi describes his implementation of channels for C++. You can find the slides here and the video here. As for all the other talks I’m writing about, errors and mistakes are just mine. (It is worth noting, here as in the other posts about this conference, that I am rebuilding this from the notes I took during the conference and not from the videos. It is very possible I missed something or got it messed up during the expansion of my notes).
Channels are useful, not only for water
Felix Petriconi
The C++ language is too large for anyone to master. So everyone lives within a subset.
(Sean Parent C++Now 2012)
C++11 introduced concurrent programming primitives. These tools have a low level of abstraction making it hard to develop and maintain concurrent programs.
I’ve been collaborating with Sean Parent on a new concurrent library for C++: stlab. Concurrent programming is no longer an option, since when chip technology reached a plateau where increasing clock frequency started generating heat faster then we are able to extract from the chip itself.
The only way we have now to increase computational power in a single chip is to increase the number of computing cores. As Herb Sutter wrote in 2005 – the free lunch is over.
So, now we have many cores and the problem of concurrent programming. According to the Amdahl’s law the speed up increase versus the number of cores is not linear because of the synchronization overhead.
How can we use multiple cores?
- One single thread process per core. This is simple because no synchronization is needed among processes. Facebook tried this solution in the past. Nonetheless the hardware needs to synchronize memroy access, since the memory is shared.
- Multi threaded process without synchronization. I.e. every thread does something different and does not share resources, so synchronization is not needed.
- Multi threaded process with low level synchronization (mutex, semaphores, memory fences and transactional memory).
- Multi threaded process with high level synchronization (futures, actors, channels).
Futures
Future (see also my post) is a meachanism (developed in 1977/78) to decouple a function from its result. A function is called and magically its result will appear in the future.
Futures can be combined together using continuations – results from one or more futures can be collected together and fed to another future, oe the result can be split among two or more futures.
Futures work great if you have a single value to calculate.
Channels
Channel is another high level mechanism for modeling concurrent programming. It has been devised in 1978 by C.A.R. Hoare. At the core, a channel allows the creation of a persistent execution graph [NdM: by employing channels you basically design the dataflow, letting the channel support take care of the concurrency and synchronization details]. The channels is fed by a sender, several processes are chained together to produce the response and the receiver gets the result.
Here is how it looks a channel using the stlab library:
stlab::sender<int> send; stlab::receiver<int> receiver; std::tie(send, receiver) = stlab::channel<int>(stlab::default_executor); auto printer = [](int x ){ std::cout << x << '\n'; }; auto printer_process = receiver | printer; receiver.set_ready(); send(1); send(2); send(3);
In order to allocate computations to threads an executor is needed. The default executor uses the system thread pool.
Computation blocks are executed asynchronously w.r.t. the
send() instructions.
New edges of the data flow can be concatenated together with the
operator|(). In this way the same producer can be chained to multiple receivers:
auto [send,receive] = channel<int>.. auto printerA = [](int x ){printf("Process A %d\n", x );}; auto printerB = [](int x ){printf("Process B %d\n", x );}; auto printer_processA = receive | printerA; auto printer_processB = receive | printerB; <pre class="enlighterjsraw" data-receiver.set_ready(); send(1); send(2); send(3);
The opposite operation – i.e. merging multiple channels into a single receiver – is more convoluted since you may want different behaviors (stlab name in parenthesis):
- downstream processor is invoked when all its inputs are ready (join)
- downstream processor is invoked in a round robin fashion with data from its inputs (zip)
- downstream processor is invoked as soon a data from one of its input is ready (merge)
Unfortunately these names are not so good since they are different from what is coming in C++.
Here an example about join:
using namespace stlab; int main() { auto [sendA,receiverA] = channel<int>( default_executor ); auto [sendB,receiverB] = channel<int>( default_executor ); auto printer = []( int a, int b ) { printf( "Process %d %d\n", a, b ); } auto print_process = join( default_executor, printer, receiverA, receiverB ); receiverA.set_ready(); receiverB.set_ready(); sendA( 1 ); sendA( 2 ); sendB( 3 ); sendA( 4 ); sendB( 5 ); sendB( 6 ); int end; std::cin >> end; return 0; }
The output is:
Process 1 3 Process 2 5 process 4 6
Note that the sender is never blocked.
You can add options in the stream. E.g.:
- With
buffer_size{n}within concatenation says that it is possible to limit the incoming queue to size n.
- With
executer{ex}within concatenation it is possible to specify a specifc executor for what follows. eg. immediate_executor
using namespace stlab; int main() { auto [send,receiver] = channel<int>( default_executor ); auto printerA = []( int x ) { printf( "Process A %d\n", x ); }; auto printerB = []( int x ) { printf( "Process B %d\n", x ); }; auto printer_processA = receiver | printerA auto printer_processB = receiver | (executor{ immediate_executor} & printerB )}; receiver.set_ready(); send( 1 ); send( 2 ); send( 3 ); int end; std::cin >> end; return 0; }
The
immediate_executor immediately executes the task in the caller thread context. [NdM: I haven’t notes about this, and the slides don’t offer the solution, but I’m pretty sure, the code above is going to print:
Process B 1 Process B 2 Process B 3 Process A 1 Process A 2 Process A 3
Unless the current thread is somewhere preempted before send statements are completed (it could be since main thread will perform some I/O).]
There is no a try_send operation to get a
false if the spool is full. So you just send data and hope for the best. Buffers are allocated on the heap and implemented using deques.
Stateful process
Not all useful process are purely transformational, some of them require that the processor held a state across data flow.
States make things more complicated.
In order to define a stateful processor, you need to define a class with a specific signature:
#include <stlab/concurrency/channel.hpp> enum class process_state { await, yield }; using process_state_scheduled=std::pair<process_state,std::chrono::steady_clock::time_point>; struct process_signature { void await(T... val ); // not a real template. This function needs // many agruments as inputs U yield(); // return the result. process_state_scheduled state() const; // scheduling info // optional methods below void close(); void set_error( std::excpetion_ptr); };
Now let’s suppose we want to create an adder that sums all the integer flowing through it and produce the result. The adder is going to be used like this:
struct adder { // to be defined }; int main() { auto [send,receiver] = channel<int>( default_executor ); auto calculator = receiver | adder{} | [] ( int x ) { std::cout << x << '\n'; }; receiver.set_ready(); while( true ) { int x; std::cin >> x; send( x ); } return 0; }
The adder is instantiated at the end of the channel. Input is taken from the command line and sent (forever) to the channel.
Let’s write an adder that takes a series of integers from the standard input and prints the sum when the user enters 0 (digit zero).
struct adder { int _sum = 0; process_state_scheduled _state = await_forever; void await( int x ) { _sum += x; if( x== 0 ) { _state = yield_immediate; } } int yield() { int result = _sum; _sum = 0; _state = await_forever; return result; } auto state() const { return _state; } };
That’s fine, but we can’t make assumptions on external entities, we have to grant service level for our part. So, what happens if the user falls asleep or goes aways? Well, it would be nice, that after some time, let’s say 15 seconds, if no new number is typed, the sum is printed anyway.
This can be implemented by using the second part of the state type:
struct adder { int _sum = 0; process_state_scheduler _state = await_forever; void await( int x ) { _sum += x; if( x == 0 ) { _state = yield_immediate; } else { _state.first = process_state::await; _state.second = std::chrono::steady_clock::now() + std::chrono::seconds( 15 ); } } int yield() { int result = _sum; _sum = 0; _state = await_forever; return result; } };
This is very convenient, especially if you compare it with an alternative implementation based on callbacks.
Conclusions
The idea behind the channels is to exploit the cores as much as possible.
Lessons learned:
- do not try to implemnet your thread pool. It is easy to get them wrong. Use the ones provided by your operating system. Probably you can’t do better.
- Design your application with the mindset that it can run dead-lock free on a single core machine.
- Don’t let your application be pested by threads, mutex and atomics, because it very easy to use them badly and thus causing hard to find bugs. | https://www.maxpagani.org/2018/08/19/it18-channels-are-useful-not-only-for-water/ | CC-MAIN-2021-31 | refinedweb | 1,655 | 52.6 |
[vc_row][vc_column][vc_column_text]In this tutorial, we are going to look at how you can install and configure CodeIgniter. They are two ways of installation CodeIgniter. You can download the latest version from the CodeIgniter website, or you can use a tool like a composer to automate the installation
In this tutorial, you will learn:
- Download Latest CodeIgniter Framework
- What is Composer?
- How to install Composer
- CodeIgniter Config Files
- CodeIgniter Configurations
- How to remove index.php in CodeIgniter
Download and Install Latest CodeIgniter Framework
The source code for the CodeIgniter framework is available on the official CodeIgniter website. If you want to download the latest version of the framework, then you should do it from the official web page.
Step 1) Open the following URL in your browser
The image below shows the download link to the latest version of the framework
Step 2) Clicking the above link will download the framework as a zipped folder. Unzip the contents of CodeIgniter-3.1.10.zip
Step 3) Let’s say you want to create a project called the online store. You can follow the following steps to start your project. Create a new directory in on your development drive, e.g, D:\Sites\online-store
Step 4) Open the contents of CodeIgniter-3.1.10, you should be able to see the following files
Copy the above contents to your project directory, e.g., D:\Sites\online-store
Step 5) Just to make sure everything is ok, open the terminal and start the built-in PHP server
cd D:\Sites\ online-store
Run the following command
php -S localhost:3000
load the following URL into your browser
If you see above image, all is working well,
What is Composer?
The composer is a package management system for PHP. A package is simply a collection of PHP scripts that work together towards a single goal. Based on this definition, CodeIgniter can even though it’s a framework, qualifies to be labeled a package in composer terminologies.
The following image shows how the composer works
The author of CodeIgniter hosts the package at Packagist which is a central repository for PHP packages, etc.
When the developer runs the composer command to download CodeIgniter, Composer communicates with Packagist and downloads the latest release of the package. In addition to installing frameworks such as CodeIgniter, Composer can also be used to;
- Install individual packages such as third-party email or database library
- Update existing packages
- Remove installed packages
How to install Composer
Step 1) Load the following URL in your browser
Download the setup and follow the installation instructions.
Step 2) Open the command prompt/terminal
Run the following command
composer
You will see the following results
If you can see the above results, then congratulations, you have successfully installed the composer.
Let’s now create a new project called online-store
Run the following command
composer create-project CodeIgniter/framework online-store
HERE,
- composer create-project CodeIgniter/framework online-store composer invokes the composer program, create-project downloads the specified project framework which is in the namespace CodeIgniter.
You should be able to see results that is similar to the following
If you are a big fan of commands on the terminal then this is the way to go otherwise you can use the good old fashioned download the zipped file, unzip and happy coding.
CodeIgniter Config Files
Now that we have successfully installed CodeIgniter let’s look at the configuration directory
The configuration directory is located in
application/config
HERE,
- autoload.php – specifies the helpers, libraries, drivers, packages, etc that should be loaded when the application starts
- config.php – contains application configurations such as base url, language, query strings, etc.
- constants.php – as the name suggets, this file I used to define application constants
- database.php – contains database connection parameters
- doctypes.php – defines document types i.e. html4, html5, sv10 etc
- foreign_chars.php – defines foreign characters that are to say characters that are found in languages such as Russian and others
- hooks.php – allows you to define your own hooks
- memcached.php – if you are using CodeIgniter together with Memcached then you can use this file for configurations.
- migration.php – if you want to use database migrations in CodeIgniter then you can use this file to config the settings.
- mimes.php – contains file mime types
- profile.php – contains settings that ae used by the built-in CodeIgniter compiler
- routes.php – contains the application routes
- smileys.php – contains settings for smileys
- user_agents.php – contains settings for browser user agents, i.e., Chrome, Opera, Firefox, etc.
CodeIgniter Configurations
let’s now make some of the most common settings in CodeIgniter
Open application/config/config.php
Base URL
$config['base_url'] = '';
Sets the base URL. If its blank then CodeIgniter will set it for you automatically. If you want to be explicit about your base URL, then you can use the something like the following
$config['base_url'] = '';
HERE,
- $config[‘base_url’] = ‘’; sets the base URL to localhost running on port 3000.
Class Prefix
CodeIgniter uses the prefix CI_Classname. As a best practice and to avoid collisions with internal classes, you can prefix your class, i.e., MY_Classname. The following line is used to set your class prefix
$config['subclass_prefix'] = 'MY_';
Query Strings
These are parameters that are visited in the URL, i.e., example.com/index.php?q=eggs. If you would like to use such URLs, then you will have to set
$config['enable_query_strings'] = FALSE; To $config['enable_query_strings'] = TRUE;
Other settings
They are many settings that you can set in config.php including date formats, cache and view paths, etc. much of what you configure depends on your application needs
How to remove index.php in CodeIgniter
CodeIgniter is an MVC framework. This means it has a single entry point into the application which is index.php. It doesn’t matter what URL you access. The all go through index.php. by default, index.php is shown in the URL as shown in the example below
example.com/index.php?q=eggs
The URL looks longer and weird. The good thing is you can configure CodeIgniter to remove that.
Open application/config/config.php
Locate the following line
$config['index_page'] = 'index.php'; Set it to the following $config['index_page'] = '';
HERE,
- We are using mod_rewrite to remove the page so as per requirement, this should be set to blank.
Next, we need to create the .htaccess that rewrites the URLs
Add a new file .htacces in the root directory of the application
Add the following code
RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA]
HERE,
- The above code is for configuring web servers that run apache server. The above code basically gets the URI parameters and executes them via index.php even if it’s not showing in the browser URL.
Summary
- They are two ways of installation CodeIgniter. You can download the latest version from the CodeIgniter website, or you can use composer to automate the installation
- The composer is a package management system for PHP
- A composer can be used for: Install individual packages, Update existing packages remove installed packages
[/vc_column_text][/vc_column][/vc_row] | https://www.thehackingcoach.com/how-to-download-install-codeigniter-composer-configuration-included/ | CC-MAIN-2022-40 | refinedweb | 1,201 | 55.54 |
Opened 10 years ago
Closed 9 years ago
#4813 closed (fixed)
Strange behaviour on locale using fastcgi and method=prefork
Description
During using manage.py runfcgi method=prefork there is a strange behaviour, propably connected with gettext cache - random requests serve untranslated string. With method=threaded everything is ok. I hacked utils/translation/trans_real.py file for my own needed and it works:
def gettext(message): """ This function will be patched into the builtins module to provide the _ helper function. It will use the current thread as a discriminator to find the translation object to use. If no current translation is activated, the message will be run through the default translation object. """ from django.conf import settings _default = translation(settings.LANGUAGE_CODE) return _default.gettext(message)
Change History (6)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
comment:4 Changed 9 years ago by
comment:5 Changed 9 years ago by
comment:6 Changed 9 years ago by
Given the lack of response or confirmation in over four months, I'm going to close this. Can be reopened if somebody can repeat the problem with a recent subversion checkout.
Note: See TracTickets for help on using tickets.
Looking at the comment and the use of _default, this isn't version 0.96 code at all. It's something more recent. Changing the version string.
The above change won't work in general, since it assumes you only ever want to use settings.LANGUAGE_CODE. It also wallpapers over whatever the real problem might be. I have no idea what the root cause is at the moment, though. Needs more investigation. | https://code.djangoproject.com/ticket/4813 | CC-MAIN-2017-09 | refinedweb | 282 | 66.84 |
.
When they call Ruby "Perl's younger, prettier sister," they speak the truth. The syntax is a clean and, for the most part, concise. When it's not the most concise, I find that it is because a little bit of sugar has been added instead. I don't think that it is very comparable to Python. I've looked at Python and have decided it is overrated. Ruby, on the other hand, is nice. Here are some of the things I like:
Regexp: Ruby provides a builtin Regexp (notice different spelling) class. It is just like Perl's, except you would say /pattern/ =~ "string" instead of "string" =~ /pattern/. Ruby also fills all the regex variables ($`, $1, $2, etc.) like Perl.
Threading: Although I've not done any threading in any langauge, it seems to be the consensus that Ruby makes it surprisingly simple.
Loops: I really like Ruby's loops. They are one of the occasions where a little bit of typing has been added to make things cleaner. The first example is Perl, the second is Ruby.
foreach ($i=3;$i<19;$i++) {
print $i;
}
3.upto(18) do |i|
print i
end
[download]
class Numbers
def gimme
3.upto(10) { |number|
yield(number)
}
end
end
Numbers.gimme { |number| puts number }
[download]
Operator Overloading: This isn't something that is uncommon in OO langauges, but it is lacking, as far as I know, from Perl's. Take this as an example: You're working on image manipulation. This requires you to create a list of lists. We'll assume that we've already made the lists. In Ruby you would have to write a simple 10-15 line class for this example. To access this in Perl, you would write $image[$x][$y]. In Ruby you could make it do this image[x,y]. True, there's not much difference, but with lots of code this can really make things more readable.
Class and Object variables: Ruby provides a nice clean interface to different types of variables. To have object variables in Perl, you must have a, in my opinion ugly, %self that contains all your info and is then passed to all the methods. In Ruby, this is much cleaner. All object variables are simply prepended with an @. All class variables, which are the same for all objects in that class, are prepended by 2 @'s. All global variables are prepended by a $. This may look confusing at first for a Perl programmer. Whenever I see a variable with an @ in front, I want it to be an array. But you get over that fairly soon.
Similarity: Besides all these differences, and some more, Ruby is very like Perl. As Deprecated mentioned, many things are very intuitive, or actually the same, to a Perl programmer.
This doesn't mean that I will be abandoning Perl at all. In fact, coding Ruby has actually made me like Perl more. It is really good to shake things up once in a while. Perl just has something about it though. Maybe this is because it's my first programming language. I don't know, but I'd encourage everyone, especially the "for fun" programmers, to take a look.
elusion :
Regexp: In Perl you put the string on the left. In
Ruby you can put the string on the left and the pattern on
the right, or vice versa. Normally I would write it
the same in both languages. What is going on is that =~ is
a method of both String and Regexp, for no particular reason
than to provide a little syntactic sugar.
Ruby's threading is cooperative inside of the language.
You could implement using class Continuation. This does
not give you access to OS level threads. You cannot,
for instance, use Ruby's threading and blocking system
or database calls. So it is there, kind of. But it isn't
really useful for anything I would want threads for.
Loops In Perl you appear to still be using C-style
for loops. Use more Perlish foreach loops and you will
avoid most off by one errors. For instance your example
is better written in Perl as:
foreach my $i (3..18) {
print $i;
}
[download]
Blocks are just syntactic sugar around anonymous
subroutines. You can do it in Perl. You just need to
write a few sub declarations. But you won't get the core
of the language to make widespread use of it without a
significant rewrit. So Perl is able to do
it, you just don't have the sugar.
Operator Overloading Perl has this. See overload.
However Ruby's overloading model is much more consistent and
fine-grained than Perl's. Everything is an object. Redefine
the methods you want. (Except for the comparison operator on
a string for a sort. Grrr...)
Class and Object variables This is one place that
Ruby shines relative to Perl. Ruby's OO model is much
cleaner, and writing classes and methods is so much nicer
than in Perl.
And now for the points you missed, good and bad.
First the summary. Ruby is Smalltalk's OO model, with a
grammar that is meant to look a bit like Perl's, and a class
system designed around emulating Perl. Plus a few Lispish
goodies thrown in because Matz likes them. As a result you
have at your fingertips most of the basic data manipulation
conveniences of Perl, but in a much simpler language, with
a dynamic type system.
But there are differences. Ruby is much simpler than Perl,
much more consistent, has a lot of familiarity, and has a
far cleaner OO model. Ruby's syntax and type system are
separate, for instance write a hash access, array access,
and call an anonymous function with foo[bar].
Therefore a large amount of Perl's syntax can be thrown
out, while maintaining a far finer-grained type system than
Perl has. For instance a Float and an Integer are
different things in Ruby, and while with Integer arithmetic
you will never overflow, with Floats you have the usual
constraints. This also means no autovivification.
Unlike Perl, Ruby has true garbage collection. This means
a cleaner interior, fewer memory leaks, but you don't get
deterministic destructors.
And there are some bad points. First of all Ruby doesn't
have CPAN. Secondly Ruby doesn't have any equivalent of
strict.pm, and I definitely missed it. Thirdly Ruby has
optional semi-colons at the end of lines, sometimes if you
leave one off you can get a multi-line statement, and
sometimes not. This is a design decision that complicates
the grammar a lot and can make it hard to tell sometimes
where a line ends. And last, but not least, Ruby is a much
younger language than Perl. Expect to find bugs from time
to time...
Hey Tilly. If one knows Lisp, Smalltalk, and Perl
(hey, I get to mention my three favorite languages all at once! :-)
what new ideas would one learn from Ruby? I've had it on a
(very) back burner for a while to look at, but the answer
to that question hasn't been clear to me, so I've never gotten
around to it, though I'd be glad to if I were convinced it
would teach me something.
Interesting note, deprecated. I'd be very interested to see someone (*cough* TheDamian *cough*) do a comparison of Ruby and the new features in Perl 6. It seems some of the benefits that people list for Ruby are the same as some of those I've heard for Perl 6.
I have to tell you, though, that "it's a cleaned-up Perl" doesn't sell me on the language at all. In my personal experience, that argument has always been bogus. The most glaring example I know of was when, many moons ago, C++ was called a "cleaned-up" C. Around 1993, I had been writing C for several years (and enjoying it), so I learned C++, to the point where I even got paid for writing a class library or two. A few years later, I took another look and recoiled in horror. C++ had become a byzantine, complicated, hodge-podge that completely missed what to me was the strongest point of C: a simple mental model. When I looked at a C program, I felt like I knew what was going on underneath it all. With C++, I had no idea.
Perl leaves me with the same feeling: when I look at a piece of code, I can build a simple mental picture of what's happening (Erudil's code being a glaring exception ;-). What I'm wondering now is which of Perl 6 or Ruby is more likely to make me say, "Oh, I see, how obvious."
I'd be very interested to see someone do a comparison of Ruby and the new features in Perl 6.
In fact, I foresee a three-way comparison -- with Ruby and Python.
But we need to get Perl 6 a little more fully mapped out before we can start comparison-selling it. For example, the most meaningful comparisons can't be made at all yet, because we haven't finalized the Perl 6 OO mechanisms.
Just to detail why I thought they felt the same..
1) No sigils (yeah.. I know there's other languages like this)
2) no semi-colons (I guess tilly mentioned that they are sometimes optional?)
3) if foo > 2 instead of if (foo > 2)
4) end statements for conditionals and iteration.
Anyway, I'd say it feels like Perl meets VB.
/me dons his flame retardant suit :)
Rich
p.s. - thanks brother dep for giving me a reason to check it out.
For instance, take a look at Ruby's comparison page. It's improvements over Perl are: nicer syntax, different default scoping, cleaner integration of object-orientedness. The first two hardly make for a decisive argument. The OO integration model is nicer than Perl but I don't think that this alone make for a compelling argument to switch to Ruby.
I might be prejudiced here, but I basically believe that many who like Perl do so because it's a very free-form language, suitable for quick hacks. Thats my 2 cents anyway.
However as I mentioned at the top I have never taken a significant amount of time to try and implement anything in Ruby. What about anybody else? Does anyone with experience of Perl and Ruby want to share their feelings?
...there is no 'cran'
Actually, there is a CRAN but it's for the R programming language (a GNU version of the S/S-Plus languages) which is a mathematical language for computational. | http://www.perlmonks.org/?node_id=126047 | CC-MAIN-2016-40 | refinedweb | 1,798 | 74.39 |
Hi,
I'm new to JBoss and EJB and I was wondering if anyone knows whether the JBoss MBeans are lookup-able and callable from an EJB client just like other EJB objects?
Regards,
Peter
You need to use one of the jmx connectors/adaptors.
e.g. The RMIAdaptor
Search the JMX forum for details.
Or examine the jboss testsuite which uses the
RMIAdaptor to deploy tests remotely on the
MainDeployer MBean.
There are also some open source ant tasks
that can invoke MBeans remotely, I can't remember
the links.
You will find JBoss's version in
{jboss.home}/client/jbossjmx-ant.jar
but it isn't well documentated.
Regards,
Adrian
Hi Adrian,
Thanks for the feedback. I actually can view and call the MBeans from my browser via the jmx-connector, or the Management Console JMX Agent as they call it.
But let's say I have an java client that uses the jndi to lookup and call the EJB, can I use it to lookup the MBeans and call them? and if yes, what would be the home object namespace that I should use, provided I include my local machine in the url.
Regards,
Peter | https://developer.jboss.org/thread/74628 | CC-MAIN-2018-39 | refinedweb | 198 | 71.44 |
Deploying Phoenix to production using Docker
This is a short tutorial on how we at Recruitee are running Phoenix and other Elixir applications with Docker. On production.
Why would you want to do this?
The main reason for choosing Docker was the unification of deployment. We are using many different technologies ranging from Ruby/Rails, Elixir/Phoenix to Java, Python or even PHP. Simply put, we want to use the best tool for the job, and while we would love to use only a single language/platform (Elixir/BEAM) for everything it just isn’t possible.
With Docker containers we can have a single deployment mechanism no matter what technologies are used inside.
How to Docker in the real world
The Docker’s promise is that with a single
Dockerfile you will be able to build a runnable image
that you can put straight into production. While this statement is true, the “runnable image” part is not enough.
With the standard approach you will end up with huge images containing all compile-time dependencies
that are not necessary at all in runtime.
That’s why we decided to use a two-step process - we separate building the app (compiling, making a release) from running it.
The next part takes Elixir as an example, but we apply the same principles to all our images. (For example, the runtime container with JavaScript client app has only compiled code without unnecessary npm dependencies).
Putting Phoenix app inside Docker image
As mentioned before, building a Docker image is a two-step process:
- Build phase
- Install Erlang
- Install Elixir
- Run
mix deps.get
- Run
mix release
- Save myapp.tar.gz release package
- Release phase
- Install Erlang
- Extract myapp.tar.gz release package from build phase inside container
- Done!
Since we use the same process for all our elixir apps, we’ve made a simple package that does all of the above in just a few mix commands - mix_docker.
Introducing mix_docker
mix_docker provides a handful of mix commands to make putting elixir apps inside Docker images as simple and repeatable as possible. It is based on Paul Schoenfelder’s excellent distillery package and alpine-erlang lightweight Docker image.
Here are six steps from zero to a ready Docker image.
1. Add “mix_docker” to
mix.exs:
def deps do [{:mix_docker, "~> 0.2.2"}] end
2. Configure image name in
config/config.exs:
config :mix_docker, image: "teamon/demo"
3. Initialize release configuration:
mix docker.init
This will run distillery init and create a
rel/config.exs file.
We do not need to change it - the default values are ready for Docker out of the box.
4. Build the release:
mix docker.build
This will create the
teamon/demo:build image with
demo.tar.gz release package inside.
5. Build the minimal release image:
mix docker.release
This will extract
demo.tar.gz and put it in a minimal Docker image ready to be run in production.
These images are typically few times smaller than the build ones.
6. Finally we can publish our release image into Docker Hub
mix docker.publish
This will tag the release image with current version based on app version in mix.exs,
current git commit count and git sha, e.g.
0.1.0.253-158c4a45c1.
The full image name will be
teamon/demo:0.1.0.253-158c4a45c1.
There is also a shortcut command
mix docker.shipit that will run build, release and publish.
Configuring dockerized applications
Since production releases do not contain Mix, the easiest way to provide runtime configuration is to use ENV variables.
The default Docker images provided by mix_docker contain
REPLACE_OS_VARS=true, so all you need to do is to prepare
config/prod.exs in the following way:
config :demo, Demo.Endpoint, server: true, # use {:system, var} if library supports it http: [port: {:system, "PORT"}], # use ${VAR} syntax to replace config on startup url: [ host: "${APP_DOMAIN}" ] config :demo, Demo.Mailer, adapter: Bamboo.MailgunAdapter, api_key: "${MAILGUN_API_KEY}"
You can read more about runtime configuration in distillery docs.
Remember to rebuild you image after changing the config!
Running the app
Now we are ready to run the app like any other Docker container.
docker run -e PORT=4000 teamon/demo:0.1.0.253-158c4a45c1 foreground
Using remote console
Since docker containers are self-contained in order to connect to running node using remote_console you need to exec into running container:
docker exec -it CID /opt/app/bin/demo remote_console
That’s it!
One of the implicit benefits of using ENV variables to configure application in runtime is that we are able to use the exact same image to both staging and production (changing only domains, api keys, etc.) which gives us much more confidence when deploying to production.
In the upcoming post I’ll go through deploying these Docker containers with Rancher and connecting multiple instances into single Erlang cluster. | http://teamon.eu/2017/deploying-phoenix-to-production-using-docker/ | CC-MAIN-2019-18 | refinedweb | 810 | 57.57 |
Featuritis is a condition in which the functionality of an application increases with each revision (and such, complexity increases). The functionality that aggravates this condition is usually that which a single user (or group) requests (or is given) without consideration of the implications it has on the rest of the users, interface, and experience the application is meant to address.
Don Norman goes in to great length about this in The Design of Everyday Things: "Complexity probably increases as the square of the features: double the number of features, quadruple the complexity. Provide ten times as many features, multiply the complexity by one hundred."
Adding functionality and features to an application are not bad things, if the benefits are kept in balance with the necessary learning, memorability, and ease-of-use required of the application. These additions become negative when the features obstruct unrelated tasks (cluttered or confusing interface), are not worth the training time (a lot of learning for a simple or infrequently used task), cost more to develop than will return (ROI), and etc.
As Creating Passionate Users describes it:
This is where good usability engineering comes in to save the day. Good user profiles, requirements analysis, usability and ROI goals can help identify a good feature from a bad feature. Some features may be harder to evaluate and may require additional user profiling or usability testing to see if it is really something users want. Ideally, features which may cause featuritis can be identified early on, and eliminated or evolved to provide a better experience with the application.
The moral of the story? Just because you can, doesn't mean you should. Bigger isnt always better if you can't use the tool. And sometimes you may just need some TLC from your friendly usability geek.
Isn't this a supporting case for Plugins/Extensions? It seems to work fairly well for the applications that use such an architecture.
KDE has an awesome component system. Users/System Admins/Distributor should be able to tweak apps to their needs WITHOUT patching the piss out of them. If features in our image viewers where plugins my wife could have a SIMPLE image viewer that could zoom and rotate images. That's all she cares about.
I dislike the notion of "bad feature". Usability is also just a feature. And users want features since they equal this with usefulness (who doesn't like taking the famous "bloated" swiss knife when backpack tarvelling). What they tend not to like is being faced with complex interfaces and having to look up how to do this and that (equal extra work, equal a decrease in the perception of usefulness). "Featuritis" thus is a misnomer since not the feature itself matter (they may well be useful by itself) but the way they are presented, organized, how easily they are findable and usable in a particular user's workflow without hindering. People who know about the features can adapt their workflow, but adapting ideally shouldn't be necessary. I know that in effect I would most likely be saying and proposing the same, but it's exactly this used vocabulary (the words I put in quotes above) which in my experience makes many (technical) people wary of anything declared "usabilitiy", and this isn't neccessary imo.
Usability is not a feature, it is a requirement.
Saying usability is a feature is like saying good code is a feature, or that it runs every time you execute the application is a feature. Its part of the development cycle, its not something you add on after the fact.
As for the swiss army knife, you take it with you for backpack travelling, but you dont use it at the dinner table. Sure, it has a cork screw for that bottle of wine, several blades of choice to dissect your meal, and a tooth pick for after dinner, but are you really going to use it?
Dont get me wrong, complex tasks, have complex interfaces, but they can still be usable. Its when the over abundance of features interferes with understanding of the application, learnability, satisfaction, performance, etc. that it becomes a negativism. What happened to K.I.S.S? An application can do too much, especially if it is many things not well.
As a developer there are perhaps two thing that can save a project from a premature featuritis:
* stick to the usecases
* learn to say no
Power-user (representing a minority of the users) often have very strong opinions on what should be done and can persuade developers fairly easily. Some developers are also very sensitive to users feedback and do not always have clear objectives (especially when they code for the fun of it).
Syndicate Blogs | http://www.kdedevelopers.org/node/1551 | crawl-002 | refinedweb | 792 | 51.38 |
- Customizing QtWidgets
- Subclassing QWidget
- Integrating Custom Widgets with QtDesigner
- Double Buffering
5. Creating Custom Widgets
- Customizing Qt Widgets
- Subclassing QWidget
- Integrating Custom Widgets with Qt Designer
- Double Buffering
This chapter explains how to develop custom widgets using Qt. Custom widgets can be created by subclassing an existing Qt widget or by subclassing QWidget directly. We will demonstrate both approaches, and we will also see how to integrate a custom widget with Qt Designer so that it can be used just like a built-in Qt widget. We will round off the chapter by presenting a custom widget that uses double buffering, a powerful technique for high-speed drawing.
Customizing Qt Widgets
In some cases, we find that a Qt widget requires more customization than is possible by setting its properties in Qt Designer or by calling its functions. A simple and direct solution is to subclass the relevant widget class and adapt it to suit our needs.
In this section, we will develop the hexadecimal spin box shown in Figure 5.1, to demonstrate how this works. QSpinBox supports only decimal integers, but by subclassing it's quite easy to make it accept and display hexadecimal values.
Figure 5.1 The widget
#ifndef HEXSPINBOX_H #define HEXSPINBOX_H #include <QSpinBox> class QRegExpValidator; class HexSpinBox : public QSpinBox { Q_OBJECT public: HexSpinBox(QWidget *parent = 0); protected: QValidator::State validate(QString &text, int &pos) const; int valueFromText(const QString &text) const; QString textFromValue(int value) const; private: QRegExpValidator *validator; }; #endif
The HexSpinBox inherits most of its functionality from QSpinBox. It provides a typical constructor and reimplements three virtual functions from QSpinBox.
#include <QtGui> #include "hexspinbox.h" HexSpinBox::HexSpinBox(QWidget *parent) : QSpinBox(parent) { setRange(0, 255); validator = new QRegExpValidator(QRegExp("[0-9A-Fa-f]{1,8}"), this); }
We set the default range to be from 0 to 255 (0x00 to 0xFF), which is more appropriate for a hexadecimal spin box than QSpinBox's default of 0 to 99.
The user can modify a spin box's current value either by clicking its up and down arrows or by typing a value into the spin box's line editor. In the latter case, we want to restrict the user's input to legitimate hexadecimal numbers. To achieve this, we use a QRegExpValidator that accepts between one and eight characters, all of which must be in the set {'0', ..., '9', 'A', ..., 'F', 'a', ..., 'f'}.
QValidator::State HexSpinBox::validate(QString &text, int &pos) const { return validator->validate(text, pos); }
This function is called by QSpinBox to see if the text entered so far is valid. There are three possible results: Invalid (the text doesn't match the regular expression), Intermediate (the text is a plausible part of a valid value), and Acceptable (the text is valid). The QRegExpValidator has a suitable validate() function, so we simply return the result of calling it. In theory, we should return Invalid or Intermediate for values that lie outside the spin box's range, but QSpinBox is smart enough to detect that condition without any help.
QString HexSpinBox::textFromValue(int value) const { return QString::number(value, 16).toUpper(); }
The textFromValue() function converts an integer value to a string. QSpinBox calls it to update the editor part of the spin box when the user presses the spin box's up or down arrows. We use the static function QString::number() with a second argument of 16 to convert the value to lowercase hexadecimal, and call QString::toUpper() on the result to make it uppercase.
int HexSpinBox::valueFromText(const QString &text) const { bool ok; return text.toInt(&ok, 16); }
The valueFromText() function performs the reverse conversion, from a string to an integer value. It is called by QSpinBox when the user types a value into the editor part of the spin box and presses Enter. We use the QString::toInt() function to attempt to convert the current text to an integer value, again using base 16. If the string is not valid hexadecimal, ok is set to false and toInt() returns 0. Here, we don't have to consider this possibility because the validator permits only valid hexadecimal strings to be entered. Instead of passing the address of a dummy variable (ok), we could pass a null pointer as the first argument to toInt().
We have now finished the hexadecimal spin box. Customizing other Qt widgets follows the same pattern: Pick a suitable Qt widget, subclass it, and reimplement some virtual functions to change its behavior. If all we want to do is to customize an existing widget's look and feel, we can apply a style sheet or implement a custom style instead of subclassing the widget, as explained in Chapter 19. | http://www.informit.com/articles/article.aspx?p=1405227 | CC-MAIN-2018-34 | refinedweb | 777 | 50.36 |
nvme-get-log man page
nvme-get-log — Retrieves a log page from an NVMe device
Synopsis
nvme get-log <device> [--log-id=<log-id> | -i <log-id>] [--log-len=<log-len> | -l <log-len>] [--namespace-id=<nsid> | -n <nsid>] [--raw-binary | -b]
Description
Retrieves an arbitrary NVMe log structure may be returned in one of several ways depending on the option flags; the structure may be displayed in hex by the program or the raw buffer may be printed to stdout for another program to parse.
Options
- -l <log-len>, --log-len=<log-len>
Allocates a buffer of <log-len> bytes size and requests this many bytes be returned in the constructed NVMe command. This param is mandatory.
- -i <log-id>, --log-id=<log-id>
Sets the commands requested log-id to <log-id>. Defaults to 0.
- -n <nsid>, --namespace-id=<nsid>
Sets the command’s nsid value to the given nsid. Defaults to 0xffffffff if not given. This option may not affect anything depending on the log page, which may or may not be specific to a namespace.
- -b, --raw-binary
Print the raw log buffer to stdout.
Examples
Get 512 bytes from log page 2
# nvme get-log /dev/nvme0 --log-id=2 --log-len=512
The above example will get log page 2 (SMART), and request 512 bytes. On success, the returned log will be dumped in hex and not interpreted by the program.
Have the program return the raw log page in binary:
# nvme get-log /dev/nvme0 -log-id=2 --log-len=512 --raw-binary > log_page_2.raw # nvme get-log /dev/nvme0 -i 2 -l 512 -b > log_page_2.raw
It is not a good idea to not redirect stdout when using this mode.
Nvme
Part of the nvme-user suite
Referenced By
nvme(1). | https://www.mankier.com/1/nvme-get-log | CC-MAIN-2018-22 | refinedweb | 300 | 71.44 |
Qt Test
Qt Test provides classes for unit testing Qt applications and libraries. All public methods are in the QTest namespace. In addition, the QSignalSpy class provides easy introspection for Qt's signals and slots.
Getting Started
To enable Qt Test in a project, add this directive into the C++ files:
#include <QtTest>
To link against Qt Test, add this line to the project file:
QT += testlib
Articles and Guides
Licenses and Attributions
Qt Test is available under commercial licenses from The Qt Company. In addition, it is available under the GNU Lesser General Public License, version 3, or the GNU General Public License, version 2. See Qt Licensing for further details.
Furthermore Qt Test potentially contains third party modules under following permissive licenses:. | http://doc-snapshots.qt.io/qt5-dev/qttest-index.html | CC-MAIN-2017-17 | refinedweb | 124 | 53.61 |
TenkoTenko
A "pixel perfect" 100% spec compliant JavaScript parser written in JavaScript, parsing ES6/ES2015 - ES2021.
REPL:
- Supports:
- Anything stage 4 up to ES2021
- Regex syntax (deep)
- Parsing modes:
- Sloppy / non-strict
- Web compat / AnnexB
- Strict
- Module
- AST
- Is optional, enabled by default
- Estree (default)
- (Optional chaining AST works but AST spec seems still in flux)
- Acorn
- Babel (anything stage 4, except comments)
- Supports location data (matching Acorn/Babel for reference)
- Tests
- 33k input syntax tests
- Passes test262 suite (at least as per March 2020), without exception
NameName
The name is short for "The Parser Formerly Known As ZeParser3".
It's also an anagram for "Token", perfectly fitting this project.
In Japanese it's a divine beast ("heavenly fox" or "celestial fox"), playing into my nicknames.
REPLREPL
You can find the REPL in
repl/index.html, github link:
The REPL runs on dev master branch and needs a very new browser due to es module syntax.
UsageUsage
import {Tenko, GOAL_MODULE, COLLECT_TOKENS_ALL} from 'src/index.mjs'; const { ast, // estree compatible AST tokens, // array of numbers (see Lexer) tokenCountSolid, // number of non-whitespace tokens tokenCountAny, // number of tokens of any kind } = Tenko( inputCode, // string { // Parse with script or module goal (module allows import/export) goalMode = GOAL_MODULE, // GOAL_MODULE | GOAL_SCRIPT | "module" | "script" // Do you want to collect generated tokens at all? collectTokens = COLLECT_TOKENS_ALL, // COLLECT_TOKENS_ALL | COLLECT_TOKENS_SOLID | COLLECT_TOKENS_NONE | COLLECT_TOKENS_TYPES | "all" | "solid" | "none" | "types" // Apply Annex B rules? (Only works in sloppy mode) webCompat = true, // Start parsing as if in strict mode? (Works with script goal) strictMode = false, // Output a Babel compatible AST? Note: comment nodes are not properly mirrored babelCompat = false, // Add a loc (with `{start: {line, column}, stop: {line, column}}`) to each token? babelTokenCompat = false, // Pass on a reference that will be used as the AST root astRoot = null, // Should it normalize \r and \r\n to \n in the .raw of template nodes? // Estree spec but makes it hard to serialize template nodes losslessly templateNewlineNormalization = true, // Pass on a reference to store the tokens tokenStorage = [], // Callback to receive the lexer instance once its created getLexer = null, // getLexer(lexer) // You use this to parse `eval` code allowGlobalReturn = false, // Target a very specific ecmascript version (like, reject async). Number; 6 - 12, or 2015 - 2021, or Infinity. targetEsVersion = lastVersion, // (Last supported version is currently ES2021) // Leave built up scope information in the ASTs (good luck) exposeScopes = false, // Assign each node a unique incremental id astUids = false, // Do you want to print a code frame with error messages? (Part of the input around the point of error) errorCodeFrame = true, // For the code frame, do you want to always show the entire input, regardless of size? Or just a small context truncCodeFrame = true, // You can override the logging functions to catch or squash all output $log = console.log, $warn = console.warn, $error = console.error, // Value ot use for the `source` field of each `loc` object sourceField = '', // Generate a `range: {start: number, end: number}` property on all loc objects (does not require `locationTracking`) ranges = false, // Generate a `range: [start: number, end: number]` property on all nodes. `input.slice(range[0], range[1])` should get you the text for a node. nodeRange = false, // Do not populate loc properties on AST nodes (property will be undefined). Since v<unpublished> locationTracking = true, } );
DevelopmentDevelopment
There is a single entry point in the root project called
t which calls
tests/t.sh which calls out to various development related scripts.
ES modulesES modules
Note that the files use
import and
export declarations and
import(), which requires node 10+ or a cutting edge browser.
At the time of writing node requires the experimental
--experimental-modules flag.
It's a burden in some ways and nice in others. A prod build would not have any modules.
Test casesTest cases
All test cases are in "special" plain-text .md files. See
tests/testcases/README.md for details on formatting those.
Entry pointEntry point
Some interesting usages of
./t:
# Show help ./t --help # Run and update (inline) all tests. # Use git diff to see changes. Will bail fast on unexpected or assertion errors. # This tests four modes (sloppy, strict, module, and sloppy-web-compat) # This also tests the printer on the first successful parse ./t u # Run all tests step-by-step (same as above) and ask what to do for any changes ./t m # Same as `./t u` but compare it against Babel or Acorn. Recorded changes should be discarded afterwards. # Use this to test against AST differences. If there are any they will be printed explicitly. # Acorn: ./t a # Babel: ./t b # Test a particular input from cli ./t i "some.input()" # Test a particular test file ./t f "tests/testcases/regexes/foo.md" # Use entire contents of given file as input ./t F "test262/test/annexB/built-ins/foo.js" # Generate prod builds # Generate a build. Strips ASSERT*, inline many constants ./t z # Same as above but explicitly set `acornCompat` and `babelCompat` to `false`. ./t z --no-compat # Generate pretty builds for debugging without asserts: ./t --pretty # Minified build with Terser (will lower performance due to inlining) ./t --min # Run test262 tests (requires cloning into tenko/ignore/test262) ./t t # Fuzz the parser ./t fuzz # Regenerate all autogen test files. Regenerates files still need to be updated (`./t u`). # All files, regardless: ./t g # Only create new files: ./t G # Find out which tests execute a particular code branch in the parser # Add `HIT()` to any part of the code in src # Reports (only) all inputs that trigger a `HIT()` call in Tenko ./t s
Some tooling that requires additional setup;
# Benchmarks (requires benchmark files in projroot/ignore/perf); # Simply spawn new node process and run test: ./t p # Run benchmarks repeatedly and report results ./t p6 # Configure machine to be as stable as possible (DANGEROUS, read the script before using it, requires root). All # changes should be reset after reboot. Then run the benchmarks in the shielded cpus at RT prio (also requires root). ./t stable ./t p6 --stabled # Same as above but without running `./t stable` previously, and tries to undo certain (but not all) things afterwards ./t p6 --stable # Investigate v8 perf regressions with deoptigate: ./t deoptigate # Profile the parser in Chrome devtools (open the tab through `about://inspect`) ./t devtools # Run a visual heatmap profiler for counts based investigation (private) ./t hf
There are many flags. Some are specific to an action, others are generic. Some examples:
--sloppy Run in non-strict mode (but non-web compat!) --strict Run with script goal but consider the code strict --module Run with module goal (enabling strict mode by default) --web Run with script goal, non-strict, and enable web compat (AnnexB rules) --annexb Force enable AnnexB rules, regardless of mode 6 Run as close to the rules as of ES6 / ES2015 as possible 7 Run as close to the rules as of ES7 / ES2016 as possible 8 Run as close to the rules as of ES8 / ES2017 as possible 9 Run as close to the rules as of ES9 / ES2018 as possible 10 Run as close to the rules as of ES10 / ES2019 as possible 11 Run as close to the rules as of ES11 / ES2020 as possible 12 Run as close to the rules as of ES11 / ES2021 as possible 2015 2016 2017 2018 2019 2020 2021 --min Given a broken input, brute force minify the input while maintaining the same error message --acorn Output a Acorn compatible AST --babel Output a Babel compatible AST --test-acorn Compare the `--acorn` output to the actual output of Acorn on same input (./t a) --test-babel Compare the `--babel` output to the actual output of Babel on same input (./t b) --test-node Compile input in a `Function()` and report whether that throws when Tenko throws, for fuzzer --build Use a prod build (from standard output location), instead of dev sources, for all actions that support it --nb Do not build (many actions will kick of a build before doing their thing, this prevents that)
And many more. For details,
./t --help should give you an up to date list of all actions and options.
BuildingBuilding
While the parser runs perfectly fine in dev mode it will be a bit slow. A build:
- will remove non-assert dev artifacts
- can remove inline asserts (lines that start with
ASSERT)
- can remove all the AST generation from the build (lines that start with
AST)
- inlines many constants used by the parser as enums or bitwise fields
To generate a build run this in the project root, flags can be combined:
./t z # Regular build with everything ./t z --no-ast # Strip most AST related code from the build (~50% faster, but obviously no AST) ./t z --no-compat # Strip acorn/babel compatibility ./t z --min # Run Terser on result (will decrease performance due to inlining) ./t z --pretty # Run Prettier on build result
Note that this (initially) uses my own printer to print the AST.
The build script writes and ESM and CJS file to
./build
Validation without ASTValidation without AST
The no-AST build can validate JS almost as perfect as the regular build except for certain validation cases where it requires the AST:
- Binary op after arrow with block body (
()=>{}*xis illegal)
- Regular expression on new line after arrow with block body (
()=>{} \n /foo/g, prohibited by ASI rules and can't be a division)
- Update operator anything that's writable but not a valid var or member expression (
++[])
- Delete with an ident that is wrapped in parenthesis (
delete (foo)is illegal), trivial cases (
delete foo;) should be fine
TestingTesting
Each test is individually encapsulated in an
.md file in
tests/testcases/**. This file will contain the input code and the output as expected for sloppy mode, strict mode (script goal), module goal, and web compat mode (only works in sloppy mode, script goal).
If a run passes then the AST and types of tokens are printed in the output. This AST is also printed with
src/tools/printer and its output is checked to produce the same AST.
If a run does not pass the error message and a pointer to where the error occurred are stored in the file.
The files can be auto-updated with
./t u or
./t m. This makes it easy to update something in the parser and use git to confirm whether anything changed, and if so what.
There are also
autogen.md files, which generate a bunch of combinatorial tests (
./t g or
./t G), similar to the other tests.
To create a new test simply add a new file, start it with
@, a description, a line with only
### and the rest will be considered the test case verbatim. When you run the test runner this file will automatically be converted to a proper test case. | https://www.npmjs.com/package/tenko | CC-MAIN-2022-05 | refinedweb | 1,799 | 62.88 |
fwide − set and determine the orientation of a FILE
stream
#include <wchar.h>
int fwide (FILE* stream, int mode);
When mode is zero, the fwide function
determines the current orientation of stream. It
returns a value > 0 if stream is wide-character
oriented, i.e. if wide character I/O is permitted but char
I/O is disallowed. It returns a value < 0 if
stream is byte oriented, i.
The fwide function returns the stream’s
orientation, after possibly changing it. A return value >
0 means wide-character oriented. A return value < 0 means
byte oriented. A return value zero means undecided.
ISO/ANSI C, UNIX98
fprintf(3), fwprintf(3)
Wide-character output to a byte oriented stream can be
performed through the fprintf function with the %lc
and %ls directives.
Char oriented output to a wide-character oriented stream
can be performed through the fwprintf function with
the %c and %s directives. | https://alvinalexander.com/unix/man/man3/fwide.3.shtml | CC-MAIN-2019-09 | refinedweb | 153 | 58.48 |
When I look back at many of the C projects I've contributed to, I find that many of them suffer from a common form of structural clutter. I'm sure you've seen similar patterns:
int foo(char c) { int r = 0; my_mutex.lock(); file_t fhandle = fopen("blah.bin"); if(fhandle == NULL) { my_mutex.unlock(); return -1; } // Do some stuff {...} if(some_test) { //Do some stuff {…} if(some_other_test) { //FAIL! fclose(fhandle); my_mutex.unlock(); return -1; } } else { //FAIL! fclose(fhandle); my_mutex.unlock(); return -1; } // Do Some other stuff {...} //Ok - Exit my_mutex.unlock(); fclose(handle); return r; }
What is a programmer to do? You have to ensure that your mutex is unlocked before you leave a function, or else your program is going to deadlock. You have to release that file when you're done with it, or the next attempt to open that file will result in failure. Similar structural clutter can be seen with dynamic memory allocations or any other operation that you must logically undo.
These "cleanup" requirements are why I (and many other programmers) espouse a single function exit point. Unfortunately, when I do encounter a single exit point, I usually see another negative pattern: using a
goto statement to jump to a
cleanup section:
int foo(char c) { int r = 0; my_mutex.lock(); file_t fhandle = fopen("blah.bin"); if(fhandle) { //Do some stuff {...} if(some_test) { //Do some stuff {...} if(some_other_test) { //Fail! r = -1; goto cleanup; } } else { //Fail! r = -1; goto cleanup; } //Do some stuff {...} } cleanup: if(fhandle) { fclose(fhandle); } my_mutex.unlock(); return r; }
Structural clutter aside, programmers have to remember to undo specific operations before they exit a function. Anytime I'm required to remember a bunch of details, it increases the chances that I will forget one and introduce a bug into my program. I can't begin to count the number of times I've debugged a problem only to end up finding a resource that wasn't cleaned up properly!
Luckily, C++ gives us a pattern that can help us solve this structural problem: Scope-Bound Resource Management (SBRM). Using SBRM, we can rely on classes which handle their own resource management. Instead of worrying about obtaining and releasing underlying resources, we are able to focus on the higher level logic.
What is SBRM?
SBRM is a programming idiom used in some object-oriented languages such as C++. You will also see SBRM referred to as "Resource Acquisition is Initialization" (RAII). I find that "scope-bound resource management" provides a much clearer meaning than "resource acquisition is initialization", so I will continue to use SBRM in this article.
With SRBM, a class is responsible for acquiring and releasing its underlying resources. Resource allocation/acquisition is handled during construction, and cleaning up said resources is handled during destruction. By utilizing the constructor and destructor we can ensure that the resource is tied to the object's lifetime. As long as we are destructing objects that hold resources, we don't have to worry about leaking those resources.
This example, lifted from the Wikipedia SBRM entry, illustrates SBRM with both a
std::lock_guard and a
std::ofstream file. Notice that there is no use of the boilerplate
mutex.unlock() or
file.close() operations.
#include <mutex> #include <iostream> #include <string> #include <fstream> #include <stdexcept> void write_to_file (const std::string & message) { // mutex to protect file access (shared across threads) static std::mutex mutex; // lock mutex before accessing file std::lock_guard<std::mutex> lock(mutex); // try to open file std::ofstream file("example.txt"); if (!file.is_open()) throw std::runtime_error("unable to open file"); // write message to file file << message << std::endl; // file will be closed 1st when leaving scope (regardless of exception) // mutex will be unlocked 2nd (from lock destructor) when leaving // scope (regardless of exception) }
No matter how we leave a function (exception or normal exit), the destructors for objects declared within that scope will always be called, ensuring that we will not leak any objects or forget to clean up any resources. Look for areas in your code where you are manually undoing an operation. You will likely find that SBRM is a viable strategy in those areas.
Benefits of SBRM
In my mind, the primary benefit of utilizing SBRM is encapsulation. Resource management logic is contained within the class itself. This logic is defined and implemented once, rather than at each call site (as in C). Once I create an object, I can trust that it will be cleaned up correctly. I don't have to remember to do anything at all: it just works.
By improving our software's encapsulation we help simplify our code into more manageable units. State management, error recovery, and exception handling for our resource can all be contained in one central location. As the complexity of managing that resource increases, we know that it will increase in a single location rather than throughout our program.
Structurally, SBRM reduces programming overhead and improves readability. We can eliminate the resource acquisition, extra conditional checks, and close/release/free calls from our functions. By separating the acquisition and cleanup from our core logic, our functions become more readable and the functional logic becomes the primary focus.
When utilizing the stack, SBRM also enforces reverse-order clean-up. As long as you are creating objects in the correct order, they will be cleaned up in the correct order. No more risk of releasing your mutex before finishing with the resource you are guarding!
By abstracting away underlying details, we reduce the cognitive load and free up valuable mental space for higher level details. Since we've reduced the set of details that a programmer has to remember, we've increased the chances of our program operating correctly. Our code becomes safer since the compiler is handling the acquisition and cleanup invocations for us, reducing the chances of resources being left dangling.
Common Use Cases
Generally, any resource that you would need to manually clean up can likely be handled with SBRM:
- Mutexes
- Synchronization primitives, such as critical sections (commonly found in embedded systems)
- Files
- Sockets / network connections
- Database handles
- Dynamically allocated memory
Regarding the C++ standard library, classes which manage their own resources follow SBRM principles. For example, you can utilize:
The standard library provides wrappers to enable SBRM concepts:
std::shared_ptrand
std::unique_ptract as an SBRM wrappers for dynamically allocated memory
std::lock_guard,
std::unique_lock, and
std::shared_lockprovide RAII wrappers for managing mutex locking/unlocking
For C++ examples of SBRM, please refer to the links above. The examples tend to be pretty trivial, since the pattern results in pushing resource management into an object's constructor/destructor.
Implementing your own SBRM-compatible classes is easy: Simply make sure that your constructor and destructor correctly handle acquiring and releasing resources.
Costs and Limitations of SBRM
The primary difficulty with utilizing SBRM is getting ownership right. You must have a clear idea of who should own your object, the desired lifespan, and when ownership needs to be transferred to another object. The lifetime of stack-allocated objects is easily understood, as you can expect destructors to be called once you exit a function. This is not to say that SBRM only works for objects allocated on the stack. I utilize SBRM within classes that are declared on the heap. For example, consider a USB device container: when the USB device is removed, the USB stack deletes the container and the underlying resources are cleaned up correctly.
The runtime costs of utilizing SBRM are minimal. There is little-to-no additional storage overhead for utilizing SBRM instead of manual resource acquisition APIs. You are calling a non-trivial constructor/destructor, but often our constructors and destructors can be inlined by the compiler. Even if your constructor is not inlined, you've simply added the cost of an extra function call. Encapsulating complex behavior into functions is a tradeoff we frequently make elsewhere in our programs.
Debugging code utilizing SBRM can be more frustrating, as you now have to step through your constructors and destructors in order to see the action happening. However, you generally won't find yourself stepping through constructors and destructors once you have verified the correctness of your class.
Make sure the purpose and usage of your SBRM-enabled class are clear and understood. You should be making lives easier, not making your program harder to understand.
Further Reading
If you still have questions about SBRM/RAII, I recommend reading the links below. | https://embeddedartistry.com/blog/2017/7/17/migrating-from-c-to-c-take-advantage-of-raiisbrm | CC-MAIN-2017-43 | refinedweb | 1,410 | 54.42 |
Getting Torque To Work
Although Torque is a great tool and remarkably effective once you get it going, many people have trouble setting it up. The documentation seems particularly weak in this area (possibly because there are so many different databases, drivers, and parameters to consider.)
This document is an attempt to help people figure out what's going wrong with their setup by listing the problems and solutions that other people have had.
PLEASE, PLEASE, PLEASE!! If you have had problems setting up Torque and solved them, add your experiences to the list. The more people who contribute, the better the document!
Installing. My problem was that I couldn't generate the java source code by running ant -f build-torque.xml. Everything else was working perfect, I got no error messages from Ant, sql code was generated and I could run that to generate my mysql database and tables and everything else. My mistake was that I wasn't setting the right name for my database schema xml file. If the project name in build.properties is "pitchers" ("torque.project = pitchers"), the schema xml file (in the schema folder) needs to be named as "pitchers-schema.xml" i.e in the format "project-schema.xml"
Might be a dumb mistake but that's what it was.
Vikas
Another note on this issue---I was working from a database to XML, and was confused by the fact that when a schema is generated by from an existing database it is called schema.xml rather than xxx-schema.xml. It took me ages to work out that i had to rename to schema.xml to xxx-schema.xml, but after I had the .java files were generated correctly. Maybe the solution to this confusion is to have turbine issue a helpful warning message when it finds schema.xml but not xxx-schema.xml?
tbd
2. My problem turned out to be fairly simple to fix. When I was browsing the site I didn't find any references to what column types were allowed. I mistakenly put LONG and BOOLEAN in. This causes the build to fail without any information on what went wrong or where. After I changed my types to BIGINT and BIT everything worked correctly.
Getting a Torque application to run from the command line
This is a listing of the typical problems people have trying to get their first Torque Application to run.
When you're using ant 1.4.1 you'll have this error when trying to execute jdbc ant task.
{{{ Error "Could not create task of type: torque-jdbc-transform"
- ant -f build-torque.xml jdbc Buildfile: build-torque.xml jdbc:
["echo"] +
+
- ["echo"] | | ["echo"] | Generating XML from JDBC connection ! | ["echo"] | Woo hoo! | ["echo"] | |
["echo"] +
+
- BUILD FAILED
- .../build-torque.xml:351: Could not create task of type: torque-jdbc-transform
due to java.lang.VerifyError: (class: org/apache/torque/task/TorqueJDBCTransformTask, method: generateXML signature: ()V) Incompatible object argument for function call Total time: 1 second }}}
Typical eror when using torque with Ant 1.4.1. You need Ant 1.5.1 to use torque.
tbd
Getting Torque to run within a web-server
This section deals with the trials and tribulations of getting your web-applications Torque-enabled.
There are several steps to help check that Torque is setup correctly with your web-application, before you start testing Criteria, Peers, etc.
Make sure that you can run the Torque sample applications from the command line. MANY PEOPLE FAIL THIS STEP.
- If you fail this step, you need to review the item on getting Torque to run on the command line. (Usually, there's a problem in the Torque.properties file, or libraries are missing, or something.)
- Write a very simple JSP file that contains a small scriplet that prints the results of "Torque.isInit()" Make sure it's true.
- If this step fails, you need to check a number of things:
Make sure you are initializing Torque - many people make a TorqueInitServlet and call Torque.init() when the Servlet starts.
Make sure the webserver can find the Torque.properties file. Usually this means specify an absolute path to the file Because of the way many webservers start up, you can't guarantee what the starting directory is for the webserver. Thus, local paths to the file often fail.
- Make sure that you've included your database driver in the WEB-INF/lib directory.
- Make sure that you've included the appropriate Torque libraries in the WEB-INF/lib directory.
Getting Torque to run within a Junit test
This section deals with the trials and tribulations of getting your unit tests to work with Torque.
I have a base TorqueTestCase that I extend all of my test cases that use torque. I use this for any junit based tests I run. Although I have found that running Cactus style in-container tests works better for me over the long run where the container starts Torque up, but this will help you write tests if you are not in a webapp:
- Create a class looking like this:
{{{ public class TorqueTestCase extends TestCase {
- public final static String TORQUE_PROPS = new String( "c:/fortius/src/test/conf/Torque.properties" );
private static Category log = Category.getInstance( BaseTestCase.class.getName() );
- /**
Constructor for the AntTaskRunnerTest object
- @param name Description of Parameter
- /
public TorqueTestCase ( String name ) {
- super( name ); if ( !Torque.isInit() ) {
- log.debug( "Now starting Torque with path:" + TORQUE_PROPS ); try {
- Torque.init( TORQUE_PROPS );
catch ( org.apache.torque.TorqueException te ) {
- log.error( "Could not start Torque!" ); fail( te.toString() );
}
Now, admittedly the torque.props is hardcoded, but this should get you started. Just make sure all your constructors do call the <code>super( name)<code> method!
Using Torque with multiple databases
This section deals with the trials and tribulations of using multiple databases with Torque.
It's fairly easy to get multiple databases working. The following examples assume you are using JNDI, since it's what I know best, but the differences are restricted to the torque.properties file. Start off by choosing a handle name for each of the databases to which you will connect. In this example there will be two databases, with handles dbA and dbB. Do the following:
In the schema file for dbA, the <database> element must have a name attribute with value dbA. Likewise for the dbB schema file. When the object model files are generated (by ant -f build.properties om), the name will be hard-coded in them, and cannot be overriden.
- In the torque.properties file, create an adapter for each of your databases:
torque.database.dbA.adapter=mysql torque.dsfactory.dbA.factory=org.apache.torque.dsfactory.JndiDataSourceFactory torque.dsfactory.dbA.jndi.path=java:comp/env/jdbc/dbA torque.database.dbB.adapter=mysql torque.dsfactory.dbB.factory=org.apache.torque.dsfactory.JndiDataSourceFactory torque.dsfactory.dbB.jndi.path=java:comp/env/jdbc/dbB[Note: your JNDI path may be different!]
The key point here is the handle, emphasized in torque.database.dbA.adapter=mysql. The torque.properties file handles and the handles in the schema files must correspond. This is the a fundamental issue with getting multiple databases working with Torque.
Every use of the database in the code must reference a handle [this is a simplification, there is a default handle, and rules for automatic creation of a default handle, but... let's not go there]. Here is an example:
Criteria criteria = new Criteria("dbA"); criteria.add(SomePeer.SOME_FIELD, "some value"); SomePeer.doDelete(criteria);-- Gary Shea | http://wiki.apache.org/db-torque/TorqueProjectPages/GettingTorqueToWork | CC-MAIN-2015-06 | refinedweb | 1,250 | 58.79 |
In this post I describe the steps to enable server-prerendering for a Blazor WebAssembly application. This post serves as an introduction to some more interesting prerendering approaches I'll be looking at in future posts.
These posts assume that you're already familiar with the basics of Blazor. If not, I suggest looking at the documentation, at the Awesome Blazor resources, or at Chris Sainty's Blazor in Action. Jon Hilton also has a great two-part series covering the steps in this post - he goes into a lot more detail than I do, so it's worth looking into!
What is Prerendering for Blazor WebAssembly?
Blazor WebAssembly allows you to build .NET applications that run entirely in the browser, without a "back-end" application. The application is served entirely as static files in the same way that JavaScript SPAs built with Angular, React, or Vue are.
One of the advantages of hosting an application as static files is that hosting is very cheap (often free). You don't need an Azure App Service or Kubernetes to run your application; you can use free file hosting provided by GitHub Pages or Netlify, for example.
However, there's been an increasing trend back towards rendering code on the server. One of the classic problems with SPAs is the initial load. When you first load your application in the browser, you need to wait for all the required app assets (traditionally JavaScript) to be loaded before the application can do anything. Until it's finished loading, you're stuck with a "loading" screen.
The same is true for Blazor WebAssembly. If you host your Blazor application as static files, then the initial HTML file fetched from the server is just a placeholder; you need to wait for the whole app to be downloaded before anything meaningful is drawn on the screen.
Prerendering side steps the issue by ensuring we build the HTML on the server side, before sending that first HTML page. That means you see the UI immediately, before we've finished downloading the whole app. That can make a significant difference on the perceived speed of your app, as well as making useful information available sooner. Once the app loads, the WebAssembly app takes over, exactly as it would without preloading.
The main downside to prerendering is that it requires you to run a server application. You can no longer just host your application as static files on GitHub Pages, you have to run an ASP.NET Core application. Whether that trade-off is worth it is something you'll need to consider!
Adding hosting to a static Blazor WebAssembly application
.NET 5.0 introduced Prerendering for Blazor WebAssembly applications. In this post I'm going to start with the basic, static, Blazor WebAssembly template, convert it into a hosted application, and then enable prerendering.
If you're starting from scratch, I suggest you use the hosted option when creating your new Blazor app. This configures hosting for you, so you can skip this step.
Creating the WebAssembly application
Start by creating a new Blazor WebAssembly application. You can do this using the CLI with
dotnet new sln -n BlazorApp1 dotnet new blazorwasm -n BlazorApp1 dotnet sln add BlazorApp1
Alternatively choose "Blazor App" in the Visual Studio New Project dialog. On the Create a new Blazor app screen, select "Blazor WebAssembly App", and leave everything else as is, we'll manually add the hosting app later, just to show what it takes.
Once Visual Studio has finished, you can build and run your application. It's the default Blazor application you've no doubt seen many times. When you publish this application, you'll get static files that can be hosted on GitHub Pages or Netlify.
For prerendering, we need to host the WebAssembly in an ASP.NET Core application. For now, this application will just serve the static files, so it won't do anything more than we currently have. However, later on we can use it to prerendering the page when it's first requested.
Adding the host application
We're going to create an empty Web Application as the host for our app. Add a new web application using the CLI:
dotnet new web -n BlazorApp1.Server dotnet sln add BlazorApp1.Server
Or use Visual Studio to create an empty ASP.NET Core Web Application:
This creates a very minimal ASP.NET Core web app, which we'll update to host our WebAssembly application.
We'll start by updating the project file. We need to add a
<ProjectReference> to the WebAssembly project, and add a reference to the Microsoft.AspNetCore.Components.WebAssembly.Server NuGet package:
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net5.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.1" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\BlazorApp1\BlazorApp1.csproj" /> </ItemGroup> </Project>
Next we'll update the app's
Startup class to configure it to host the WebAssembly application:
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace BlazorApp1.Server { public class Startup { public void ConfigureServices(IServiceCollection services) { } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseWebAssemblyDebugging(); } else { app.UseStatusCodePages(); //FallbackToFile("index.html"); }); } } }
Most of the code in
Configure() is standard ASP.NET Core middleware stuff, but there's a few noteworthy points:
- We're enabling debugging of your WebAssembly application in dev by calling
UseWebAssemblyDebugging. For debugging to work correctly, you'll need to update your launchSettings.json file, as shown below.
- We're telling the ASP.NET Core app to serve the Blazor framework files by calling
UseBlazorFrameworkFiles()
- We're configuring a single "fallback" endpoint, that serves the
index.htmlof the WebAssembly application, no matter which URL is requested. That's a common pattern for SPAs, and ensures that even if the browser requests a path like, the same index.html file is returned. The client-side routing takes care of handling the path once the app is loaded in the browser
The final step is to finish enabling debugging by updating the launchSettings.json for the ASP.NET Core app. Add the
inspectUri to your profiles, so that Visual Studio can correctly communicate with the browser during a debug session:
{ "profiles": { "BlazorApp1.Server": { "commandName": "Project", "dotnetRunMessages": "true", "launchBrowser": true, // Add this line "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "applicationUrl": ";", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } }
If you now run your ASP.NET Core application, you should see your Blazor WebAssembly application is served correctly. Now lets look at adding prerendering!
Enabling prerendering for a hosted Blazor WebAssembly app
One of the prerequisites for prerendering a Blazor WebAssembly app in .NET 5.0 is that it is hosted in an ASP.NET Core app, as I showed in the previous section. However, prerendering is not used by default. The HTML file returned when you request a page just contains the bare minimum HTML for the WebAssembly app to hook into.
In the image above, you can see that the HTML file only contains a minimal amount of markup - a loading message and a (hidden by default) error message. Once the app loads, it replaces this HTML with the "real" application.
With prerendering, we need to generate the same HTML that the Blazor WebAssembly app will after rendering, and return that in the initial page load. In the example below, which uses prerendering, you can see the HTML contains the menu items, as well as a counter component in the raw HTML:
The preview screen doesn't have any CSS, hence why it looks unstyled, but the HTML is correct, so it will display the same when the browser renders it!
So how do we achieve this? We need to do a few things:
- Add Razor Page support to our host application
- Replace the "index.html" page in the WebAssembly app with a "Host" Razor Page in our host application.
- Pre-render the main WebAssembly app component in the Razor Page
- Update the Blazor WebAssembly app to use the pre-rendered component
- Fix dependency injection configuration issues
You can also follow the documentation on Prerendering ASP.NET Core components, but I found that most of the steps there weren't necessary if you're already hosting your Blazor WebAssembly application in an ASP.NET Core app.
1. Add Razor Pages support
The first thing to do is add Razor Pages support to our host app. Update your
Startup class to add the Razor Pages services in
ConfigureServices(), and map the Razor Page endpoints in
Configure(). Finally, update the fall-back endpoint to use a Razor Page (which we'll create shortly) instead of the "index.html" file. Note that you need to change the filename and the method (
MapFallbackToPage vs
MapFallbackToFile).
public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); // <- Add this } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { //... previous config as before app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); // <- Add this endpoints.MapFallbackToPage("/_Host"); // <- Change method + file }); } }
Now we have Razor Pages enabled, we need to add one!
2. Add the Host Razor Page
Create a new Razor Page in your host application inside the Pages folder called _Host.cshtml. You can call the file anything you like, but this appears to be a recommended convention currently. There's no need for a PageModel for the Razor Page, just create a single file in the Pages directory. You can do this with the CLI from the web app root directory using:
dotnet new page -o Pages -n _Host --no-pagemodel
Alternatively, you can use the Visual Studio Add New Item dialog.
Once you have a Razor Page, copy the contents of the wwwroot/index.html file from your WebAssembly app, and paste it in to _Host.cshtml, ensuring that you don't delete the
@page directive at the top of the file. Your _Host.cshtml file will look something like this:
@page <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title>BlazorApp1</title> <base href="/" /> <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" /> <link href="css/app.css" rel="stylesheet" /> <link href="BlazorApp>
You can then delete the wwwroot/index.html file in your WebAssembly project: it's no longer used.
At this point, if you run your application, you should find your WebAssembly application runs exactly as it did before. We haven't enabled prerendering yet, but we've laid the foundations!
3. Configure prerendering in the host app
The _Host.cshtml Razor Page is being returned no matter what URL is requested from the server. We now want to update the Razor Page so that it prerenders the WebAssembly application as part of the request, so that the HTML returned is the same HTML that will be generated on the client.
First, we need to enable Tag Helpers on the Razor Page. Add
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers to the top of the page:
@page @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers <!DOCTYPE html> <html> <!--...-->
Next, replace the
<div id="app">Loading...</div> element with the following:
<component type="typeof(BlazorApp1.App)" render-
This Tag Helper renders the main Blazor WebAssembly component (called
App by convention) in the same location that the app would render it.
4. Update your WebAssembly app to use the pre-rendered component
If you run your application now, you'll see the pre-rendered pages, but you'll also immediately see an error in the console, and the Blazor error UI. The error says:
Microsoft.JSInterop.JSException: Could not find any element matching selector '#app'
The problem is that your WebAssembly app is still looking for the
<div id="app"> element we removed. Luckily there's a simple fix: delete the line
builder.RootComponents.Add<App>("#app"); from Program.cs in your WebAssembly application:
public class Program { public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); // builder.RootComponents.Add<App>("#app"); DELETE THIS LINE builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); await builder.Build().RunAsync(); } }
With that, you can view your new app without error. That is, unless you directly request the
/fetchdata page (which displays weather forecast data)…
5. Fix dependency injection issues.
The weather forecast page works fine if you load the app first, and then navigate to it client-side:
But if you try to navigate directly to the page, using the host app to trigger server prerendering, then you'll get an error:
The problem is that the
FetchData.razor component uses an injected
HttpClient as a dependency:
@page "/fetchdata" @inject HttpClient Http
In the WebAssembly app, the
HttpClient is configured as a dependency in
Program.Main:
public class Program { public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); // Configure the dependency builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); await builder.Build().RunAsync(); } }
We haven't configured that in the host app, so when the host app tries to create the
FetchData.razor component during prerendering, it throws an exception.
You may be able to get away with just registering the same dependencies in both your apps, but that won't always make sense. This post is already getting pretty long though, so I'm just going to hack something together in the host app by registering an
HttpClient that points back to itself.
public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); //) }; }); } }
This is definitely clumsy, as you're bouncing via the network when you prerender the FetchData page. Jon Hilton shows a much cleaner approach in his post on prerendering - I suggest you take a look if this is something you need!
With the dependency registered, we can now directly load the prerendered
/fetchdata page without issue.
Note that you will see a "flash" shortly after loading the
/fetchdatapage, and the random data changes. This is due to the web assembly app re-fetching data after the initial prerender, so
OnInitializedAsyncis called twice. Jon Hilton also describes approaches to fix this in his post on prerendering.
And with that, we're done! You can now prerender your WebAssembly app on the server, avoiding the annoying "loading" flash, while still running entirely on the client side as a WebAssembly application.
Prerendering trade-offs
On the face of it prerendering sounds great - it avoids the (sometimes, long) "loading" flash while the application is loaded, and allows users to see the content immediately, without having to wait for the whole app to download. However, there's some downsides.
We've already seen one of them—prerendering can result in data being fetched twice when a page is rendered, as
OnInitializedAsync is called twice, once on the server and once on the client. Depending on your requirements that may or may not be a problem. There are approaches to reduce the impact of this effect, but fundamentally it's something your app needs to be able to cope with.
You also need to ensure all the dependencies available to your WebAssembly app are available in the host app during prerender. Again, depending on your application, that may-or-may-not be a problem. If you need to access the browser directly, for example, then you could have difficulties when prerendering. A more common issue will likely be configuration differences, as we saw with the
HttpClient in this post.
One subtle issue is that although the app will look like it's ready as soon as the initial HTML file is downloaded, the UI won't actually be responsive until the rest of the WebAssembly assets have been downloaded.
You can see this in action if you set the network speed to 3G in your browser's dev-tools. Clear the website's cache, throttle the network, and then reload the page. Clicking around the UI won't do anything for a few seconds, before the Blazor app boots up.
The other obvious drawback is that you can no longer host your WebAssembly app as static files, you have to run a server application. This is no different to other JavaScript SPAs that use server-side rendering, but it removes one of the big draws of Blazor WebAssembly: simple static-file hosting.
Summary
In this post, I showed how to enable prerendering for a Blazor WebAssembly application. I first showed how to host the application in an ASP.NET Core app, and then showed how to configure the host application to pre-render your Blazor WebAssembly components. This removes the "loading" flash that you see without pre-rendering, though there is still an "unresponsive" period while your app assets are downloaded. | https://andrewlock.net/enabling-prerendering-for-blazor-webassembly-apps/ | CC-MAIN-2022-05 | refinedweb | 2,792 | 56.66 |
hi i asked few days back if it was possible to count the execution time using clock, well i got replies telling that its not possible
my code runs on linux, are there any specific functions that can be used only in linux in order count the execution time in nanoseconds? and then get the seconds?
for example if we have a running time in nanoseconds
33939
i want 33939*10^-9 = 0.000033939 seconds
i ve researched a little bit and i found that the clock_gettime can do the job
but i havent found any source code on how to do this if you could help me with a simple sample code or suggest me something else it would be appreciated
i have found another one for gettimeofday
gives outputgives outputCode:#include <iostream> #include <sys/time.h> using namespace std; int main(void) { timeval tim; gettimeofday(&tim, NULL); double t1=tim.tv_sec+(tim.tv_usec/1000000.0); int i,j=0; for(i=0;i<1000;i++){ j=j+1; } gettimeofday(&tim, NULL); double t2=tim.tv_sec+(tim.tv_usec/1000000.0); cout<<t2-t1<<" seconds elapsed\n"; }
5.00679e-06 seconds elapsed
is this correct?? but it is not in nanoseconds | https://cboard.cprogramming.com/cplusplus-programming/136654-count-execution-time-ubuntu-nanoseconds.html | CC-MAIN-2017-30 | refinedweb | 201 | 69.72 |
Hey Guys and Gals
I am new to this site and new to programming. C++ is the first one I am trying to learn. I ran into a problem on one of my assignements. I believe my problem is in the actual calculations. The Bonus part of the program is way off. Could you guys give it a look and see if you can point me in the right direction. I will attach the problem and my source code. I really appreciate this. I look forward to learning from some people who have been doing this a long time.:)
Create an algorithm and a C++ program for the following problem.
TechMed International has five salesmen on their staff. Bonuses are provided each week if a salesman’s total sales are greater than the average sales for the week. Your program should input the first and last name of each salesman along with his or her total sales for the week. It should then compute the average sales for the five salesmen. Finally, it should print each salesperson’s name, his or her sales amount, and the bonus amount. The bonus amount will be zero if the sales amount is less than the average. It will be 5 percent of the salesman’s sales amount if it is greater than the average. Use parallel arrays to solve this problem.
To test your program, it should display the following report, assuming that the sales amount figures were provided as input to the program.
Sales Report
Name
Total Sales
Bonus
Stan Jones
2500
0.00
Bill Smith
3325
166.25
Abe Locker
4155
207.75
Ace Hill
2120
0.00
Bud Wiser
1850
0.00
Store your project in a folder called Exam2. You do not need to write any external documentation but you should include internal documentation in your program.
Extra Special Information
We haven’t dealt with strings of characters yet in this class for C++. There is more than one type of string in C++ but the string class in the std namespace is the easiest to use, because you can normally treat it like other data types. To use the string class, you need to add the following line at the top.
#include <string>
Above the line that contains “using namespace std;”
To declare a single string variable called “firstName”, use a declaration similar to
string firstName;
To declare an array of strings that has five elements, use a declaration similar to:
string firstNames[5];
To input a value into a string variable called firstName, use: cin >> firstName;
To input a value into element “j” of the array “firstNames”, use cin >> firstNames[j];
To output a value from element “j” of the array “firstNames”, use cout << firstNames[j];
Your program will need to implement the following general steps to work successfully.
1. Input the first name, last name and total sales amount for each employee, storing the information in parallel arrays.
2. Calculate the average sales amount for all employees.
3. Calculate the bonus for each sales person, storing the bonus for each in an array.
4. Print the first name, last name, total sales and bonus for each employee in the arrays.
/ Program: Demo9.cpp : Sales Report // Author: ME // Date Written: 6-16-06 // Purpose: To compute total sales and bonuses for the salesmen // include libraries #include <iostream> #include "stdafx.h" #include <string> using namespace std; int main(int argc, char* argv[]) { // declare variables string firstName[100]; string lastName[100]; double totalSales[100], avgSales[100], bonusAmount[100]; int index, count; // Read in the Stock names, current price and former price. index = 0; cout << "Enter the Sales Persons First Name or end to quit "; cin >> firstName[index]; cout << "Enter the Sales Person Last Name "; cin >> lastName[index]; while (firstName[index] != "end") { cout << "Enter the total sales for the week "; cin >> totalSales[index]; index++; cout << "\n Enter the Sales Persons First Name 'end' to quit: "; cin >> firstName[index]; cout << "\n Enter the Sales Persons Last Name 'end' to quit: "; cin >> lastName[index]; } count = index; // Calculate the Sales average and bonus amount. for (index=0; index<count; index++) { avgSales[index] = totalSales[index] /count; bonusAmount[index] = totalSales[index] * .5; if (avgSales[index]>totalSales[index]) bonusAmount[index]; } // Display cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(2); cout << "\n\n Sales Report\n\n"; cout << " First Last Total Sales Bonus \n"; for (index=0; index<count; index++) { cout.width(15); cout << firstName[index]; cout.width(10); cout << lastName[index]; cout.width(10); cout << totalSales[index]; cout.width(20); cout << bonusAmount[index]; cout << endl; } return 0; } | https://www.daniweb.com/programming/software-development/threads/48094/coding-question | CC-MAIN-2022-21 | refinedweb | 764 | 72.56 |
#include <wx/file.h>
A so you won't forget to do so..
Standard file descriptors.
The OpenMode enumeration defines the different modes for opening a file with wxFile.
It is also used with wxFile::Access function.
Default constructor.
Opens a file with a filename.
This function verifies if we may access the given file in specified mode.
Only values of
wxFile::read or
wxFile::write really make sense here.
Attaches an existing file descriptor to the wxFile object.
Examples.
Resets the error code.
GetLastError() will return 0 until the next error occurs.
Closes the file.
Creates a file for writing.
If the file already exists, setting overwrite to true will ensure it is overwritten.
access may be an OR combination of the wxPosixPermissions enumeration values.
Get back a file descriptor from wxFile object - the caller is responsible for closing the file if this descriptor is opened.
IsOpened() will return false after call to Detach()..
So, to read the entire file into memory, you should write a loop which uses Read() repeatedly and tests its return condition instead of using Eof() as this will not work for special files under Unix.
Returns true if the given name specifies an existing regular file (not a directory or a link).
Returns the file descriptor associated with the file.
Returns the type of the file.
Returns the error code for the last unsuccessful operation.
The error code is system-dependent and corresponds to the value of the standard
errno variable when the last error occurred.
Notice that only simple accessors such as IsOpened() and Eof() (and this method itself) don't modify the last error value, all other methods can potentially change it if an error occurs, including the const ones such as Tell() or Length().
Returns true if the file has been opened.
Returns the length of the file.
Opens the file, returning true if successful.
Reads from the file into a memory buffer.
Reads the entire contents of the file into a string.
Seeks to the specified position.
Moves the file pointer to the specified number of bytes relative to the end of the file.
For example,
SeekEnd(-5) would position the pointer 5 bytes before the end.
Returns the current position or wxInvalidOffset if file is not opened or if another error occurred.
Write data to the file (descriptor).
Writes the contents of the string to the file, returns true on success.
The second argument is only meaningful in Unicode build of wxWidgets when conv is used to convert s to a multibyte representation.
Note that this method only works with
NUL-terminated strings, if you want to write data with embedded
NULs to the file you should use the other Write() overload. | https://docs.wxwidgets.org/3.0/classwx_file.html | CC-MAIN-2021-17 | refinedweb | 453 | 67.45 |
The following article will be all around debugging your Cinema 4D plugins. Addressing mainly the beginners in plugin development, I still hope, to have one or two tricks for the veterans as well. I will start with setting up your environment for an increased fun in debugging, then go over to some general debugging techniques, before finishing with some more Cinema 4D specific techniques.
While the screenshots in this article are taken from Visual Studio 2013 and Xcode 6.0.1, everything shown and said should work in Visual Studio 2012 and Xcode 5.x or 6.1.x as well. If there’s a place this is not the case, please let me know and I will try to cover the differences.
Preparing Your Toolbox
Start Cinema 4D Automatically With Your Debugger
At first you’ll want to configure your project for debugging. Most of it is already set correctly by default (assuming you are using the project files delivered with the SDK). In order to have Cinema 4D started, once you click the “Debug” button, you need to set the path to the Cinema 4D executable.
Depending on your Cinema 4D version, operating system and the IDE in use it’s a bit different.
Visual Studio
Enter the project properties and go to Debugging settings, like so:
Menu: Project → Properties → Configuration Properties → Debugging
For Cinema 4D R15 and following it is sufficient to simply select your Cinema 4D executable for Command. The result will probably look like this ..\..\Cinema 4D 64 Bit.exe (R15) or ..\..\..\Cinema 4D.exe (R16), although the path may depend on your system and project location. Especially with R16 where you can move your projects anywhere you like.
For versions before Cinema 4D R15 I suggest to use both options marked by 1 in the screenshot: Command and Working Directory. Unfortunately Working Directory can not be a relative path. But in order to make use of the Debug mode (explained next), you will need to have Working Directory point to the directory, where the Cinema 4D executable is located (absolute path, the trailing backslash is important) and only have the name of the Cinema 4D executable as Command, like it is shown in the following screenshot.
I recommend to set the Debugging Command for Configuration: “All Configurations”. As the executable differs for 32-Bit and 64-Bit version of Cinema 4D, you’ll have to configure Platform Win32 in a second step, if you still need to build 32-Bit versions.
Xcode
Enter the scheme settings either via menu Menu: Product → Scheme → Edit Scheme... or a bit quicker via Cmd + <. At first one needs to note, that this is the place to switch between debug and release builds, which may be a bit confusing especially for developers who grew up with Visual Studio.
Then choose Executable → Other... and select your Cinema 4D executable, like in the screenshot below.
Start Cinema 4D in Debug Mode
You may want to start Cinema 4D itself in debug mode.
In debug mode Cinema 4D will provide you with all kinds additional runtime information on a system console. For example valuable information on memory management, it will even warn you about memory leaks. Please note, this will slow down Cinema 4D considerably, so you may want to enable Debug mode temporarily only. An even better way would be to have special debug build targets, which additionally enables the debug mode.
Cinema 4D < R15
Create an empty text file named c4d_debug.txt inside of the Cinema 4D program folder, next to your Cinema 4D executable. As long as you followed the Command and Working Directory setup before, it’s that simple!
Cinema 4D ≥ R15 and Visual Studio
Add g_alloc=debug to your Commandline Arguments (marked 2 in the above screenshot) for Configuration: “Debug” and Platform: “All Platforms”.
Cinema 4D ≥ R15 and Xcode
In Xcode’s scheme settings change to the arguments tab. Add g_alloc=debug as argument, like in the screenshot below.
More Commandline Arguments
- -debug
- ≥R15: Use this instead of g_alloc=debug in order to start Cinema 4D in Debug mode without the additional memory management information and memory leak detection
- g_logfile=[string]
- ≥R16: Debug Console output will be written to a file
- g_console=true
- ≥R16: Open the Debug Console (was done via -debug in versions <R16)
Even more commandline options can be found in <C4D install dir>/resource/config.txt.
Use TypeViewer for VisualStudio and Xcode
You may have seen downloads of TypeViewer for Visual Studio 2005 and 2010 in our development area. Good news for everybody, who’s working with Visual Studio 2012+ and is developing with Cinema 4D SDK R15+. The functionality is seamlessly integrated into the project files. No additional work needed. It simply works. The same is true for Xcode.
Time Is Money
You can significantly speed up your development turnaround times by creating a special start-up layout in Cinema 4D for your plugin development.
- If you have modified your Cinema 4D start-up layout before, don’t forget to save it, so you can return to it anytime you need to.
- Remove everything not needed in the context of your new plugin, especially Content Browser views can severely impede your start-up times.
- Integrate the console Menu: Script → Console... into your layout, e.g. have it docked on one side of your screen. This provides you with a quick overview on your debug output.
- Open your plugin and attach its interface or have a start-up scene using your plugin.
- Save this layout as e.g. plugin_dev.l4d as well as start-up layout.
Printf Debugging
Further Reading
Some may call it the purest form of debugging, it certainly is one of the most simple. In Cinema 4D you have several options to print information.
They differ in location of output, if the code is still active in release builds and type of string to print. Let’s go through them quickly, noting advantages and disadvantages. Afterwards you’ll find a table, showing which function outputs where and when.
void GePrint(const String& str)
Use GePrint in your plugin to show elementary messages/information to the user. For example a message on successful initialization plus version information could be printed to the script console. You should avoid to flood the script console, as the user might want to use the script console himself or other components want to have their info visible to the user as well.
Since GePrint prints regardless of build target and Debug mode, it’s less suited for debugging needs.
void GeConsoleOut(const String& str)
GeConsoleOut behaves a bit differently on Windows and Mac. On Windows it basically does the same as GePrint. Yet on Mac it prints to the debugger’s output window as well.
void GeDebugOut(const String& s)
void GeDebugOut(const Char* s, …)
As the name suggests, these functions are made for debugging. Mainly because the output can only be seen, when Cinema 4D is run in Debug mode.
GeDebugOut comes in two flavors, the first works with Cinema 4D’s String class (just like GePrint).
The second works with format strings (C-strings with special placeholders to provide formatted output), as you might know them from ANSI-C and stdio-functions, like printf. Here you can use all the format strings known from the last mentioned stdio-functions. So you can do something like this:
const Char name[] = "Cinema 4D"; UInt32 val = 5; GeDebugOut("Debugging %s plugins is %dx more fun than reading white pages (0x%p).", name, val, &val);
So you will need to take care for this.
New in Cinema 4D R15
CriticalOutput(fmt)
The name says all about its purpose. CriticalOutput is to be used in insolvable situations. Printing-wise it works much like the second GeDebugOut flavor, as it’s using C-like format strings. Yet, there are some differences:
- It triggers a breakpoint, if there is a debugger present
- Information on source-file and line number is added
- A line break is automatically appended
- No 2048 character limit
DiagnosticOutput(fmt)
This is pretty much the same as second flavor GeDebugOut. Only difference is an automatically appended line-break.
DebugOutput(flags, fmt)
Last but not least, DebugOutput will probably get your most used debug print function. It’s main advantage, it does nothing in release builds. Neither will it reveal your output to a user running Cinema 4D in Debug mode, nor will it use any CPU time in a release build. If you are developing for R15 and above, I suggest, you take a closer look at this function and try to get used to it.
Additionally you can make use of OUTPUT_FLAGS to adjust it to your needs:
- OUTPUT_DIAGNOSTIC
- Set by default
- OUTPUT_WARNING
- Prepends a line “WARNING:” to your output
- OUTPUT_CRITICAL
- Prepends a line “CRITICAL:” to your output
- OUTPUT_NOLINEBREAK
- Suppresses an automatically appended line-break, so you can use multiple calls to assemble a your line
- OUTPUT_HEADER
- Adds source file and line number information
Which Print Goes Where
Conversions to String
To have all info in one place, you’ll need the following functions to print your variables:
Beyond Printf Debugging – Use Your Debugger
Further Reading
In the beginning we already talked about starting Cinema 4D from within your IDE and in your debugger. Some may wonder, what’s the point, as you obviously have no debug information and symbol tables for Cinema 4D. You know what? It doesn’t really matter. You can still debug your plugin, you can step through your code, set breakpoints and watch data structures. You can do basically everything you are used to with your debugger. At a point, where you are calling Cinema 4D API functions, you may feel a bit blindfolded, but you can always use “Step Out” or “Run to Cursor” functionality to get back into your own project code.
Discussing every detail of debugging with your specific IDE is way beyond the scope of this article. But I want to show the basics and point your attention to some nifty features, you may not have noticed, yet. And there’s so much more, I won’t be covering: Watch points, Symbolic breakpoints. See the Further Reading section, if you feel like diving into the details.
Visual Studio
Above screenshot shows a typical debugging situation (here the rounded tube plugin from the SDK examples).
You will want to have several windows docked to your debug layout and you should note, that there’s more than just the average breakpoint.
Debug Windows
- Output
This is where most of the debug prints write to. When Cinema 4D is starting up, you see a lot of information, not too important for the average plugin developer. But after the start phase it should be quiet here and you can use it nicely for debug outputs and output from assertions. Furthermore output from Breakpoints is shown here as well (see below).
- Breakpoints
Useful to quickly toggle or reconfigure breakpoints, without the need to jump to the respective code line. In fact it can be used to quickly navigate to interesting code lines, so you may want to have this window not only in your debug layout. Sort of another category of bookmarks.
- Locals
Here you will be provided with the current data visible in the current scope. No more and no less. You can add data to the watch window from here saw well. Changed data is highlighted.
- Watch Window(s)
You can have several of these open in parallel. Add data to the watch windows, in order to keep an eye on, even if the variable is not in current scope. Also good to see, if data gets changed by somebody else, like a bug, when you are writing over the limits of an array.
- Data Probes (not shown in screenshot)
Actually no real window, but you can attach data probes to source lines via right click “Pin to source”. You’ll get a minimal watch window attached to the source code, showing the content of a certain variable.
- Call Stack
Since you are programming a computer, I assume you are familiar with the concept of a call stack. If you are not, then you should definitely learn about it. See further reading links to do so. Anyway, here you see the stack, can click to jump into prior call levels. A good place to come to know the call hierarchy (the basics), to learn how many call levels are involved with certain calls (when optimizing) and certain bugs, for example infinite recursion, are easily identified here.
Breakpoints
- The Ordinary
Added with a simple left click into the leftmost column of your editor view, these are behaving as everyone would suspect: The execution gets halted upon hit and you are ready to use your debugger. Via right click you can transform these into any of the following breakpoints.
- When hit…
With this option you can change a breakpoint into a debug print. With the big advantage you can add this debug print at runtime! When selecting this option, you can enter the message to print (it’s shown in there, how to access your variables). By default the breakpoint will mutate into a debug print. You need to deselect the option to “Continue Execution”, if you want halt the execution as well.
- Hit Count
A simple version of the conditional breakpoint. Simply specify how many times you want to step over this breakpoint until it finally triggers a halt of the execution.
- Conditional
The swiss army knife of all breakpoints. You can specify a condition, in the same way you write the condition for an if statement. In most cases, this is all you need, to trigger on the exact occasion of a bug.
Xcode
In general Xcode offers the same options as Visual Studio. Therefore it shall be enough to describe the differences. Also I’d like to note, that my experience with Xcode is still weak. So if I overlooked something, please leave me comments.
Unfortunately I have not yet found comfortable equivalents for Visual Studio’s Watch Window and Data Probes. Yes, you can watch memory areas, but Visual Studio’s Watch Window is so much more versatile.
The screenshot below shows the call stack in Xcode. Note the small buttons in the lower left, which offer a very nice option to show only the relevant part of the stack. Nice feature.
In contrast to Visual Studio, Xcode has one breakpoint, which is vastly configurable and can do all the stuff (and more) described for Visual Studio. Lets look at Xcode’s breakpoint manager.
A side note, while we are at it, note the small “All” button in the lower left of the “Locals” view. There you have the option to blend in global variables and even registers. Nice.
Obviously a breakpoint will be configured by Ctrl-clicking or right clicking and selecting Edit Breakpoint.... The screenshot below shows a configuration doing something similar to Visual Studio’s “When hit…” breakpoint. Note that you have all the options to combine this with a condition or a “Hit Count” (Visual Studio speak, in Xcode it’s the “Ignore” option).
Built-in Bugtraps
Assertions are a good way to develop your code into a more stable product. In their simplest form, assertions can be used to trigger a breakpoint in a certain branch. Why would you want to do this? Well, first of all you may have code, that depends on certain prerequisites and/or assumptions. You can use an assertion to assure your assumptions are correct. Or you may not be sure, something is working the way you expect it to, again assertions can be used to notify you about wrong assumptions. And you can use assertions to mark code not yet completed. In this way you don’t always have to watch your comments, but will have a notification mechanism, when such incomplete branches are hit.
For example you have an enumeration and a switch/case testing these cases. Typically you will have a default case, which catches everything not covered by your cases. This can be a good place for an assertion. Whenever you extend your enumeration, the debugger will get triggered as soon as a switch/case is hit, that was not yet adapted to the extended enum. Otherwise your plugin might stumble through the default case and might show wrong behavior. Depending on the wrong behavior this can be quite difficult to notice. It may even slip through into your release…
Or consider the following code. Bad code, I admit, but for the sake of showing my point in a few lines… I hope you get the point:
#define SOMEARRAY_SIZE 16 static Int32 g_someArray[SOMEARRAY_SIZE]; void PrintSomeArray(Int32 idx) { GePrint("Value: " + String::IntToString(g_someArray[idx])); }
Now you may call PrintSomeArray, forgetting all about your array’s size. What will happen? Well, it depends… It depends on parameter idx of course. Large values will probably crash. Which in a weird way is good, as you will notice the bug. Values only slightly greater than SOMEARRAY_SIZE will most likely work, though. With these the function will print some memory content behind your array. This again may be uninitialized or initialized with some of your other data. Now there are chances you’ll receive values which look good, but it will depend on sunshine and groundfog, one time your plugin will run, next time it may crash (assuming you are actually working with the data) and on a third run it will show erratic behavior, which may even depend on what you did before with your plugin. The resulting bugs can get even more interesting, if you are writing into the array. Functions will stop working, you didn’t even intend to change… you may never have known these ever existed, if you get the wrong values right. 😉
Of course you need to check the index. If the index depends on user input, you’ll have no chance but to check idx every time. On the other hand, the index may be depending on your other code, only. Then it might be a good idea to use an assertion like this:
#define SOMEARRAY_SIZE 16 static Int32 g_someArray[SOMEARRAY_SIZE]; void PrintSomeArray(Int32 idx) { DebugAssert((idx >= 0) && (idx < SOMEARRAY_SIZE)); GePrint("Value: " + String::IntToString(g_someArray[idx])); }
Now, idx gets checked in your debug builds and wrong indices will be obvious. Release builds on the other hand will have no check and will be as fast as you intended.
In the Cinema 4D SDK you have a plethora of assertions to use. On some you can add a string to be printed, when the assertion fails, some are unconditional (e.g. for the above mentioned switch/case) and some also work in release builds. See the table below to get an overview.
In a release build b will never be assigned!
Be Aware of Floating Point Madness
Further Reading
I won’t talk about actual debugging here, rather bug prevention when handling Float datatypes and I won’t do much.
While you can read more on the strange stuff, you can experience with Float datatype in my article Floating-Point Weirdness, I simply want to list the things to be aware of and a few SDK functions that will make your life a bit easier.
Special care needs to be taken, when
- comparing Float values
Make use of Bool CompareFloatTolerant(a, b)
- converting Float variables into integer variables
Use conversion macros SAFEINT32(), SAFEINT64(), SAFEINT()
- importing floating-point values from files
Use Bool CheckFloat(float) and Float RepairFloat(float)
- calculating with floating-point numbers, as floating-point exceptions are likely to be disabled in Cinema 4D
You may temporarily enable these (But pay attention! If in doubt have a look at the Floating-Point Weirdness article) using Int32 GeDebugSetFloatingPointChecks(Int32 on)
Keep an Eye on Your Memory Allocations
Allocating memory is trivial, correct freeing or releasing formerly allocated memory, that’s what many programmers seem to have problems with. And although Cinema 4D provides a lot of convenience functions, like e.g. the nice AutoAlloc mechanism, this can be as well an issue in your plugins. If I find the time, we may have an article on this particular topic.
Checking for memory leaks the above mentioned Debug mode is irreplaceable. But there’s another one you get for free. Included with the SDK examples there’s a small plugin called Memory Statistics. It’s nothing more, but a table showing the info provided by Bool GeGetMemoryStat(BaseContainer& stat). Yet, it can provide you with a nice feeling for what is going on. Simply dock it in your debug layout. Look at it from time to time, you’ll know what I mean. You’ll not only know, your plugin is running wild, but your overall feeling for memory allocations will improve.
I already said this, when talking about usage of processor time. Same is true here. Memory you don’t use, is free for others. It’s a community service to watch your allocations.
Multithreading Can Be Tricky
Cinema 4D is heavily multithreaded and this has major impact on your plugin development. While the idea of multithreading may seem obvious and simple, the implications for software developers are not. To explain the details (like correct serialization and proper locking, avoiding deadlocks and so on) would definitely be beyond the scope of this article.
In any case you should pay close attention to restrictions in regards to multithreading mentioned in the SDK documentation. We are aware our documentation on this topic is far from perfect. While we are trying to improve, we appreciate any pointers given by the community. Simply send an email to sdk_support@maxon.net.
Many functions in the Cinema 4D SDK have to be called from main thread. For example pretty much anything interacting with the GUI.
You can use Bool GeIsMainThread(void) to ensure this in your code.
Watch Your Execution Times
To state the obvious:
Optimizing your plugin’s runtime is a community service!
Processing power not used by your plugin is available for others.
At first you will have to determine the hotspots of your code. Of course a professional profiling tool makes this job easy. Taking the cost of these tools into account, many of you won’t have access to such tools. Well, developers on Mac have a clear advantage here, as they get Instruments for free (someday I’ll probably write an article about profiling your plugins with Instruments). But instead you can simply use the debugger or debug outputs to find out, which functions are called the most or which loops have the longest duration. Take special care for functions like GetVirtualObjects() in ObjectData plugins or Message() and Draw() functions in general.
Afterwards it’s as simple as using GeGetMilliSeconds() to measure your execution time. Depending on the function, it may also be a good idea to keep track of minimum and/or maximum times.
Here’s some example code for Cinema 4D ≥ R15:
#ifndef __DET_H_ #define __DET_H_ #include "c4d.h" // use a distinct define to toggle measurement on and off, as you don't want to measure in debug builds #define DEBUG_EXECUTION_TIME // add your measurement jobs here and don't forget the names in the array below enum { DET_SPECIAL_LOOP, DET_SOME_OTHER_JOB, _DET_NUM_MEASUREMENTS, // keep last }; static const char* g_arrDETNames[_DET_NUM_MEASUREMENTS] = // class String can't be used as static global { "Special loop", "Some other job", }; #ifdef DEBUG_EXECUTION_TIME void InitDET(void); void StartDET(const Int32 idxJob); void FinishDET(const Int32 idxJob); void PrintDET(const Int32 job); #define DET_INIT() InitDET() // call this somewhere in your start-up to get proper minimum values later on #define DET_START(job) StartDET(job) #define DET_FINISH(job) FinishDET(job) #define DET_PRINT(job) PrintDET(job) #else // DEBUG_EXECUTION_TIME #define DET_INIT() #define DET_START(job) #define DET_FINISH(job) #define DET_PRINT(job) #endif // DEBUG_EXECUTION_TIME #endif // __DET_H_
#include "det.h" typedef struct _tDebugExecTime tDebugExecTime; struct _tDebugExecTime { Float64 fStart; Float64 fCurrent; Float64 fMin; Float64 fMax; }; static tDebugExecTime g_arrDET[_DET_NUM_MEASUREMENTS]; void InitDET(void) // call this somewhere in your start-up to get proper minimum values later on { for (Int32 idxJob = 0; idxJob < sizeof(g_arrDET)/sizeof(g_arrDET[0]); ++idxJob) { g_arrDET[idxJob].fMin = MAXVALUE_FLOAT64; } } void StartDET(const Int32 idxJob) { g_arrDET[idxJob].fStart = GeGetMilliSeconds(); } void FinishDET(const Int32 idxJob) { const Float64 fTime = GeGetMilliSeconds() - g_arrDET[idxJob].fStart; g_arrDET[idxJob].fCurrent = fTime; if (fTime < g_arrDET[idxJob].fMin) g_arrDET[idxJob].fMin = fTime; if (fTime > g_arrDET[idxJob].fMax) g_arrDET[idxJob].fMax = fTime; } #define DET_PRINT_MEASUREMENT(n) GePrint(String(g_arrDETNames[n]) + ": " + \ String::FloatToString(g_arrDET[n].fCurrent) + " / " + \ String::FloatToString(g_arrDET[n].fMin) + " / " + \ String::FloatToString(g_arrDET[n].fMax)) void PrintDET(const Int32 job) { if ((job > 0) && (job < _DET_NUM_MEASUREMENTS)) { DET_PRINT_MEASUREMENT(job); } else { for (Int32 idxJob = 0; idxJob < sizeof(g_arrDET)/sizeof(g_arrDET[0]); ++idxJob) { DET_PRINT_MEASUREMENT(idxJob); } } }
To use the above header, initialize somewhere in your start-up code:
DET_INIT();
Then measure like so:
DET_START(DET_SPECIAL_LOOP); while (condition) { // ... this ominous loop you always wanted to know the runtime of } DET_FINISH(DET_SPECIAL_LOOP);
And evaluate your results:
DET_INIT();
Your Own Personal Oompa Loompa
You may already know the Active Object Dialog plugin, as it’s one of the SDK examples. You will most likely have compiled it yourself, if not I recommend you do now. Most people tend to forget about it, after having it called once.
I say: You rather should not forget about it!
The Active Object Dialog plugin not only gives you a great overview about what’s going on in a scene, but it will also provide you with address information, info on object caches and dirty flags, which is great not only for ObjectData plugins. It really goes a long way in combination with your debug information or the debugger.
Have Fun
I hope I didn’t bore anyone to death and that at least one of you will have a bit more fun debugging his plugins after reading this article.
So long,
Andreas
2 Comments
Tһis site was… how do I say it? Relevant!! Finally I’ve
found something that helped mе. Cheers!
Please be aware that there’s also the developer support forum () constantly providing insights on development-related questions. Feel free to have a look | https://developers.maxon.net/?p=1560 | CC-MAIN-2021-17 | refinedweb | 4,355 | 62.38 |
Primers • Vision Transformer (ViT)
- Overview
- How the Vision Transformer works in a nutshell
- Important details
- Representing an image as a sequence of patches
- Positional embeddings
- Key findings
- How far aways are the learned non-local interactions?
- Attention distance and visualization
- Implementation
- Conclusion
- Citation
Overview
This article investigates over how the Vision Transformer (ViT) works by going over the minor modifications of the transformer architecture for image classification.
We recommend checking out the articles on Transformer and attention if you don’t feel that comfortable with the terms.
- Transformers lack the inductive biases of Convolutional Neural Networks (CNNs), such as translation invariance and a locally restricted receptive field. You’ve probably heard that before. But what does it actually mean? Well, invariance means that you can recognize an entity (i.e. object) in an image, even when its appearance or position varies. Translation in computer vision implies that each image pixel has been moved by a fixed amount in a particular direction.
- Moreover, remember that convolution is a linear local operator. We see only the neighbor values as indicated by the kernel.
- On the other hand, the transformer is by design permutation invariant. The bad news is that it cannot process grid-structured data. We need sequences! To this end, we will convert a spatial non-sequential signal to a sequence! Let’s see how.
How the Vision Transformer works in a nutshell
The total architecture is called Vision Transformer (ViT), proposed by Alexey Dosovitskiy et al. (2020) in An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. Let’s examine it step by step.
- Split an image into patches.
- Flatten the patches.
- Produce lower-dimensional linear embeddings from the flattened patches.
- Add positional embeddings.
- Feed the sequence as an input to a standard transformer encoder.
- Pretrain the model with image labels (fully supervised on a huge dataset).
- Finetune on the downstream dataset for image classification.
The following image from Google’s AI blog shows the inner workings of ViT:
- Image patches are basically the sequence tokens (like words). In fact, the encoder block is identical to the original transformer proposed by Vaswani et al. (2017) as we have extensively described. The following image shows the well-known transformer block (source: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale):
- The only thing that changes is the number of those blocks. To this end, and to further prove that with more data they can train larger ViT variants, 3 models were proposed (source: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale):
Heads refer to multi-head attention, while the MLP size refers to the blue module in the figure. MLP stands for multi-layer perceptron but it’s actually a bunch of linear transformation layers.
Hidden size DD is the embedding size, which is kept fixed throughout the layers. Why keep it fixed? So that we can use short residual skip connections.
In case you missed it, there is no decoder in the game. Just an extra linear layer for the final classification called MLP head. But is this enough? Yes and no. Actually, we need a massive amount of data and as a result computational resources.
Important details
Specifically, if ViT is trained on datasets with more than 14M images it can approach or beat state-of-the-art CNNs. If not, you better stick with ResNets or EfficientNets.
ViT is pretrained on the large dataset and then fine-tuned to small ones. The only modification is to discard the prediction head (MLP head) and attach a new D \times KD×K linear layer, where K is the number of classes of the small dataset.
It is interesting that the authors claim that it is better to fine-tune at higher resolutions than pre-training.
- To fine-tune in higher resolutions, 2D interpolation of the pre-trained position embeddings is performed. The reason is that they model positional embeddings with trainable linear layers. Having that said, the key engineering part of this paper is all about feeding an image in the transformer.
Representing an image as a sequence of patches
- Let’s go over how you can elegantly reshape the image in patches. For an input image \((x) \in R^{H} \times W \times C\) and patch size \(p\), we want to create $N$ image patches denoted as \((x) p \in R^{N} \times\left(P^{2} C\right)\), where \(N=\frac{H W}{P} \cdot N\) is the sequence length similar to the words of a sentence.
- If you didn’t notice the image patch i.e. [16,16,3] is flattened to 16x16x3. The title of the paper should now make sense :)
- Let’s use the
einopslibrary that works atop PyTorch. You can install it via
pip:
$ pip install einops
- And then some compact Pytorch code:
from einops import rearrange p = patch_size # P in maths x_p = rearrange(img, 'b c (h p1) (w p2) -> b (h w) (p1 p2 c)', p1 = p, p2 = p)
- In short, each symbol or each parenthesis indicates a dimension. For more information on einsum operations check out this blogpost on einsum operations.
- Note that the image patches are always squares for simplicity.
- And what about going from patch to embeddings? It’s just a linear transformation layer that takes a sequence of \(P^{2} C\) elements and outputs \(D\).
patch_dim = (patch_size**2) * channels # D in math patch_to_embedding = nn.Linear(patch_dim, dim)
- What’s missing is that we need to provide some sort of order.
Positional embeddings
- Even though many positional embedding schemes were applied, no significant difference was found. This is probably due to the fact that the transformer encoder operates on a patch-level. Learning embeddings that capture the order relationships between patches (spatial information) is not so crucial. It is relatively easier to understand the relationships between patches of \(P \times P\) than of a full image \(Height \times Width\).
Intuitively, you can imagine solving a puzzle of 100 pieces (patches) compared to 5000 pieces (pixels).
- Hence, after the low-dimensional linear projection, a trainable position embedding is added to the patch representations. It is interesting to see what these position embeddings look like after training (source: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale):
- First, there is some kind of 2D structure. Second, patterns across rows (and columns) have similar representations. For high resolutions, a sinusoidal structure was used.
Key findings
- In the early conv days, we used to visualize the early layers. Why? Because we believe that well-trained networks often show nice and smooth filters. This following image visualizes AlexNet’s learned filters on the left (source: Standford’s Course CS231n and ViT’s learned filters on the right (source: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale).
- As stated in CS231n:
“Notice that the first-layer weights are very nice and smooth, indicating a nicely converged network. The color/grayscale features are clustered because the AlexNet contains two separate streams of processing, and an apparent consequence of this architecture is that one stream develops high-frequency grayscale features and the other low-frequency color features.” ~ Stanford CS231 Course: Visualizing what ConvNets learn
- For such visualizations PCA is used. In this way, the author showed that early layer representations may share similar features.
How far aways are the learned non-local interactions?
Short answer: For patch size \(P\), maximum \(P*P\), which in our case is 128, even from the 1st layer!
We don’t need successive conv. layers to get to 128-away pixels anymore. With convolutions without dilation, the receptive field is increased linearly. Using self-attention we have interaction between pixels representations in the 1st layer and pairs of representations in the 2nd layer and so on. The following image shows the mean attention distance v/s the network depth (source: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale) the receptive field growth on the right (source: generated using Fomoro AI calculator).
- Based on the diagram on the left from ViT, one can argue that:
- There are indeed heads that attend to the whole patch already in the early layers.
- One can justify the performance gain based on the early access pixel interactions. It seems more critical for the early layers to have access to the whole patch (global info). In other words, the heads that belong to the upper left part of the image may be the core reason for superior performance.
- Interestingly, the attention distance increases with network depth similar to the receptive field of local operations.
- There are also attention heads with consistently small attention distances in the low layers. On the right, a 24-layer with standard 3x3 convolutions has a receptive field of less than 50. We would approximately need 50 conv layers, to attend to a ~100 receptive field, without dilation or pooling layers.
- To enforce this idea of highly localized attention heads, the authors experimented with hybrid models that apply a ResNet before the Transformer. They found less highly localized heads, as expected. Along with filter visualization, it suggests that it may serve a similar function as early convolutional layers in CNNs.
Attention distance and visualization
- It is critical to understand how they measured the mean attention distance. It’s analogous to the receptive field, but not exactly the same.
- Attention distance was computed as the average distance between the query pixel and the rest of the patch, multiplied by the attention weight. They used 128 example images and averaged their results.
- An example: if a pixel is 20 pixels away and the attention weight is 0.5 the distance is 10.
- Finally, the model attends to image regions that are semantically relevant for classification, as illustrated below (source: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale):
Implementation
- Given an implementation of the vanilla Transformer encoder, ViT looks as simple as this:
import torch import torch.nn as nn from einops import rearrange from self_attention_cv import TransformerEncoder class ViT(nn.Module): def __init__(self, *, img_dim, in_channels=3, patch_dim=16, num_classes=10, dim=512, blocks=6, heads=4, dim_linear_block=1024, dim_head=None, dropout=0, transformer=None, classification=True): """ Args: img_dim: the spatial image size in_channels: number of img channels patch_dim: desired patch dim num_classes: classification task classes dim: the linear layer's dim to project the patches for MHSA blocks: number of transformer blocks heads: number of heads dim_linear_block: inner dim of the transformer linear block dim_head: dim head in case you want to define it. defaults to dim/heads dropout: for pos emb and transformer transformer: in case you want to provide another transformer implementation classification: creates an extra CLS token """ super().__init__() assert img_dim % patch_dim == 0, f'patch size {patch_dim} not divisible' self.p = patch_dim self.classification = classification tokens = (img_dim // patch_dim) ** 2 self.token_dim = in_channels * (patch_dim ** 2) self.dim = dim self.dim_head = (int(dim / heads)) if dim_head is None else dim_head self.project_patches = nn.Linear(self.token_dim, dim) self.emb_dropout = nn.Dropout(dropout) if self.classification: self.cls_token = nn.Parameter(torch.randn(1, 1, dim)) self.pos_emb1D = nn.Parameter(torch.randn(tokens + 1, dim)) self.mlp_head = nn.Linear(dim, num_classes) else: self.pos_emb1D = nn.Parameter(torch.randn(tokens, dim)) if transformer is None: self.transformer = TransformerEncoder(dim, blocks=blocks, heads=heads, dim_head=self.dim_head, dim_linear_block=dim_linear_block, dropout=dropout) else: self.transformer = transformer def expand_cls_to_batch(self, batch): """ Args: batch: batch size Returns: cls token expanded to the batch size """ return self.cls_token.expand([batch, -1, -1]) def forward(self, img, mask=None): batch_size = img.shape[0] img_patches = rearrange( img, 'b c (patch_x x) (patch_y y) -> b (x y) (patch_x patch_y c)', patch_x=self.p, patch_y=self.p) # project patches with linear layer + add pos emb img_patches = self.project_patches(img_patches) if self.classification: img_patches = torch.cat( (self.expand_cls_to_batch(batch_size), img_patches), dim=1) patch_embeddings = self.emb_dropout(img_patches + self.pos_emb1D) # feed patch_embeddings and output of transformer. shape: [batch, tokens, dim] y = self.transformer(patch_embeddings, mask) if self.classification: # we index only the cls token for classification. nlp tricks :P return self.mlp_head(y[:, 0, :]) else: return y
Conclusion
- The key engineering part of this work is the formulation of an image classification problem as a sequential problem by using image patches as tokens, and processing it by a Transformer. That sounds good and simple but it needs massive data. Unfortunately, Google owns the pretrained dataset so the results are not reproducible. And even if they were, you would need to have enough computing power.
Citation
If you found our work useful, please cite it as:
@article{Chadha2020DistilledVisionLanguageModels, title = {Vision Language Models}, author = {Chadha, Aman}, journal = {Distilled AI}, year = {2020}, note = {\url{}} } | https://aman.ai/primers/ai/vit/ | CC-MAIN-2022-40 | refinedweb | 2,116 | 56.76 |
Using namespace local variables instead of global ones make code cleaner with virtually zero overhead in storage and memory usage but has the side effect that, for the verifier, those variables look like local variables (even if their scope is the entire duration of the program). Because of that, using these variables results in one always seeing more or less the same value for the Global variables use when the program is verified even when adding new variables.
Did anyone found a middle ground for this? Ideally I wanted to use the namespace-scoped variables but have them accounted as globals but any alternative that is not simply “just use globals” would be great. | https://forum.move38.com/t/disadvantage-of-using-namespaces/535/4 | CC-MAIN-2020-34 | refinedweb | 114 | 51.21 |
I the time. It turns out I can’t even clone and run this because I didn’t add a setup.py or requirements.txt file, a mistake I would never make today!
This leaves me reflecting on how the quality of my Python code has changed over the years. It’s certainly gotten a lot cleaner, more robust, and easier to read. But what is it that makes it this way?
In this post I’m going to explore some changes I’ve made to the way I write Python—both big and small. I do this in the hopes that I can help you improve the quality of your Python code. Some of these techniques may even be applicable to other languages and technologies.
1. Make your code a PIP-installable Package
When you come across a new Python package, it’s always easier to start using it if all you have to do is run “pip install” followed by the package name or location.
There are a number of ways to do this, my “go to” being to create a setup.py file for my project.
Assume we have a simple Flask program in “flask_example.py”:
from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' def main(): app.run() if __name__ == ‘__main__’: main()
We can turn this into an installable Python package by first moving it into a separate folder (let’s call this “flask_example/”. Then, we can make a setup.py file in the root project folder that looks like this:
from distutils.core import setup setup( name='flask_example', version='1.0', description='Hello, World! in flask.', packages=['flask_example'], install_requires=[ 'Flask==0.12.2' ], entry_points = { 'console_scripts': 'runserver=flask_example.flask_example:main' } )
This has a few advantages that comes with it. First, you can now install your app locally using “pip install -e .” This makes it easier for developers to clone and install your project because the setup.py file will take care of all the heavy lifting.
Second, with the setup.py file comes dependency management. The install_requires variable allows you to define packages and specific versions to use. If you’re not sure what packages and versions you are using, run “pip freeze” to view them.
Lastly, this allows you to define entry points for your package, which allows you to now execute the code on the command line by simply running “runserver”.
2. Lint Your Code in a Pre-Commit Hook
Using a linter can fix so many problems in code. PyLint is a great linter for Python, and if you’re using a version control system like Git, you can make Git run your code through a linter before it lets you commit your code.
To do this, install the PyLint package.
pip install pylint
Then, add the following code to .git/hooks/pre-commit. If you already have a pre-commit hook doing something, simple append the pylint command to the end of your file.
#!/bin/sh pylint <your_package_name>
This will catch all kinds of mistakes before they even make it into your Git repository. You’ll be able to say goodbye to accidentally pushing code with syntax errors, along with the many other things a good linter catches.
3. Use Absolute Imports over Relative Imports
In python, there are very few situations where you should be using relative module paths in your import statements (e.g. from . import module_name). If you’ve gone through the process of creating a setup.py (or similar mechanism) for your Python project, then you can simply reference submodules by their full module path.
Absolute imports are recommended by PEP-8, the Python style guide. This is because they’re more informative in their names and, according to the Python Software Foundation, are “better behaved.”
I’ve been in positions where using relative imports has quickly become a nightmare. It’s fine when you first start coding, but once you start moving modules around and doing significant refactoring, they can really cause quite the headache.
4. Context Managers
Whenever you’re opening a file, stream, or connection, you’re usually working with a context manager. Context managers are great because when used properly they can handle the closing of your file should an exception be thrown. In order to do this, simply use a keyword.
The following is how most beginner Python programmers would probably write to a file.
f = open(‘newfile.txt’, ‘w’) f.write(‘Hello, World!’) f.close()
This is pretty straightforward. But imagine this: You’re writing thousands of lines to a file. At some point, an exception is thrown. After that happens, your file isn’t properly closed, and all the data you thought you had already written to the file is corrupt or non-existent.
Don’t worry though, with some simple refactoring we can ensure the file closes properly, even if an exception is encountered. We can do this as shown below.
with open(‘file’, ‘w’) as file: file.write(‘Hello, World!’)
Volla! It really is that simple. Additionally, the code looks much cleaner like this, and is more concise. You can also open multiple context managers with a single “with” statement, eliminating the need to have nested “with” statements.
with open(‘file1’, ‘w’) as f1, open(‘file2’, ‘w’) as f2: f1.write(‘Hello’) f2.write(‘World’)
5. Use Well-Named Functions and Variables
In Python, and untyped languages especially, it can easily become unclear what functions are returning what values. Especially when you’re just a consumer of some functions in a library. If you can save the developer the 5 minutes it takes to look up the function in your documentation, then that’s actually a really valuable improvement. But how do we do this? How can something as simple as changing the name of a variable save development time?
There are 3 main things I like to take into consideration when naming a function or variable:
- What the function or variable does
- Any units associated with the function or variable
- The data type the function or variable evaluates to
For example, if I want to create a function to calculate the area of a rectangle, I might name it “calc_rect_area”. But this doesn’t really let the user know much. Is it going to return the value, or is it going to store it somewhere? Is the value in feet? Meters?
To enhance the name of this function, I would change it to “get_rect_area_sq_ft”. This makes it clear to the user that the function gets and returns the area. It also lets the user know that the area is in square feet.
If you can save the developer 5 minutes here and there with some nicely named functions and variables, that time starts to add up, and they’ll appreciate your code all the more.
Conclusion
These tips are ones that I have found to be helpful over my years as a Python programmer. Some of them I figured out on my own over time, some of the others had to teach me so I could learn them. I hope this list helps you in your effort to write better Python.
Have some tips of your own? Share them in a comment below. | https://michaelwashburnjr.com/blog/5-tips-for-writing-better-python | CC-MAIN-2022-21 | refinedweb | 1,210 | 74.19 |
Here's a simple tutorial on dictionaries in Python:
Dictionaries:
Dictionaries are similar to other compound types except that they can use any immutable type as an index. One way to
create a dictionary is to start with the empty dictionary and add items. The empty dictionary is denoted {}:
end2sp = {} end2sp[ "one" ] = "uno" end2sp[ "two" ] = "dos"
We can print the current value of the dictionary in the usual way:
print eng2sp # --> { "one":"uno", "two":"dos" }
The elements of a dictionary appear in a coma-separated list. Each entry contains an index and a value separated by
colon. The indices are called keys, so the elements are called key-value pairs.
Another way to create a dictionary is to provide a list of key-value pairs using the same syntax as the previous output.
eng2sp = { "one":"uno", "two":"dos", "three":"tres" } print eng2sp # --> { "one":"uno", "three":"tres", "two":"dos" }
Note: the key-value pairs are not in order but the elements in a dictionary are never indexed with integers so there
is no reason to worry about that. Instead we look up the key:
print eng2sp[ "two" ] # --> "dos"
Dictionary operations:
The 'del' statement removes key-value pair from a dictionary.
inventory = { "apples":430, "bananas":312, "oranges":525 } del inventory[ "oranges" ] print inventory # --> { "apples":430, "bananas":312 }
The 'len' function also works on dictionaries; it returns the number of key-value pairs.
len( invenroty ) returns 2
Dictionary methods:
A method is similar to a function - it takes and returns a value - but the syntax is different. For example, the keys
method takes a dictionary and returns a list of the keys that appear, but instead of the function syntax keys( eng2sp )
we use the method syntax eng2sp.keys()
print eng2sp.keys() # --> [ "one", "three", "two" ]
The values method is similar; it returns a list of values in the dictionary:
print eng2sp.values() # --> [ "uno", "tres", "dos" ]
The items method returns both, in the form of a list of tuples - one for each key-value pair
print eng2sp.items() # --> [ ("one", "uno"), ("two", "dos"), ("three", "tres") ]
If a method takes an argument, it uses the same syntax as a function call. For example, the method has_key takes a key
and returns True if the key appears in the dictionary:
eng2sp.has_key( "one" ) # --> True ( using the previous example dictionary ) eng2sp.has_key( "four" ) # --> False ( using the previous example dictionary )
Note: if you try to invoke a method without specifying an object, you get an error.
Aliasing and copying:
Because dictionaries are mutable, you need to be aware of aliasing. Whenever two variables refer to the same object,
changes to one affect the other. If you want to modify a dictionary and keep a copy of the original, use the copy method.
opposites = { "up":"down", "right":"left", "wrong":"true" } alias = opposites copy = opposites.copy() alias[ "right" ] = "left" print opposites[ "right" ] # --> "left" copy[ "right" ] = "privilege" print opposites[ "right" ] # --> "left" again because we made a deep copy of the dictionary
e.g. Write a function that returns the number of letters in a string.
solution:
def letterCount( string ): letters = {} for l in string: letters[ l ] = letters.get( letter, 0 ) + 1 return letters
How's it work:
The 'get' method takes two parameters - the first one is the key to be found in the dictionary and the second
parameter is the value to be returned if the key is not found. If the key is in the dictionary, its value is
corresponding value is returned.
So if 'l' is not in the dictionary letters[ l ] = 0 + 1, i.e. 'l' is a new letter in the dictionary.
Output:
letterItems = letterCount( "Mississippi" ) print letterItems # --> { "M":1, "s":4, "p":2, "i":4 }
You can also display the results in alphabetical order by sorting the keys:
tmp = letterItems.items() tmp.sort() print tmp # --> [ ("M", 1), ("i", 4), ("p", 2), ("s", 4) ]
Resource: How To Think Like A Computer Scientist and some of my own stuff :)
Hope it is helpful :)
Edited 7 Years Ago by vegaseat: n/a | https://www.daniweb.com/programming/software-development/tutorials/240326/simple-dictionary-use | CC-MAIN-2016-50 | refinedweb | 663 | 59.64 |
go to bug id or search bugs for
I am currently experincing some problems with missing post form data.
There seem two be 2 problems:
1) When a variable is long (for example a textarea and lots of text is in it), the post data is not sent.
2) Sometimes even with small textarea, the post is still not outputed, but if you hit refresh and click reload post data, it sometimes works.
I have also set the max post size to 20MB which should be plenty for just text.
I seem to have this problems on all browsers / computers.
Ay ideas?
Thanks
Joel
Add a Patch
Add a Pull Request
I did not report that bug, but have the same problem. To be more specific:
I am using the command line version of PHP 4.2.3-Win32. But the problem still exists under php 4.3.0.
The bug (or misconfiguration?) is also reproducable with command line version of PHP4.2.3 under Linux.
When POST is used (in conjunction with multipart/form-data)the POST data is not read by PHP.
Writing an own funtion to read the POST data will let you read the POST data.
I could setup an URL to reproduce it and with a <? phpinfo(); ?> page to display how the variables are set. (I could also paste it here...)
regards
Stefan
Additional info:
I am NOT using Apache. The used web server passes POST data untouched to the CGI (here the php executable).
regards
Stefan
I guess your problem is identical to bug #19460. Please confirm if httpd.conf is edited experiencing the same problem under WinXP SP1, Apache 1.3.27, PHP 4.3.1 (installed as Apache Module). In my particular case I tried installing postnuke and got stuck an the license screen (a large textarea) which just won't get submitted using POST. I also experience intermittent POST failures when submitting smaller forms (like the first install screen which only asks to select a language).
What is the parameter in httpd.conf that should be checked? I would be glad to assist in getting rid of this as it is very annoying.
I can also reproduce this problem with PHP 4.3.2.
On WinXP SP1 / Apache 1.3.27 / PHP 4.2.2(module) / testing locally with IE6 SP1
This bug has changed topic it seems, but on the original matter I have it too - tiny effective limits with $_POST and $_FILES.
By echoing getenv(CONTENT_LENGTH) I find a limit of 488 bytes from text-only form data (above which $_POST returns empty). Using HTTP upload by POST the cutoff is about 2.5k for a gif file. (Limit is higher when not using SSL but I guess that is to be expected?)
I hope this is a useful contribution to a bug that seems to be taxing a lot of folks.
Hi,
Don't know if it helps but I found out that informations about the file uploaded from a form using "multipart/form-data" like in the example below is not in the $_POST array but in the $_FILES array
<form enctype="multipart/form-data" method="post" action="WinnyReader.php">
<input type="file" name="fWinnyFile" size="40" />
<input type="submit" value="Go" />
</form>
After hitting the submit button, the second script (in my example, "WinnyReader.php") will look for informations about the file in $_FILES["fWinnyFile"] (and not in $_POST["fWinnyFile"] even if the method of the form is POST!!).
That will do something like this:
if (isset($_FILES["fWinnyFile"]))
{
$arWinnyFile = $_FILES["fWinnyFile"];
echo "name : " . $arWinnyFile["name"] . "<br />\n";
echo "type : " . $arWinnyFile["type"] . "<br />\n";
echo "tmp_name : " . $arWinnyFile["tmp_name"] . "<br />\n";
echo "error : " . $arWinnyFile["error"] . "<br />\n";
echo "size : " . $arWinnyFile["size"] . "<br />\n";
$stFilename = $arWinnyFile["tmp_name"];
}
else
{
...
}
Hope this helps!
Vincent FINET
I have also the first of these problems.
The script below reproduces the bug.
When entering a small amount of data, the data is displayed.
With a large amount of data (e.g. a screen full of letters pasted into the text area) the data is lost.
I am using gentoo linux, php 4.3.8 and Apache 2.0.50.
If anything is missing please let me know.
Best regards,
Christian Neise.
<html>
<body>
<form method="POST">
<textarea name="test">
<?php echo $_POST['test']; ?>
</textarea>
<hr><input type="submit" name="dummy"><hr>
<pre>
<?php print_r($_POST); ?>
</pre>
</body>
</html>
I too am experiencing what has been described in the this submission.
I think I have isolated it to php on windows. I summarize it thus because I have an xp, w2k3 and wme servers that experience the same problem.
Yes I have used the latest version as of today 4.3.9 build date 7/30/04.
I have scripts that have alot of post data, a table full of input objects, the table can be quite large. If I exceed a certain amount (I know it is not an arbitrary size, but I don't know what the size is, but I can duplicate it). Below are my scripts.
<?php
print '<html><head></head><body><form name = "pageform" action = "post.php" method = "post"><table>';
for ($l = 0; $l < 100; ++$l)
{
print "<tr><td>First Name</td><td><input type = \"text\", name = \"firstname[$l]\" /></td>\r\n";
print "<td>Last Name</td><td><input type = \"text\", name = \"lastname[$l]\" /></td>\r\n";
print "<td>City</td><td><input type = \"text\", name = \"city[$l]\" /></td>\r\n";
print "<td>State</td><td><input type = \"text\", name = \"state[$l]\" /></td></tr>\r\n";
}
print '</table><input type = "submit" value = "submit"/></form></body></html>';
?>
This simply provides my form with a lot of input elements in my html.
When submitted it will call the following script
<?php
print getenv('CONTENT_LENGTH');
print "$HTTP_RAW_POST_DATA<br>";
print_r($_POST);
?>
Here is the output
6559
Array ( )
Now if I change my script (action = "cgi-bin\post.ext") to call the following c compiled script...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()
{
char *endptr;
int i;
double contentlength;
char buff[10000];
char a,b;
const char *len1 = getenv("CONTENT_LENGTH");
contentlength=strtol(len1, &endptr, 10);
fread(buff, contentlength, 1, stdin);
printf("Content-type: text/html\n\n%s",buff);
}
to do the same thing essentially I will get the following
5B95%5D=&lastname%5B95%5D=&city%5B95%5D=&state%5B95%5D=&firstname%5B96%5D=&lastname%5B96%5D=&city%5B96%5D=&state%5B96%5D=&firstname%5B97%5D=&lastname%5B97%5D=&city%5B97%5D=&state%5B97%5D=&firstname%5B98%5D=&lastname%5B98%5D=&city%5B98%5D=&state%5B98%5D=&firstname%5B99%5D=&lastname%5B99%5D=&city%5B99%5D=&state%5B99%5D=
This is just a portion of the data that I get, it happens to be the last of the output do demonstrate that I do get the last of the input elements, notice city%5b99%5d, this is the 99th city element, the loop goes from 0-99.
Now if you reduce the loop to be 0-5 for example
(for ($l = 0; $l < 5; ++$l)) I get the following output when I use the first script (action = "post.php").
309firstname%5B0%5D=&lastname%5B0%5D=&city%5B0%5D=&state%5B0%5D=&firstname%5B1%5D=&lastname%5B1%5D=&city%5B1%5D=&state%5B1%5D=&firstname%5B2%5D=&lastname%5B2%5D=&city%5B2%5D=&state%5B2%5D=&firstname%5B3%5D=&lastname%5B3%5D=&city%5B3%5D=&state%5B3%5D=&firstname%5B4%5D=&lastname%5B4%5D=&city%5B4%5D=&state%5B4%5D=
Array ( [firstname] => Array ( [0] => [1] => [2] => [3] => [4] => ) [lastname] => Array ( [0] => [1] => [2] => [3] => [4] => ) [city] => Array ( [0] => [1] => [2] => [3] => [4] => ) [state] => Array ( [0] => [1] => [2] => [3] => [4] => ) )
The first part is the raw post data, the last is the $_POST variable.
I did the c compiled script, simply to rule out my webserver (apache 1.3.27).
After updating from 4.3.7 to 4.3.8 i'm loosing
POST data. If i create a form with normal text fields and not to much input data there doesn't seem to be a problem.
If i use <textarea> with a text larger 985 characters the post data is not send.
Used this script to test:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form action="index.php" method="post">
<textarea name="text"></textarea>
<input type="submit"
</form>
<?
print_r($_POST);
?>
</body>
</html>
if i add 'enctype="multipart/form-data"' to the form. All post data is send.
php version : 4.3.8
os: OpenBSD 3.5-current
apache: 1.3.29
From my point of view, there seems to be a dependance between the appearance of this issue, and the webbrowser being used.
For example, I never had such an effect using Opera 8.54, but reliably could reproduce a missing of some first (and always 1 or 2 first) submitted fields (text, textarea, or files) when using Microsoft Internet Explorer 6.0 (XP SP2).
I now started to circumvent this problem by adding two dummy hidden input fields which are expendable. Still, this issue needs further investigations, by adding different browsers into account.
I confirm to you that i reproduce this problem with PHP5.
The first field (TextArea) is missing when i read $_POST with var_dump($_POST).
This bug exists only when i'm using Internet Explorer (6.0 for my version), not with Firefox 1.5.
I'm searching for a solution.
May be i have to create 2 dummy hidden fields :(:(
Please send me an email if you find the solution.
we experience the same trouble as "rossi at nelis dot fr"
A form is send with POST method and with enctype multipart/form-data, in the target page the first field is missing. It is only occuring in IE6.0, and only with the enctype
I am also getting the exact same problem as "rossi at nelis
dot fr" and "gregory dot boyer at limbas dot com". I am not
able to reproduce this problem in other browsers than IE6
posting using multipart/form-data as enctype.
Forgot to mention that I am having this problem with PHP 5.1.4
running on FreeBSD and Apache 1.3.34.
Sorry for flooding this one, but I have noticed something else
that I think is important here. I am not always getting this
bug with IE6 either, it depends on the text I submit into one
of my textarea or text fields. If one of them containts a
double quotation mark of the type you get if you press shift-2
within Word (not the standard double quotation mark, which
works fine) and copy/paste the text into a textarea or
textfield.
Please contact me if you need a better explaination and/or
testdata.
Same prob, PHP5 in cgi, Apache and env REQUEST_METHOD is POST, there is a content length, but $_POST is empty...
This is not a prob with my browser. Tested with Opera 9 and Firefox 1.5. And oh, no prob with an other server :/
Weird.
Not sure if it exactly the same problem but POST related.
- PHP5.2.0RC6-dev
- Apache 2.2.3
- IE6
Code
<form name="processing" method="POST" action="sqlprocess.php">
SQL : <input type="text" name="sqlstring" /><br>
SQL2 : <input type="text" name="sqlstring2" /><br>
SQL3 : <input type="text" name="sqlstring3" />
<input type="submit" value="SUBMIT"/>
</form>
/*sqlprocess.php */
$query = $_REQUEST["sqlstring"];
$query2 = $_REQUEST["sqlstring2"];
$query3 = $_REQUEST["sqlstring3"];
print "Query: " . $query . "<br>";
print "Query2: " . $query2 . "<br>";
print "Query3: " . $query3 . "<br>";
---------
Problem: None of the field show up when request.
Experiments
1. Change form method to GET and it work perfectly.
2. Add/Remove fields make no different, still get nothing.
3. Change $_REQUEST to $_POST or $HTTP_POST_VARS make no different, still get nothing.
4. Change browser to Firefox 2.0b1 and it works fine.
5. Change browser to Opera 9.01 builds 8552 and it works fine.
Expecting the problem to be incompatibility between PHP5.2 and IE6.
I was using PHP5.1.6 and IIS and POST method works.
I'm experiencing the same problem.
Server's running Apache 2 on a Windows Server 2003 machine.
IE 6.0, Windows XP SP 2, and about 90% of the time, POST data never reaches my PHP script.
Firefox 1.5 in the same conditions, and it runs perfectly.
It does seem suspiciously like an IE bug, but this seems too big to be a coincidence that IE never sends POST data to only these PHP applications.
I had the same problem with empty $_POST table.
In my case solution was to remove post_max_size line from php.ini.
In php.ini i had
post_max_size = 16000
instead of default post_max_size = 8M
I am experiencing the same problem reported on 29 Aug 2006 by "egil at egil dot net". I can add some more details:
- I confirm that it happens only with IE;
- it is triggered when a character between 0x80 and 0x9f is used in a form field (e.g. the "Word" quotation marks, but also the Euro symbol) -- please note that these are the transposition in the "high half" part of extended ASCII of the 32 "control characters" of ASCII (0x00 - 0x1f);
- it has some relationship with character encoding;
- I can reproduce it on Linux with Apache 2 on Fedora 4 - 6 if I don't force "AddDefaultCharset UTF-8" in httpd.conf (the default in Fedora); with this directive the problem dies not happen, but the "strange" characters are interpreted incorrectly (because the file is not UTF8);
- I cannot reproduce it on Linux Mandrake 10 / Apache 2;
- I cannot reproduce it on Windows XP / XAMPP (Apache 2).
A further interesting detail: it happens only if the file containing the form has the .php extension; if it has the .htm extension it does not happen! (please note that I am using plain HTML for the form and some PHP to show the results).
From all of the above, it looks like it is not a PHP bug, but instead a IE6 bug that is triggered by some combination of MIME types and character encodings.
I am going to prepare a simpler test case (I am currently using a rather complicated page with a multi part form that I extracted from an application that was working on Mandrake and ceased to work on Fedora, and worked again by adding a dummy hidden field as the first one in the form...). When it will be ready I will post it here.
In the meantime, does anyone know if a similar problem has been reported elsewhere?
I experience this problem as well.
* Happens both with and without enctype set for form
* Happens in IE6 and IE7, NOT in Firefox 1.5/2
* Changing form to GET works flawlessly
* Input can range from a few text fields (1-6) or a mix of text fields and file fields, or just file fields (enctype set when file fields exist) and POST data will come up empty
* Often times hitting reload and selecting to resubmit the form data will have the POST data show up
* NO POST data will show up - I don't just lose some early fields
PHP 5.2.x (module), Apache 2.2.x, Windows XP SP2
This is a serious issue. Doesn't seem like anyone in this thread has found any sort of solution. Please post (or GET, ha) if you have any insight.
I have been having similar problems, i.e. a form which submits happily in Firefox, but not in IE 7. I have found this (very old!) forum entry - - which covers my issue, and I have implemented the solution by checking for (isset($_POST['submit']) || isset($_POST['submit_x'])) to check whether my submit button has been clicked. Note that is an underscore, not a '.'.
The solution works for GET method as well, if you are using that. If you submit a form with a 'submit' image button using GET, the browser URL shows submit.x=aa&submit.y=bb where aa and bb are the coordinates within the button image of where you clicked, but you should still check for $_GET['submit_x'] NOT $_GET['submit.x'].
As discussed in the above referred forum log this is an issue affecting Internet Explorer, Netscape and Opera, and maybe other browsers, and seems to be a simple failure to conform to the HTML standard for handling forms.
Hope this helps someone.
Andy
I have experienced this issue also.
My environment is:
- php 4.4.2 as a module
- Apache 1.3
- Windows 2000 Server
When I send a form with a text area using POST i don't receive any data.
In my case, it was because I was sending de form using a Javascript code:
function newitem(tipus)
{
var accion;
if (tipus == 1)
{
accion = document.mailing.action="pre_mailingsmanuals.php";
}
else
{
accion = document.mailing.action="env_mailingsmanuals.php";
}
document.mailing.action=accion;
document.mailing.submit();
}
The input was specified as a button: <input type="button" onclick="newitem(1) ...>" instead of as a submit.
Also, I was using a Rich Text Area. This issue doesn't occurs with a normal textarea.
The form get working when I change the "button" for a "submit", without use javascript code for send it.
I hope this message may be usefull for other users with the same problem. There is an official response from the PHP team from this issue ?
Regards
Just came across the same problem myself last week.
PHP 5.1.6
Apache 2.0.59
FreeBSD 6.1-RELEASE-p11
EVERY browser I have tried in Windows fails to work past a request size of about 1450 bytes. I have tested IE 6.0, FF 2.0.0.3 and Safari Beta 3. PHP still returns the requests size via getenv("CONTENT_LENGTH") but both $_POST and $_GET are empty.
When I try the EXACT same page on the EXACT same server with both FF 2.0.0.3 and Safari 2.0.4(419.3) I have no problems submitting however much data I want. Here's my test form:
/-------- CODE ---------/
<html><head><title>TEST</title></head>
<body>
<pre>
<?php
print_r($_POST);
print_r($_GET);
echo "Request Length: ".getenv("CONTENT_LENGTH");
?>
</pre>
<form method="post" name="form" enctype="multipart/form-data" action="test.php">
<input type="file" name="file" /><br>
<input type="text" name="field" value="<?php echo $_POST['field']; ?>" /><br>
<textarea cols="80" rows="8" name="text"><?php echo $_POST['text']; ?></textarea><br>
<input type="image" name="submit" src="images/addcart.gif" /><br>
<input type="submit" name="submit-button" value="Real Submit Button" />
</form>
</body></html>
/-------- CODE ---------/
I get the same result with and without the enctype. I can't believe nobody has found a solution for this yet. If somebody has, please post it here or email me and I will.
As a follow-up to my post yesterday, it appears as though the firewall software we have on our Windows machine (Comodo Firewall) was the cause of the problem. Using the Windows firewall didn't cause any problems. This may not be the case in for the other people with problems but I thought I would at least post the resolution to mine.
I would recommend that everyone disable all firewall and security software if they are experiencing this problem.
I just want to say Thanks a lot for comment called ([27 Mar 2003 2:08am UTC] sendoffer at ukr dot net); because my problem solved for same issue.
BR, Ali
Hi,
I found the same POST problem. I have a login form and it works fine on FireFox and IE 6.0.3790, but not on IE 6.0.2800. If the username and password are all one word it works fine on IE 6.0.2800 but if it is made of 2 or more words it only posts the variables once in every 10 or so posts.
I read that this problem can be got around by using .htm extension rather than .php - to get around this I changed the httpd.conf file to read:
AddType application/x-httpd-php .php .htm
I then changed the extension of my login file to .htm and this seems to work ok.
I am still looking for why this worked... but...
When I changed "$_POST" to "$HTTP_POST_VARS", the form data is now there. I think it has something to do with the global variables setting, but not sure yet.
The same problem happens to me (and my users unfortunately).
- PHP Version 5.1.6
- Apache/2.2.3 (CentOS)
- only with enctype="multipart/form-data"
- only with IE6 on WinXP sp2
- _POST is completely empty (count($_POST) === 0)
- Uploaded files are smaller than 3 MB.
- Charset: US-ASCII (both Apache header and Meta-tag)
For some reason only _some_ IE6 WinXP SP2 machines trigger this error.
Opera and Firefox do not seem to trigger this error at all.
Hi there,
I solved this problem setting
output_buffering = On
in my PHP.ini.
I hope this helps.
Umberto Meroni
When the post data contains HTML special entities i.e. "&" it is stripped off. PHP POst variable only contains data before the first occurrence of "&"
I am not sure whether it is a bug or something else. I am yet to test the POST containing other HTML entities. I have been trying to solve the issue but it remains yet.
Any help there?
This post exists to try and organize what I've read above.
There appear to be two main issues here. The special character issue in IE seems to be well understood at this point. The fix is to to translate all those characters into ascii (unicode html entities are helpful here).
However, it appears that several people, including myself, still have a length problem. In my script, I have max_post_size set to 50M and output_buffering on (as suggested in these comments). I have an all-ascii piece of data, which works up to 10021 characters, but fails at 10022, regardless of what the last character is. This fails in all browsers: Safari, Firefox, and IE. The data is not accessible via $_POST or $HTTP_POST_VARS. It fails with or without enctype="multipart/form-data". getenv("CONTENT_LENGTH") is 10173 in Firefox and 10111 in Safari. If I change to a GET request, I receive an error indicating that the URI is too long for the server to support.
My setup is:
PHP 5.03
Apache 1.3.33
FreeBSD 4.10
It appears I miscounted the length of my data in the above comment. Here is a test script that proves the maximum length, at least on this setup, is exactly 10,000 characters:
<html>
<body>
<p>
<?php
echo "<strong>Request Length:</strong> " . getenv("CONTENT_LENGTH") . "<br />";
echo "<strong>POST:</strong> "; print_r($_POST); echo "<br />";
echo "<strong>HTTP_POST_VARS:</strong> "; print_r($HTTP_POST_VARS);
?>
</p>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<textarea name="test" rows="50" cols="80"><?php
for ($i = 0; $i < 10001; $i++) {
echo 'a';
}
?></textarea>
<input type="submit" />
</form>
</body>
</html>_array_depth 100 100
suhosin.post.max_array_index_length 64 64
suhosin.post.max_name_length 64 64
suhosin.post.max_totalname_length 256 256
suhosin.post.max_value_length 65000 65000
suhosin.post.max_v!
All, I'm having the same problem but useing struts/apache java combo...
i noticed during the post, i was missing data. To resolve the issue, i finally found out that I had to right click on my web page and set the encoding to UTF-8. I resubmitted and it worked properly....
hopefully this helps others out there with the same issue...
Had this same issue where form fields would NOT get passed if I was using IE6, but went through without issues on Firefox. Using $_POST, $_GET I would get nothing...
I traced the problem to the name I had given to textfield inputs -
<input name="height" type="text">
<input name="length" type="text">
Changed them to m_height and m_length respectively and the form passed without issues. Perhaps there are some reserved keywords that you cannot use as name in IE6?
Hope that helps.
Derrick
CONFIRMATION: The bug is present even using PHP 5.x and Apache 2.x ON WINDOWS; It only shows up when posting from IE an using multipart/data. Firefox works just fine.
Regarding the enctype="multipart/form-data" not populating the $_POST vars I found my solution was to disable the Suhosin security module.
Have a go!
I was facing the same problem. I had a html form with php scripts in which I was submitting radio buttons or checkboxes. When I post the form, PHP was not finding any post parameters. it was random, some time it was working and some time not. Even I tried with Get, it worked some time and some time not. Then I change ENCTYPE from uppercase to lowercase and it started working prefectly
<form enctype="multipart/form-data" action="ManageMapping.php" method="POST">
Please ignore the above comments. changing the case did not fix the problem. Its just irratic. it works some time, it does not work some time. The problem with both post and get. I have a checkbox and submit button in the form. If I do not check the checkbox and just submit the button, it works but if I use check and enter submit, it does not work.
I moved the related part of the code from the big php file and tried to isolate the problem. Surprisingly it works perfectly as a small file but in the big php which has few more forms and tables, it does not work.
=====
<?php
echo "<pre>";
echo "post is";
print_r($_POST);
echo "get is";
print_r($_GET);
echo "request is";
print_r($_REQUEST);
echo "let us check HTTP_POST_VARS";
print_r($HTTP_POST_VARS);
echo "</pre>";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<html>
<head>
<meta http-
<link rel="stylesheet" type="text/css" media="all" href="../../stylesheet.css">
<title>Managing URL to StartContext Mapping </title>
</head>
<body style="margin: 0px;" onLoad="preloader();">
<form enctype="multipart/form-data" action="test1.php" method="POST">
<input type="hidden" name="submitted" value="true">
<input type="checkbox" name="dboptions" class="radio">Delete existing mappings from the database before loading the data from the CSV File.
<input type="submit" name="submit" class="buttons" value="submit">
</form>
</body>
</html>
===============
I have the same problem!
sometimes, all post variables disappear although that I use a normal form with normal text inputs & normal data size. no textareas and no "multiform" tag in the form
php version : 5.1.6 apache webserver on Linux server.
I'm still unable to fix it!
I am also experiencing loss of form fields, albeit randomly. is there not a function to reload/refresh the data, i'm sure i've seen one albeit deprecated.
hi, i forgot to add the form submitted. i believe this could be in ie, but why? how can i prevent this from happening?
<form name="contact" method="POST" action="action.php" enctype="multipart/form-data" id="contact" onSubmit="return Validatecontact(this);">
using php 5.2.9 - believe the problem to be client browser side as reported in other comments.
Same problem here - $_POST is randomly incomplete or empty.
I have only seen this with IE - from version 6 to 8.
tcpdump shows a bit more of the story:
user sends:
POST /bla.php?id=bla
...
Content-Length: 80
but there is no data in that packet.
A bit later Apache reaches timeout, and closes the connection. At this point it send a 503 error to the user, but executes PHP with the incomplete post.
After the user received the 503 error - the browser actually sends a packet with the missing post data. Strange and clearly a browser bug. It should be noted that the post is so small that there is plenty of room in the first packet.
Now - the strange part is - why is PHP being executed? And why is PHP allowing it self to be executed. Content-Length is clearly invalid, and the conntection is closed (and PHP is setup to ignore aborted requests (ignore_user_abort is off).
Had the same problem (the submited data was truncated) and fixed it by editing the suhosin.ini file, something like this(uncommented some lines and increased the values):
; Filtering Options
;suhosin.filter.action =
.get.max_array_depth = 150
suhosin.get.max_array_index_length = 164
suhosin.get.max_name_length = 164
suhosin.get.max_totalname_length = 512
suhosin.get.max_value_length = 1024
suhosin.get.max_vars = 500
suhosin.get.disallow_nul = on
suhosin.post.max_array_depth = 500
suhosin.post.max_array_index_length = 1024
suhosin.post.max_name_length = 164
suhosin.post.max_totalname_length = 1256
suhosin.post.max_value_length = 650000
suhosin.post.max_vars = 1200
suhosin.post.disallow_nul = on
suhosin.request.max_array_depth = 500
suhosin.request.max_array_index_length = 1024
suhosin.request.max_totalname_length = 1256
suhosin.request.max_value_length = 650000
suhosin.request.max_vars = 1200
suhosin.request.max_varname_length = 164
suhosin.request.disallow_nul = on
;suhosin.upload.max_uploads = 25
;suhosin.upload.disallow_elf = on
;suhosin.upload.disallow_binary = off
;suhosin.upload.remove_binary = off
;suhosin.upload.verification_script =
;suhosin.session.max_id_length = 128
We don't support PHP 4 anymore and we never supported patched PHP (like with Suhosin).
Please try again with a recent PHP version, unpatched.
I am having this problem now with version 5.4.0. I am shocked to see that this
issue has been around since 2003 and it is still happening. I've been using PHP
for about 8 years and never came across this before. Also this just started
happening to me after I moved my site to a brand new server and upgraded to
version 5.4 so I'm guessing there must be some unique configuration combination
that causes this to happen.
I am having it happen with small text fields (20 characters or less). Being
able to rely on post back data is obviously critical to any PHP application so
why is this bug still around? It's embarassing to have to tell my clients "I
don't know why it's doing.
Seems like I have the original issue, but not with the same symptoms of all the off-topic add ins over the years. Ubuntu 12.04, php 5.3.10-1ubuntu3.6
Problem exists in all browsers (yes, FF 19.0.2), did not with same scripts on previous system (centos, php 5x). TamperData shows the request going out with:
18:16:20.556[227ms][total 227ms] Status: 200[OK]
POST Load Flags[LOAD_BYPASS_CACHE LOAD_BACKGROUND INHIBIT_CACHING ] Content Size[1303] Mime Type[text/html]
Request Headers:
Host[XXXXXXXXX.com]
User-Agent[Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0]
Accept[application/json, text/javascript, */*; q=0.01]
Accept-Language[en-US,en;q=0.5]
Accept-Encoding[gzip, deflate]
DNT[1]
Content-Type[application/x-www-form-urlencoded; charset=UTF-8]
X-Requested-With[XMLHttpRequest]
Referer[]
Content-Length[89]
Authorization[Basic cHJfZGVtb1VzZXI6NElQY01F]
Connection[keep-alive]
Pragma[no-cache]
Cache-Control[no-cache]
Post Data:
customerID[915690000000000000000000000000c4f]
reportTitle[Sample]
responseFormat[json]
toolName[newRep]
sub1[6000000]
sub2[]
sub3[]
Response Headers:
Date[Tue, 02 Apr 2013 01:16:21 GMT]
Server[Apache/2.2.22 (Ubuntu)]
Vary[Accept-Encoding]
Content-Encoding[gzip]
Content-Length[1303]
Keep-Alive[timeout=5, max=100]
Connection[Keep-Alive]
Content-Type[text/html]
Problem is, the php script called only gets the first three post vars. This is 100% consistent, I have tried expanding the suhosin caps, and also disabling suhosin completely (via "suhosin.simulation = On" in php.ini) with no change in behavior. It is shocking to me that a critical issue like this has been allowed to persist for 10 years!
Hi,
I am facing problem when submitting form in backend php to save form data in database so $_POST variable is showing empty. i am using latest version of php wamp server.pls suggest.due o this Undefined index error showing on the page.
( ! ) Notice: Undefined index: first_name in C:\wamp\www\FinalMyCourse\regdb.php on line 11
Call Stack
# Time Memory Function Location
1 0.0006 397728 {main}( ) ..\regdb.php:0
( ! ) Notice: Undefined index: first_name in C:\wamp\www\FinalMyCourse\regdb.php on line 29
Call Stack
# Time Memory Function Location
1 0.0006 397728 {main}( ) ..\regdb.php:0
ArrayArrayArrayArrayAll fields are required.
array
'middle_name' =>
array
0 => string 'hj' (length=2)
'last_name' =>
array
0 => string 'h' (length=1)
'ages' => string 'jhkjh' (length=5)
'mobileno' =>
array
0 => string '786987' (length=6)
'email' =>
array
0 => string 'hjkjh@qwe.com' (length=13)
'password' => string '' (length=0)
'password_confirmation' => string '' (length=0)
'timepass' => string 'Hindi' (length=5)
'address' => string '' (length=0)
'city' => string '' (length=0)
'skills' => string '' (length=0)
'totexp' => string '' (length=0)
'prefslot' => string 'Weekend' (length=7)
'preftiming' => string 'Morning' (length=7)
'regsubmit' => string 'Register' (length=8)
( ! ) Notice: Undefined index: first_name in C:\wamp\www\FinalMyCourse\regdb.php on line 47
Call Stack
# Time Memory Function Location
1 0.0006 397728 {main}( ) ..\regdb.php:0
( ! ) Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in C:\wamp\www\FinalMyCourse\regdb.php on line 48
Call Stack
# Time Memory Function Location
1 0.0006 397728 {main}( ) ..\regdb.php:0
2 0.0045 406008 mysqli_real_escape_string ( ) ..\regdb.php:48
( ! ) Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in C:\wamp\www\FinalMyCourse\regdb.php on line 49
Call Stack
# Time Memory Function Location
1 0.0006 397728 {main}( ) ..\regdb.php:0
2 0.0047 406136 mysqli_real_escape_string ( ) ..\regdb.php:49
( ! ) Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in C:\wamp\www\FinalMyCourse\regdb.php on line 50
Call Stack
# Time Memory Function Location
1 0.0006 397728 {main}( ) ..\regdb.php:0
2 0.0048 406216 mysqli_real_escape_string ( ) ..\regdb.php:50 | https://bugs.php.net/bug.php?id=22427 | CC-MAIN-2016-50 | refinedweb | 5,585 | 68.26 |
One of the features provided by Forms Manager is a support to add CQ tags to Forms as a meta data. This blog post showcases how we can add CQ tags to the Form and use them to search Forms.
CQ Tags
Tags are a quick and easy method of classifying content (forms in case of Forms Manager). In technical terms, a tag is a piece of metadata assigned to a content node within CQ. You can also think of them as keywords or labels that you attach to a node (form in case of Forms Manager) to help you find it again.
Some of the advantages of using CQ Tags with Forms Manager include
- Tagging provides an easy straightforward way to organize forms without too much thought.
- You can never have too many tags. Though if you have a lot, you can create namespaces to sort and organize your tags. With namespaces you can create categories of tags to make sure that tags that belong together are grouped together.
- Tags are powerful organizers. With the ability to create tags and sub-tags it becomes possible to organize the forms in a logical structure.
- Tags improve the form search experience. You can search for forms based on the tags added to them. Support for hierarchical tagging helps provide more appropriate search results.
- Organization of forms on the existing portal through search API which supports tags.
Scenario
Assume you want to show a list of forms on your Portal, but in case you have a large number of forms you would want to bifurcate them based on categories and sub-categories. For example in case of a Taxation Department of a State some categories may be:
- Income Tax Forms
- Individual Tax Forms
- Business / Enterprise Tax Forms
- Non-Profit Organization Tax Forms
- Sales Tax Forms
- Sales Tax Registration Forms
- Sales Tax Exemption Forms
- Sales Tax Refund Forms
- Annual Filer Forms
- Quarterly Filer Forms
Each category may then have multiple sub-categories and forms. In such a scenario you might like to maintain all the forms in a common repository where they can refer to common form fragments, but require an ability to identify a smaller set of forms that are relevant to the task at hand.
Steps to use Tags with Forms Manager
- Create the tags in the CQ repository:
- Access the URL: http://<server>:<port>/lc and login with CQ admin credentials (admin/admin).
- Click on the ‘Tagging’ icon to create/update the tags.
- Create a new namespace or use an existing namespace. For creating a new namespace click on the New button highlighted below.
- Provide the required details in the dialog for the new namespace.
- Access the new namespace by selecting it from the tree structure on the left.
- For creating a tag click on the New button and provide the required information.
- For creating a sub-category select a tag from the tree structure on the left and add a new tag.
- Create all the tags in the required structure following the above steps.
- Add the tags to the forms in CQ repository:
- Access Forms Manager UI (url: http://<server>/<port>/lc/fm) and login with the credentials of a LiveCycle user with Forms Manager Administrator role (e.g. Super Administrator: administrator/password).
- Access the Form you want to add the tag information to.
- In the tags section – click the ‘+’ button to open the Tags widget, and access the tab for required namespace.
- Browse and select the required Tag to be added to the form.
- Click the ‘+’ button to close the Tags widget.
- Search for forms with Tags: CQ Tags support hierarchal structure, i.e. if you have added a tag A/B/C and search for a tag A/B (it parent), the child will also be listed. In the above example if a user has added a tag ‘Individual Tax Forms’ to a form, it will be listed when searching for forms with tag ‘Income Tax Forms’.
- Open the advanced search by clicking the Advanced search pod in Forms Tab.
- Click the ‘+’ button to open the Tags widget, and access the tab for required namespace.
- Browse and select the required Tag to be searched for.
- Click the ‘+’ button to close the Tags widget.
- Select the check-box before the tag to include the tag in the search condition.
- Click ‘Search’ button to perform the search.
For more information on the exciting new features introduced in Adobe LiveCycle ES4 refer to the LiveCycle ES4 documentation link: What’s new in Adobe LiveCycle ES4 . For more information on Forms Manager Introduction to Forms Manager | https://blogs.adobe.com/livecycle/2013/04/tags-in-forms-manager.html | CC-MAIN-2017-30 | refinedweb | 765 | 62.78 |
This artifact simply a JSON object containing a plethora of data. A short sample from the SKALE project:
{ "contractName": "SkaleDKG", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},...}", "bytecode": "0x...", "deployedBytecode": "0x...", "sourceMap": "1529:30527:18:-;;;;;;;;;", "deployedSourceMap": "1529:30527:18:-;;...", "source": "...", "sourcePath": "/path/to/skale-manager/contracts/SkaleDKG.sol", "ast": {}, "legacyAST": {}, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.20", "updatedAt": "2020-05-05T09:55:25.394Z", "devdoc": {}, "userdoc": { "methods": {} } }
If we want to submit this artifact as a payload to MythX for security analysis, we are lacking an important feature, however: The source list.
Why is the source list needed?
When MythX does analyses, we obviously want to show the developer where a potential vulnerability is in their code. When we analyse the produced bytecode of a smart contract, we internally report locations as bytecode offsets. These are locations with three components:
- offset
- length
- file index
Telling a developer that an issue exists at bytecode offset 122 for the length of 6 bytes is not very useful, still. This is where solc source maps come in. Source maps essentially map bytecode locations to source code lines and columns. Nice!
With Truffle artifacts, there is one central problem: The source list is not contained in the JSON object. Look again in the sample above. No source list. So if a source map contains file index 2, there is no way for a developer to find out which file this mapping references.
So.. do we have to drop Truffle support on the MythX CLI now?
The workaround
After a bit of head-scratching with my fellow 10x developer Joao, we found a workaround that is not too bad. It depends on having the AST (or legacy AST) inside the artifact file.
The directory of artifacts looks something like this in structure:
build/ └── contracts ├── Address.json ├── BokkyPooBahsDateTimeLibrary.json ├── console.json ├── ConstantsHolder.json ├── Context.json ├── ContractManager.json ├── Decryption.json ├── DelegationController.json ├── DelegationPeriodManager.json ├── Distributor.json ...
Each file is an artifact, which in turn has an AST. The basic structure of the above
SkaleDKG sample looks like this:
{ "ast": { "absolutePath": "/path/to/skale-manager/contracts/SkaleDKG.sol", "exportedSymbols": {}, "id": 13843, "nodeType": "SourceUnit", "nodes": [], "src": "785:31272:18" } }
.. with data before and after, and the
exportedSymbols and
nodes keys filled. You get the gist. What is important here is the root
src property of the AST and the
absolutePath. The file index from
src and the absolute path in the AST give us information on the current file’s location in the source list.
All that is left to do now is to iterate over all artifacts in the output directory, extract the file ID (the third element in the
src string, and attach it to the absolute path. Here is a basic Python function to return a list of artifacts along with the source list:
def find_truffle_artifacts( project_dir: Union[str, Path] ) -> Union[Tuple[List[str], List[str]], Tuple[None, None]]: """Look for a Truffle build folder and return all relevant JSON artifacts. This function will skip the Migrations.json file and return all other files under :code:`<project-dir>/build/contracts/`. If no files were found, :code:`None` is returned. :param project_dir: The base directory of the Truffle project :return: Files under :code:`<project-dir>/build/contracts/` or :code:`None` """ output_pattern = Path(project_dir) / "build" / "contracts" / "*.json" artifact_files = list(glob(str(output_pattern.absolute()))) if not artifact_files: print(f"No truffle artifacts found in pattern {output_pattern}") return None, None sources: Set[Tuple[int, str]] = set() artifacts: List[dict] = [] for file in artifact_files: with open(file) as af: artifact = json.load(af) artifacts.append(artifact) try: ast = artifact.get("ast") or artifact.get("legacyAST") idx = ast.get("src", "").split(":")[2] sources.add((int(idx), artifact.get("sourcePath"))) except (KeyError, IndexError) as e: print(f"Could not reconstruct artifact source list: {e}") sys.exit(1) source_list = [x[1] for x in sorted(list(sources), key=lambda x: x[0])] return artifacts, source_list
Basically we iterate over all artifacts (a
*.json glob in the output directory) and store a tuple
(<file_id>, <path>) in a set. Using a set avoids duplicate entries, which can very well occur in this workaround. In the last step, we convert the set into a list (which we can sort), sort it by the file index, and transform the list to only hold the absolute paths in this exact order.
Because AST and source mappings originate from the same solc call, the file indices should now correlate and our source list can be used to resolve bytecode locations to the project’s source code!
And this is the story about how the MythX CLI did not drop Truffle support. If you’re interested in what the actual source code looks like, check out the repo on Github!
One last thing
Before people start ranting: I think Truffle is a great project and the developer’s efforts on this project have reflected directly in the Ethereum smart contract ecosystem flourishing. Tons of meaningful projects rely on Truffle, and I cannot begin to imagine the pressure of feature requests, bug reports and integration efforts their developers and contributors are facing on a daily basis. I sincerely appreciate the work and hope that this post will be of help to anyone working on tooling that needs to make sense of Truffle artifacts.
… such as MythX. Check out MythX. If you develop smart contracts, you should check out MythX. Seriously. MythX. | https://dmuhs.blog/2020/05/12/construct-truffle-artifact-source-lists/ | CC-MAIN-2022-21 | refinedweb | 910 | 56.05 |
Rock, Paper, Scissors With Python
Rock, Paper, Scissors With Python
Get a handle on Conditional, Assignment, and Comparison Operators in Python.
Join the DZone community and get the full member experience.Join For Free
In this article, we will discuss Python Operators and Conditions, their syntax and different ways to use them in order to create a game of Rock, Paper, Scissors.
Python Operators
Operators are symbols or statements that manipulate the value of operands.
Consider the following example: 10 * 3 = 5.
The integers "10 " and "3 " are operands (which are also referred to as variables), while "*" is the operator that performs the action of multiplication. It’s important to understand that the use of these operators are not solely limited to operations like addition or multiplication. Some operators can be used for comparisons or to confirm whether a statement is true or false.
For example, in the previous paragraph, I wrote, “The integers ‘10 ’ and ‘3’ are operands…”. In this example, the word "and" just became the operator, since it compared the two integers. We will be making use of the Logical Operators in one of our games.
The Python language supports the following Operators:
- Arithmetic Operators
- Comparison Operators
- Logical Operators
- Identity Operators
- Membership Operators
- Bitwise Operators
For examples and in-depth details on these operators, Programiz is an excellent resource that I recommend checking out.
Python Conditional Statements
Conditional Statements, also referred to as If…else statements are used to control the flow of an operation. In order to accomplish this, we make use of the boolean values true and false — if a statement is true, then do this, otherwise, do this.
To illustrate this let’s start with our basic game of rock paper scissors.
We’ll begin by defining a function, "basicRPS" that will take two arguments, Player One's hand (p1) and Player Twos hand (p2). Once we’ve got the basics down, we’ll add a little logic to our game so that we can play against the computer.
def basicRPS(p1,p2):
Our first step is to identify and comment the rules of our game.
#ROCK BLUNTS SCISSORS #SCISSORS CUTS PAPER #PAPER COVERS ROCK #IF PLAYERS CHOOSE THE SAME HAND THEN IT'S DRAW
From our description, we know that there are three options that both users can choose from: Rock, Paper or Scissors. Depending on each player's choice, we will receive a winner. Now, if both users play the same hand, then the result is a draw. Since a draw cancels out the operation, let's use this as our first condition.
if p1.title() == p2.title(): return 'Draw!'
Assignment and Comparison Operators
You’re probably thinking, "Wait a minute. Why are there two ‘=’ signs?" Well, I’m glad you asked. In Python "=" is considered an Assignment Operator, while "==" is considered a Comparison Operator.
Assignment Operators are used to assign and reassign the value of a given variable. For example:
a = 5 5 a = 2 a 2
We started off by assigning the value of "5" to the variable "a" and then assigned the value of "2" to the same variable.
Comparison Operators tell us if a statement is true or false. Consider the following:
a = 5 b = 5 c = 3 a == b True a == c False
In this example, we assigned the value "5" to both "a" and "b." Then, we asked, "is ‘a’ equal to ‘b’?" To which the program returned true. Before moving on, let’s look at one more example.
a = 5 b = '5' a == b False
You’re probably thinking, “If 'a' and 'b' are both '5,' why did Python return false?” Well, it’s simple really. When we assign a value, we also assign the type of value. Take a look.
type(a) class'int' type(b) class'str'
When the comparison operator asks if "a" is equal to "b", it’s really asking if "a" is really the same type and value as "b"? By surrounding the "5" with quotation marks, I assigned the type of value to string resulting in false.
With that said, let's get back to our game.
if p1.title() == p2.title(): return 'Draw!'
We asked, "is Player1’s hand Equaled to Player2’s hand?" We add the "title()" method to account for caps. If the result is true, we return "Draw". If the result is false, the program continues to run. Now, we need to decide what happens if both players make unique calls. We’ll accomplish this using the "elif" statement.
# If the player chooses rock elif p1.title() == 'Rock' and p2.title() == 'Paper': return 'Player 2 won!' elif p1.title() == 'Rock' and p2.title() == 'Scissors': return 'Player 1 won!
By adding our logic we decide, "If player1 chooses rock ‘and’ player2 chooses paper, then player2 wins." By using the "elif" statement, we tell Python, "if the last statement returned false then run this." In Python, the "and" operator is called a Logical Operator. In order for the program to return true, both statements must be true. If either one is false, then the program will return false. From this point, we’ll go ahead and, using the same logic, decide what happens in the event the user chooses paper and scissors.
#If the user chooses paper elif p1.title() == 'Paper' and p2.title() == 'Rock': return 'Player 1 won! elif p1.title() == 'Paper' and p2.title() == 'Scissors': return 'Player 2 won!' # If the user chooses scissors elif p1.title() == 'Scissors' and p2.title() == 'Paper': return 'Player 1 won!' elif p1.title() == 'Scissors' and p2.title() == 'Rock': return 'Player 2 won!'
There you have it! A basic game of Rock, Paper, Scissors. At this point, we have a pretty good understanding of the logic involved. Let’s take it a step further and adjust our code so that we can play against the computer.
Python Rock, Paper, Scissors
In order for us to play against the computer and have a fair game, we’ll need to import choice from the random module.
The choice model allows us to import a random element from a given list. In our case the list will be one of our three options. Before we implement our logic lets define our function and assign our variables.
from random import choice
def playRPS(): beats = {'rock' : 'scissors', 'scissors' : 'paper','paper': 'rock'} computerHand = beats[choice(['rock','paper','scissors'])] playerHand = input('Choose Rock, Paper, Scissors: '
First, we created a dictionary called beats with a key-value pair of outcomes (Key beats Value). Using the same dictionary, we call the choice method on a list of hands that are equal to the keys in the "beats" dictionary. Our last variable, "playerHand" assigns the user input as its value.
As a result of this basic setup, we can implement our logic.
if beats[playerHand] == computerHand: print(f'Computer played {computerHand}') return 'Player Wins!'
This may or may not take you a few passes to make sense of. Let's quickly work our way through this one just in case.
Let's say that the player inputs "rock."
The value for the key "rock" is scissors
If the computer randomly chooses "scissors," then "Player" wins because rock beats scissors. Easy enough right? Now, we just need to add the "elif" statement in the event that the computer wins.
elif beats[computerHand] == playerHand: print(f'Computer played {computerHand}') return 'Sorry, Computer Won...'
Just like before, if the value for the key (computer's hand) is the same as the player's hand, then the computer wins. Now, our last step is to account for a draw.
return 'Draw!'
This step is basically to say that if none of the other two statements are true then return "draw." And there you have it! You just programmed an interactive game of Rock, Paper, Scissors.
Conclusion
To recap, we learned that there are many types of Python Operators and Conditional Statements. We also learned that conditional statements can be used to control the flow of an operation. As a tool, conditional statements are priceless and should be in every programmer's toolkit. We made a basic game of Rock, Paper, Scissors and even stepped it up a notch so that we could play against the computer.
If you enjoyed this article and want to see other projects just like it in the future, please leave a comment below. Until next time!
Published at DZone with permission of Leaundrae Mckinney . See the original article here.
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}{{ parent.urlSource.name }} | https://dzone.com/articles/rock-paper-scissors-with-python | CC-MAIN-2019-51 | refinedweb | 1,430 | 66.54 |
dpns_getidmap - get virtual uid/gid(s) associated with a given dn/role(s)
#include <sys/types.h> #include "dpns_api.h" int dpns_getidmap (const char *username, int nbgroups, const char **groupnames, uid_t *userid, gid_t *gids)
dpns_getidmap gets the virtual uid/gid(s) associated with a given dn/role(s). If the dn or any of the roles does not exist yet in the Database an entry is added to the mapping table. username specifies the user name (dn). It must be at most 255 characters long. nbgroups is the number of group names. groupnames is the address of an array of group names (vo/role). Each group name must be at most 255 characters long. This pointer can be NULL. In this case the vo is obtained from a static mapping file. userid specifies the address of a buffer to receive the Virtual User Id. gids specifies the address of a buffer to receive the Virtual Group Ids. It must be big enough to receive nbgroups group ids, but at least one group id in case nbgroups is zero.
This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, serrno is set appropriately.
ENOMEM Memory could not be allocated in the server to receive the group names or to send back the gids. EFAULT username, userid or gids is a NULL pointer. EINVAL nbgroups is negative or the length of username or of one of the group names exceeds 255. SENOSHOST Host unknown. SENOSSERV Service unknown. SECOMERR Communication error. ENSNACT Name server is not running or is being shutdown. | http://huge-man-linux.net/man3/dpns_getidmap.html | CC-MAIN-2019-04 | refinedweb | 267 | 77.13 |
:)> NILFS2 is a log-structured file system (LFS) supporting ``continuous> snapshotting''. In addition to versioning capability of the entire> file system, users can even restore files and namespaces mistakenly> overwritten or destroyed just a few seconds ago.> > NILFS2 creates a number of checkpoints every few seconds or per> synchronous write basis (unless there is no change). Users can select> significant versions among continuously created checkpoints, and can> change them into snapshots which will be preserved until they are> changed back to checkpoints.What approach does it take to garbage collection?> There is no limit on the number of snapshots until the volume gets> full. Each snapshot is mountable as a read-only file system> concurrently with its writable mount, and this feature is convenient> for online backup. It will be also favorable for time-machine like> user environment or appliances.> > Please see [2] for details on the project.> > Other features are:> > - Quick crash recovery on-mount (like conventional LFS)> - B-tree based file, inode, and other meta data management including> snapshots.> - 64-bit data structures; support many files, large files and disks.> - Online disk space reclamation by userland daemon, which can maintain> multiple snapshots.> - Less use of barrier with keeping reliability. The barrier is enabled> by default.> - Easy and quickly performable snapshot administration> > Some impressive benchmark results on SSD are shown in [3],heh. It wipes the floor with everything, including btrfs.But a log-based fs will do that, initially. What will the performacelook like after a month or two's usage?> however the> current NILFS2 performance is sensitive to machine environment due to> its immature implementation.> > It has many TODO items:> > - performance improvement (better block I/O submission)> - better integration of b-tree node cache with filemap and buffer code.> - cleanups, further simplification.> - atime support> - extendend attributes support> - POSIX ACL support> - Quota support> > The patch against 2.6.27-rc3 (hopefully applicable to the next -mm> tree) is available at:> > a few fixes for recent linux-next changes.I queued it up without looking at it, just for a bit of review andcompile-coverage testing.> It is not yet divided into pieces (sorry). Unlike original code> available at [4], many code lines to support past kernel versions and> peculiar debug code are removed in this patch.Yes, please do that splitup and let's get down to reviewing it.> The userland tools are included in nilfs-utils package, which is> available from [4]. Details on the tools are described in the man> pages included in the package.> > Here is an example:> > -).> > For example,> > # chcp ss 2> > changes the checkpoint No. 2 into snapshot.> > - To mount a snapshot,> > # mount -t nilfs2 -r -o cp=<cno> /dev/block_device /snap_dir> > where <cno> is the checkpoint number of the snapshot.> > - More illustrative example is found in [5].> > Thank you,> Ryusuke Konishi, NILFS Team, NTT.> > 1. NILFS version2 now available>> > 2. NILFS homepage>> > 3. Dongjun Shin, About SSD> document, that.> 4. Source archive>> > 5. Using NILFS> | http://lkml.org/lkml/2008/8/20/50 | CC-MAIN-2013-48 | refinedweb | 493 | 59.3 |
I have decided to pick up coding now after a 3 months break. What I want to do is finish a project I started on a while back and it is and text editor for use in terminals (nano, vi etc.).
The main goal I have and reason to not use named editors is that I love the typing features of and want to bring those into the terminal.
Some examples of typing feature is like:
# If you make one "(", you will automatically get both "(" and ")", and the cursor placed in the middle of them.
# When you make a ",". There will be an space inserted afterwards and the cursor is placed after it.
# If you press ctrl+d you will duplicate that whole line downwards.
These are not perhaps the best practices for overall coding but I really like it this way and don't see why I should learn any other.
Then ofcourse I would like to add some highlighting and line numbers and other basic things. In the end it will probably look like Nano with line numbers and aswell the use of wanted features..
Anyway, what I need your help for is to find a good library that can help me with this. Ofcourse the first which popped up in my head was curses and I have made a pretty good prototype with it, though curses it self seems to contain a bunch of bugs? And aswell a very incomplete set of basics? Like turn on and off insert mode! I will show you with he code I have written soon.
I have tried some urwid, but their example of a text editor is very hard to understand and when I seaked help in their irc channel they told me it was a very lazy written code, really nothing more hehe.
So I just really need advice on how I can get going. Because I really need this for use on my servers where I more and more impeltent python scripts.
Here is the prototype I have written. If you try it you will see weird things like backspace clears the whole row and some kind of insert mode is always on, which I don't use at all.
The features I have made works pretty good though, so make sure to try them out, type "," and "(" or try out ctrl+d
I am using Python 2.7.5 on Linux.
Here is the code from pastebin
- Code: Select all
# Sorry for poor documentation and at the end I probably smashed in some
# things that don't need to be here at all.
import curses, curses.textpad, curses.ascii
class sheet:
def __init__(self, win):
self.win = win
self.gridY = win.getmaxyx()[0]
self.gridX = win.getmaxyx()[1]
win.keypad(1)
self.win.idcok(False)
self.win.idlok(0)
def end(self, gridPosY):
last = self.gridX
while True:
if curses.ascii.ascii(self.win.inch(gridPosY, last)) != curses.ascii.SP:
print curses.ascii.ascii(self.win.inch(gridPosY, last))
last = min(self.gridX, last+1)
break
elif last == 0:
break
last = last - 1
return last
def compose(self):
endIndex = {}
for i in range(0, self.gridY):
endIndex[str(i)] = 0
while 1:
gridPosY, gridPosX = self.win.getyx()[0], self.win.getyx()[1]
ch = self.win.getch()
if ch == ord(curses.ascii.ctrl('o')):
print self.win.inch(gridPosY, gridPosX)
elif ch == ord(curses.ascii.ctrl('c')):
break
elif ch == ord(curses.ascii.ctrl('d')):
bucket = []
for i in range(0, self.gridX):
seed = self.win.inch(gridPosY, i)
bucket.append(seed)
self.win.insertln()
self.win.move(gridPosY + 1, 0)
for i in range(0, len(bucket)):
self.win.addch(bucket[i])
if gridPosX + 1 != self.gridX :
self.win.move(gridPosY, i)
elif ch == curses.KEY_END:
last = self.end(gridPosY)
print last
self.win.move(gridPosY, last)
elif ch == curses.KEY_ENTER:
endIndex[str(gridPosY)] = gridPosX
elif ch == curses.KEY_LEFT:
endIndex[str(gridPosY)] = gridPosX
if gridPosX > 0:
self.win.move(gridPosY, gridPosX - 1)
elif ch == curses.KEY_RIGHT:
endIndex[str(gridPosY)] = gridPosX
if gridPosX + 1 != self.gridX :
self.win.move(gridPosY, gridPosX + 1)
elif ch == curses.KEY_UP:
endIndex[str(gridPosY)] = gridPosX
if gridPosY > 0:
self.win.move(gridPosY - 1, endIndex[str(gridPosY - 1)])
elif ch == curses.KEY_DOWN:
endIndex[str(gridPosY)] = gridPosX
self.win.move(gridPosY + 1, endIndex[str(gridPosY + 1)])
elif ch == ord('\t'): # Tabs
self.win.addnstr(' ', 4)
self.win.move(gridPosY, gridPosX + 4)(','): # Make space after ","
self.win.addch(ch), self.win.addstr(' ')
self.win.move(gridPosY, gridPosX + 2)
#self.win.move(gridPosY, gridPosX - 1)
elif ch in (127, curses.KEY_BACKSPACE): # Backspace
if gridPosX > 0:
self.win.move(gridPosY, gridPosX - 1)
#self.win.delch()
self.win.clrtoeol()
else:
self.win.addch(ch)
def gather(self):
pass
# collect and save some shit, attrs!!!!
def drawInterface(self):
myScreen_gridY, myScreen_gridX = myscreen.getmaxyx()[0], myscreen.getmaxyx()[1]
for i in range(0, myScreen_gridY - 2 - 1):
if i < 10:
myscreen.addstr(2 + i, 2, str(i))
else:
myscreen.addstr(2 + i, 1, str(i))
myscreen.addstr(0, 5, "EngeboEditor - v0.0.1")
curses.textpad.rectangle(myscreen, 1, 4, myScreen_gridY - 1, myScreen_gridX - 2)
myscreen.refresh()
myscreen = curses.initscr()
curses.noecho()
curses.cbreak()
win = curses.newwin(myscreen.getmaxyx()[0] - 3, myscreen.getmaxyx()[1] - 7, 2, 5)
win.idcok(False)
#myscreen.idlok(False)
sheet(win).drawInterface()
sheet(win).compose()
curses.endwin() | http://www.python-forum.org/viewtopic.php?p=4374 | CC-MAIN-2015-35 | refinedweb | 886 | 70.39 |
table of contents
NAME¶
cgroup_namespaces - overview of Linux cgroup namespaces
DESCRIPTION¶
For an overview of namespaces, see namespaces(7).
Cgroup namespaces virtualize the view of a process's cgroups (see cgroups(7)) as seen via /proc/[pid]/cgroup and /proc/[pid]/mountinfo.
Each cgroup namespace has its own set of cgroup root directories. These root directories are the base points for the relative locations displayed in the corresponding records in the /proc/[pid]/cgroup file. When a process creates a new cgroup namespace using clone(2) or unshare(2) with the CLONE_NEWCGROUP flag, its current cgroups directories become the cgroup root directories of the new namespace. (This applies both for the cgroups version 1 hierarchies and the cgroups version 2 unified hierarchy.)
When reading the cgroup memberships of a "target" process from /proc/[pid]/cgroup, the pathname shown in the third field of each record will be relative to the reading process's root directory for the corresponding cgroup hierarchy. If the cgroup directory of the target process lies outside the root directory of the reading process's cgroup namespace, then the pathname will show ../ entries for each ancestor level in the cgroup hierarchy.
The following shell session demonstrates the effect of creating a new cgroup namespace.
First, (as superuser) in a shell in the initial cgroup namespace, we create a child cgroup in the freezer hierarchy, and place a process in that cgroup that we will use as part of the demonstration below:
# mkdir -p /sys/fs/cgroup/freezer/sub2 # sleep 10000 & # Create a process that lives for a while [1] 20124 # echo 20124 > /sys/fs/cgroup/freezer/sub2/cgroup.procs
We then create another child cgroup in the freezer hierarchy and put the shell into that cgroup:
# mkdir -p /sys/fs/cgroup/freezer/sub # echo $$ # Show PID of this shell 30655 # echo 30655 > /sys/fs/cgroup/freezer/sub/cgroup.procs # cat /proc/self/cgroup | grep freezer 7:freezer:/sub
Next, we use unshare(1) to create a process running a new shell in new cgroup and mount namespaces:
# PS1="sh2# " unshare -Cm bash
From the new shell started by unshare(1), we then inspect the /proc/[pid]/cgroup files of, respectively, the new shell, a process that is in the initial cgroup namespace (init, with PID 1), and the process in the sibling cgroup (sub2):
sh2# cat /proc/self/cgroup | grep freezer 7:freezer:/ sh2# cat /proc/1/cgroup | grep freezer 7:freezer:/.. sh2# cat /proc/20124/cgroup | grep freezer 7:freezer:/../sub2
From the output of the first command, we see that the freezer cgroup membership of the new shell (which is in the same cgroup as the initial shell) is shown defined relative to the freezer cgroup root directory that was established when the new cgroup namespace was created. (In absolute terms, the new shell is in the /sub freezer cgroup, and the root directory of the freezer cgroup hierarchy in the new cgroup namespace is also /sub. Thus, the new shell. | https://manpages.debian.org/testing/manpages/cgroup_namespaces.7.en.html | CC-MAIN-2021-49 | refinedweb | 496 | 53.55 |
13 January 2009 23:59 [Source: ICIS news]
?xml:namespace>
Methylene chloride prices fell as result of thin demand and the low methanol settlement, players said. The range was pegged at €390-440/tonne ($522-589/tonne) free delivered (FD) northwest
One source said €380/tonne FD for methylene chloride was possible in southern
January chloroform slipped by €15/tonne this week, and the price was pegged at €625-685/tonne FD NWE and $480-520/tonne FOB NWE.
This slight decline was attributed to waning demand and the low first quarter methanol settlement. According to a source, the chloroform market was not as deeply affected by the current macroeconomic climate as it was more of a niche and captive market.
Lower consumption of chloroform was a seasonal characteristic of the time of year, a producer said, as refrigerants were not top of the agenda during winter months.
Trichloroethylene (TCE) demand was reported to be better than it was in December, but it was still weaker than in previous years.
TCE prices slipped to €880-970/tonne FD NWE and $810-865/tonne FOB NWE this week. The low ethylene settlement was the main reason for the drop, according to sources.
A trader said that TCE was actually around €750/tonne FD NWE and $600/tonne FOB NWE after the plunge in upstream ethylene prices.
A producer disagreed however, saying that producers would not sell at such a price. No benefit would be gained from such a transaction, so there would be no point in giving so much away, it added.
The perchloroethylene (PCE) market had been hit harder than trichloroethylene (TCE) by the financial crisis and feedstock movements.
Prices fell to €500-550/tonne FD NWE and $580-610/tonne FOB NWE this week. Players attributed the drop to the low ethylene settlement and the poor macroeconomic situation. Q1 would be slow, a participant added.
For all chlors, chlorine was becoming little hard to come by as a result of the PVC situation and players were looking to other derivatives to get chlorine, a participant said.
INEOS ChlorVinyls announced it would close its TCE and PCE assets at
($1 = €0.75)
For more on methylene chloride, chloroform, TCE, and P | http://www.icis.com/Articles/2009/01/13/9184396/europe-chlor-prices-slide-on-low-demand.html | CC-MAIN-2015-18 | refinedweb | 371 | 61.36 |
RELEASING TWISTED CORE OR A SUBPROJECT
- Fix all release-critical bugs in
- Verify that buildbot ( ) is ALL GREEN (for all platforms that it was green for on the last release).
- svn up.
- Create a ticket for releasing your project at.
- Branch the repo to /branches/releases/twisted-[projname]-<a.b>.x-[ticketnumber]. That last 'x' is literal.
- Switch to that branch.
- 0.2.0 release' $TREPO/branches/<a.b>.x $TREPO/tags/releases/
- Create a ticket
- Create a branch of WebSite
- Switch to the branch
- Update website documentation
- Delete old doc directory
- Commit
- Copy doc out of release tarball into WebSite WC in place of old doc directory
- svn add
- commit
- Generate new book.pdf with admin/process-docs and put it in the branch in the right place. Do not be afraid of the output of process-docs.
-
Here is some more
from twisted.python import filepath as fp source = fp.FilePath('/path/to/TwistedCore-a.b.c/docs') dest = fp.FilePath('/path/to/svn/working/copy/WebSite/vhosts/twistedmatrix.com/projects/core/documentation') source.copyTo(dest)
Weeeeee. This does a thing that is useful if it works which it might not but it could (ish). | http://twistedmatrix.com/trac/wiki/ReleaseProcedure?version=7 | CC-MAIN-2016-26 | refinedweb | 197 | 51.04 |
Selection of a subset for ticks labels
I have loaded a long serie of interest rate at. Then I have loaded Pandas to manipulate thoses interest rates.
import pandas as pd int_rates = pd.read_csv(r"C:\data\interetsmensuelsocde.csv") int_rates
A some column are without interest I have applied
ir3=int_rates.loc[23522 : 29300,'TIME':'Value']
Until now I have no problems. But now I want to plot my serie
import matplotlib.pyplot as plt ir3.plot(x="TIME", y="Value")
the problem is that x gives too much information. How can I use only a subset of x for labelizing the ticks ? | https://ask.sagemath.org/question/51756/selection-of-a-subset-for-ticks-labels/?sort=oldest | CC-MAIN-2020-45 | refinedweb | 103 | 61.63 |
Timeline …
03/12/10:
- 23:37 Changeset [64663] by
- preserve requested property in upgrade
- 23:34 Changeset [64662] by
- fix option handling in registry::run_target
- 22:55 Ticket #21293 (finch doesn't compile in 1.8) closed by
- fixed
- 22:49 Changeset [64661] by
- factor out code for running targets on portfiles in the registry into new …
- 21:54 Changeset [64660] by
- Total number of ports parsed: 6662 Ports successfully parsed: 6662 …
- 21:14 Ticket #23119 (kdelibs3 build fails when kde4 ports are installed) closed by
- fixed: Replying to ryandesign@…: > If kdelibs3 is incompatible with …
- 21:12 Changeset [64659] by
- kdelibs3, kdelibs4: declare conflicts (#23119)
- 20:59 Ticket #22907 (EMBOSS needs to declare dependencies on the ports it uses) closed by
- fixed: Maintainer timeout. I added some missing dependencies and updated the port …
- 20:58 Changeset [64658] by
- Update to version 6.2.0. Added some missing dependencies. (#22907)
- 20:54 Changeset [64657] by
- Total number of ports parsed: 6662 Ports successfully parsed: 6662 …
- 20:38 Changeset [64656] by
- error handling when running portfiles from the registry
- 19:55 Ticket #23596 (Update NSD port to version 3.2.4) closed by
- fixed: r64655.
- 19:55 Changeset [64655] by
- Update to version 3.2.4. (#23596)
- 19:49 Ticket #23622 (finch update: updates to 2.6.5) closed by
- fixed: r64654.
- 19:47 Changeset [64654] by
- Update to version 2.6.5. (#23622)
- 19:39 Changeset [64653] by
- explicitly run deactivate target in action_uninstall when needed so as to …
- 19:33 Ticket #24034 (Import problem with gtk and pygtk after installing sucessfully py26-gtk ...) closed by
- invalid: I suggest you post on the macports-users list.
- 18:54 Changeset [64652] by
- Total number of ports parsed: 6662 Ports successfully parsed: 6662 …
- 18:28 Changeset [64651] by
- sqlite3: work around build failure on tiger (doesn't have gethostuuid)
- 17:45 Ticket #24036 (New port: p5-set-scalar) created by
- Hi, I'm submitting a new Portfile for the perl module Set::Scalar. jpo
- 17:19 Ticket #18629 (Support RTree in sqlite3 port) closed by
- duplicate: #21410
- 17:16 Ticket #21875 (sqlite3-3.6.18 Enable full-text search module (fts3)) closed by
- duplicate: Superseded by #23350.
- 14:42 Changeset [64650] by
- tell configure if we want 64 bit
- 12:54 Changeset [64649] by
- Total number of ports parsed: 6662 Ports successfully parsed: 6662 …
- 12:38 Changeset [64648] by
- Added portfile for pystache
- 11:38 Ticket #24035 (lurker portfile update) created by
- I am in need of the lurker Portfile to be updated. […] …
- 11:33 Ticket #24034 (Import problem with gtk and pygtk after installing sucessfully py26-gtk ...) created by
- I have installed sucessfully the python26 and py25-gtk after the patch …
- 11:06 Ticket #24033 (atlas-3.8.3 fails to compile on Core i7) created by
- I'm quiet new here, but I have long Linux experience (Gentoo). Atlas fails …
- 10:54 Changeset [64647] by
- Total number of ports parsed: 6661 Ports successfully parsed: 6661 …
- 10:31 Changeset [64646] by
- squid: update to 2.7.STABLE8
- 10:21 Changeset [64645] by
- delete any existing registry1.0 directory during install
- 10:12 Changeset [64644] by
- delete mp_version file in DESTDIR
- 10:04 Changeset [64643] by
- revert r64642, caused breakage
- 10:00 Ticket #24032 (gnuradio 3.2.2+python25 install failure) created by
- Intel MacBook Pro running OS X 10.5.8 XCode version 3.1.2 …
- 09:54 Changeset [64642] by
- fix ui_channels aliasing issue
- 09:52 Changeset [64641] by
- fix multiple portuninstall namespace confusion
- 08:54 Ticket #20626 (patch to allow for proper functioning of pre-/post- ...) closed by
- duplicate: #1068, #4228, and/or #18273
- 08:48 Ticket #19176 (patch to fixup existing uninstall implementation) closed by
- fixed: Applied in r64640.
- 08:47 Changeset [64640] by
- fix flat registry's pkg_uninstall functionality (#19176)
- 08:10 Ticket #18273 (post-activate code is not run if you call port activate) closed by
- fixed: r64638 & r64639
- 08:00 Ticket #4228 (Add A Deactivate Hook) closed by
- fixed: r64638
- 07:59 Ticket #1068 (Pre/Post-install and Post-removal scripts) closed by
- fixed: r64638
- 07:46 Changeset [64639] by
- fix up running of activate target and autoclean
- 06:28 Changeset [64638] by
- make deactivate and uninstall into real targets, have …
03/11/10:
- 21:50 Ticket #22310 (distcc fails to build on Snow Leopard) closed by
- duplicate: #20902
- 21:47 Ticket #24024 (Pallet fails to start (crash)) closed by
- duplicate: #21259
- 21:10 Ticket #24031 (stklos-0.98 invalid URL) created by
- Dependencies download and build fine. Package stklos fails with the …
- 21:08 Ticket #24030 (mlt: update to upstream version 0.5.2) created by
- This also addresses ticket #23878 by explicitly depending on ffmpeg-devel. …
- 17:00 Changeset [64637] by
- devel/icu: Disable ccache, #23931
- 16:26 Ticket #24029 (gnome-doc-utils: xml2po python module in wrong path) created by
- gnome-doc-utils @0.18.1 includes a python module named xml2po which is …
- 16:00 SummerOfCodeOrgApplication edited by
- Updating number of ports (diff)
- 15:54 Changeset [64636] by
- Total number of ports parsed: 6661 Ports successfully parsed: 6661 …
- 15:45 Ticket #24028 (Bigloo3.2a-2 fails to compile) created by
- Here's my build log: […]
- 15:05 Changeset [64635] by
- xorg-util-macros: Bump to 1.6.1
- 14:36 Ticket #23894 (sudo port install zlib fails on Snow Leopard) closed by
- invalid: Replying to raimue@…: > The message "Portfile changed since …
- 14:19 SummerOfCodeOrgApplication edited by
- (diff)
- 13:11 Ticket #24019 (Problem installing gtk2 python26 py26-gtk on 10.6.2 Snow Leopard) closed by
- duplicate: Duplicate of #20799.
- 12:54 Changeset [64634] by
- Total number of ports parsed: 6661 Ports successfully parsed: 6661 …
- 12:28 Changeset [64633] by
- version 3.6.23
- 10:44 SummerOfCodeOrgApplication edited by
- (diff)
- 10:12 SummerOfCodeOrgApplication edited by
- (diff)
- 09:12 SummerOfCode edited by
- Add mentors (diff)
- 09:00 SummerOfCodeOrgApplication edited by
- (diff)
- 08:59 Ticket #24027 (Python bindings for OpenCV) created by
- OpenCV 2.0 includes Python bindings, but they are turned off by the …
- 08:49 Ticket #24026 (py26-igraph too new for c core (igraph 0.5.2)) created by
- The current python bindings [py26-igraph @0.5.3] for igraph are too new …
- 08:23 SummerOfCodeOrgApplication edited by
- More answers… (diff)
- 07:57 SummerOfCodeOrgApplication edited by
- (diff)
- 07:54 Changeset [64632] by
- Total number of ports parsed: 6661 Ports successfully parsed: 6661 …
- 07:33 Changeset [64631] by
- handle empty variant strings correctly in receipt_sqlite
- 07:17 Changeset [64630] by
- list_dependents usage
- 07:10 Changeset [64629] by
- Version bump, svk to 2.2.2
- 07:04 Changeset [64628] by
- upgrade dependents before uninstalling old versions
- 07:02 Ticket #24025 (p5-module-build conflicts with perl5.10) created by
- both ports attempt to install ${prefix}/bin/config_data
- 07:00 Changeset [64627] by
- enable checking dependents on inactive ports, check when uninstalling and …
- 05:42 Changeset [64626] by
- fix deactivation of replaced ports when their files conflict during …
- 05:41 Ticket #24024 (Pallet fails to start (crash)) created by
- I just installed Pallet (via port) on first (and subsequent) load It …
- 04:49 Changeset [64625] by
- 'registry::entry imaged' actually means imaged or installed
- 02:54 Changeset [64624] by
- Total number of ports parsed: 6661 Ports successfully parsed: 6661 …
- 02:48 Changeset [64623] by
- install camlzip shared library in stub-libs correctly so that runtime …
- 02:29 Changeset [64622] by
- build fixes for camlzip: actually install META file, call package camlzip …
- 02:08 SummerOfCode edited by
- Change logo URL, add license information (diff)
- 01:31 SummerOfCode edited by
- (diff)
- 01:14 Ticket #24023 (distcc fails to build +universal on SL) created by
- distcc does not build: universal is: x86_64 and i386 on Snow Leopard …
Note: See TracTimeline for information about the timeline view. | http://trac.macports.org/timeline?from=2010-03-15T00%3A39%3A50-0700&precision=second | CC-MAIN-2016-18 | refinedweb | 1,288 | 53.04 |
Red Hat Bugzilla – Bug 23532
include search path
Last modified: 2005-10-31 17:00:50 EST
When running cpp -v I do get the following output:
(...)
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/include
/usr/include
End of search list.
^C
Hm, I do understand why /usr/local/include is here,
but why /usr/i386-redhat-linux/include? Bug?
Oops, must have pressed Commit twice. Closing the second one.
*** This bug has been marked as a duplicate of 23531 *** | https://bugzilla.redhat.com/show_bug.cgi?id=23532 | CC-MAIN-2016-50 | refinedweb | 104 | 54.18 |
On Friday 18 July 2008, David A. Wheeler wrote: > Heads-up, if you're trying to build for Fedora 8 and your spec > file detects WHICH version of Fedora you're compiling for. > > Fedora's Koji installation currently has a serious configuration bug for > dist-f8, at least for scratch builds. When it compiles for dist-f8, > it incorrectly thinks it's compiling for dist-f9, > instead of correctly compiling for dist-f8. > That is, when compiling for Fedora 8, %fedora == 9!!! > > Proof: If your .spec file has: > %if %fedora == 9 > ExcludeArch: ppc64 > %endif > > then "rpmbuild -bs X.spec" followed by: > koji build --scratch dist-f8 ../SRPMS/...src.rpm > will NOT build for ppc64 (wrong!). > But change "== 9" to "== 8", and it WILL build for ppc64 > (wrong!). Ooooops. > > Maybe it IS building for 9 instead of 8, but the result > is the same: No joy when building for Fedora 8. > > I have already submitted a bug report: > > > But since this is just before a weekend, I don't know how long it'll > be before it's fixed. I thought I'd save > some grief for the people working over the weekend. The bug if it is a bug is not in the buildsystem. but will be in fedora- release where the macros are defined. your usage as pointed out in the ticket is incorrect the buildsystem itself has no knowledge of things like rpm macros. all it knows is what is fed into the chroot and what it gets out. nothing more. if you have the appropriate hardware you should be able to reproduce the issue in mock since thats all koji uses. if you dont have ppc64 you could exclude the arch you have and do a mock build. Please read -- Dennis Gilmore
Attachment:
signature.asc
Description: This is a digitally signed message part. | https://www.redhat.com/archives/fedora-devel-list/2008-July/msg01165.html | CC-MAIN-2014-15 | refinedweb | 306 | 74.49 |
Internet Effects on Presidential Campaigns 179
nickdog writes "The upcoming presidential election will probably be the first to be significantly influenced by the Internet. According to a study by Media Quotient, Bill Bradley and John McCain are in the best position to win over voters who rely on Internet news sources."
it is a paradox. (Score:1)
Re:hmm... (Score:1)
But yes, you could create a simple system that's good enough like this and massively reduce paperwork. In England, they have a (huge, in my opinion) VAT (value-added tax)... but they still tax the hell out of their citizens anyhow, so maybe that's a bad example. (Disclaimer: not from England. If you are, feel free to enlighten me as to the system there)
What I like about it, though, is people who would normally pay huge taxes on their house and land that they can't afford on their current income wouldn't have to be punished so harshly. Just because they already have possessions doesn't mean they still have money. Tax people when the money changes hands, and that way you're sure to get some of it.
---
pb Reply or e-mail; don't vaguely moderate [152.7.41.11].
Re:Slashdot poll idea (Score:1)
However, if you did, you'd be amazed at what a strong showing the independent party for NATALIE PORTMAN NAKED AND PETRIFIED FOR PRUZ1DENT!!!1!1 has...
---
pb Reply or e-mail; don't vaguely moderate [152.7.41.11].
Re:hmm... (somewhat OT) (Score:1)
That, in fact, would be the only *good* thing about a flat tax: getting rid of the loopholes in the current system. But I doubt they'll get rid of property tax, capital gains tax, gift tax, intangibles tax, etc., etc. anytime soon...
Oh, and for any rich, offended, extreme-right-wing republicans out there: my opinion is natural given my economic status. If you want to change my mind, try donating me some money instead of arguing with me. I'll like you better, and you can find out if I can be bought. *And* it's better than property tax, because you know the student that you are helping! Think of it as a scholarship for people who will take your money.
---
pb Reply or e-mail; don't vaguely moderate [152.7.41.11].
Re:DoSed (Score:1)
But yes, I agree with the general principle, it's better to moderate up than to moderate down. But what's the point of moderating a +3 up to a +4 when you could be helping get rid of a slew of huge, random, content-free posts? Sometimes it's better to help slay the horde of orcs so the other players can move freely than promote the level 24 character to level 25...
(where's that Doom interface to Moderation when I need it?)
---
pb Reply or e-mail; don't vaguely moderate [152.7.41.11].
Re:DoSed (Score:1)
I'd like to send out a big FUCK YOU to Mr. Smargle here, and I encourage the moderators to send those posts to oblivion--at least -2, if possible.
I like to read at -1 sometimes, to see what people are saying. But I'd appreciate it if I could do that without my netscape trying to swap.
And for people with slow connections at home... well, at least it's compressible.
---
pb Reply or e-mail; don't vaguely moderate [152.7.41.11].
Re:hmm... (somewhat OT) (Score:1)
I wish I could change my economic status by working harder. Sadly in my case, the opposite is true. If I work harder, I could end up paying *more* to my University. Over the summer, however, is another matter.
But there are many people out there who work much longer hours than I would for much less money. They can work "harder" all they want, but they don't necessarily get the cushy tech-support jobs over the crappy bus-driving / hotel-security / food-service jobs. Work smarter, not harder. Anyone who *really* believes that the wealthy physically work harder is stupider than they think you are. Maybe. That's another good reason why the wealthy should pay more in taxes.
---
pb Reply or e-mail; don't vaguely moderate [152.7.41.11].
Re:Smart Cookies (Score:1)
Agreed. I'm a Democrat, but I'd rather see either Bradley or McCain than Gore (or, obviously, Bush).
But then, what do I know -- last election I voted in, I voted for an ex-professional wrestler rather than the idiot my party nominated (I *never* liked Skip -- when he ran for Senate, I voted for the Republican running against him (Dave Durenberger, IIRC)).
--
Re:hmm... (Score:1)
You'll forgive me if the informally expressed, vague opinion on the climate of the middle ages (which is not at issue) from half a decade ago, or a reprint from the Wall St. Journal's Letters to the Editor section don't exactly hold much weight for me.
We're not still coming out of the last ice age. The last glacial retreat was 10000 years ago, and although the climate is supposed to continue to warm for some time after that, it should have stopped by now. In fact, we're over the hump, the climate should be getting cooler. (This is not based on computer models, it's based on the historical glacial advance/retreat scedule from the last few hundred thousand years.)
As far as what the Earth "normally" is, that entirely depends on what you call normal. It's true that the Earth was significantly warmer during the Cretaceous period. Tropical climates were found north of the Arctic Circle! The carbion dioxide count in the atmosphere was over ten times higher than it is now, so this is not surprising (except to idiots who think CO2 doesn't affect global temperatures). But it should be noted that there was also far less land area available back then, due to higher sea levels (since there were NO polar ice caps at the time). If your idea of "normal" is to place the majority of the land humanity has lived on during its existence, then might I suggest we do everything in our power to prevent the Earth from returning to "normal". You see, I don't care whether it's natural for the Earth to be warmer or not! That's not the issue here! The issue is we've evolved to live on a planet more like it is today.
From a strictly Gaian perspective, global warming is irrelevant. The Earth has been much warmer in the past, and it gotby just fine (perhaps better if you consider the total amount of living biomass on the planet as a guage of how well Gaia is doing). But if you care at all about humanity, it IS an issue. Nature will get by just fine, it's humanity that will suffer if we can't keep the climate under control.
--
Re:hmm... (Score:1)
Err, are you normally this stupid or are you just venting? Yes, you had to repair your car. How much more or less would you have had to repair it if they didn't do what they do to upkeep the roads? If you think your car would have been less damaged driving off-road, then yes, it's true, you received "less than nothing" for your taxes. Somehow, I suspect this isn't the case, though. Did you spend more than you would spend of the roads were kept up better? Maybe, maybe not. Cars suffer wear and tear driving on perfectly good roads. It's unreasonable to simply assume if roads were kept up in perfect condition, you would't have spent any money on repair. Also, if you stop and think about what you're saying, you're making an argument for increasing gas tax. Right now, according to you, we don't do enough upkeep on the roads and it's costing you money because of it.
I vote we just toss all the bums out of office and start over. There's gotta be a more cost effective way of doing it!
Unless you can be more specific about what the more effective way would be, there would be no point in starting over. We'd just rebuilding using the same poor design.
By the way, why is this a reply to my post? You seem to have avoided the issue I was addressing and ranted on about something unrelated. I don't disagree that the government is not spending the money it receives efficiently. That's completely unrelated to what I was suggesting. I wasn't suggesting we give the government any more or less money than we do now. I was suggesting that we distribute the tax burden more fairly. You use the roads way more than I do, should you not in fact pay more for their upkeep than I do? I think that's only fair. Why do you think I should pay for your use of the highway? Do you always look to the government for free handouts?
--
Re:Sales tax is definitly the way to go! (Score:1)
Maybe, maybe not. These are interesting ideas, and I don't disagree with them, I just don't think they address a truly significant problem. People talk about rich people evading taxes and so on, but really, this is a relatively minor problem. If we simply stopped taxing millionaires altogether, it wouldn't make a significant dent in the budget. There simply don't make that large a contribution to the IRS's yearly take -- there just aren't enough of them for it to really make a difference. Which is not to say I think they should be exempted from taxes, but just applying a national sales tax instead of an income tax and letting them pay their fair share under the same system everyone else uses seems enough. If it turns out they spend a smaller percentage of their income than others on taxes that way, well, so that's what happens. No big deal, no real need to up luxury taxes, capital gains taxes, or anything like that. We can, but it's just not that big an issue...
--
Re:Smart Cookies (Score:1)
Of course not, that's why I voted for him.
--
Re:Media Quotient missed the boat (Score:1)
Even if 100% are online, so what? (Score:1)
Politicians are politicians. They are good at one thing, and ONE THING ONLY, and that is, TELLING LIES.
Whether they do it online or not, LIES are still LIES.
Whether or not the people the pols are telling lies to are online or not, the pols know how to TAILOR their lies so nicely that people will BUY INTO THEIR LIES.
Even if 100% of the electorate are online, even if 100% of the pols are here to woo our votes, it still won't change the basic tenet a bit - that they (the pols) will end up RUINING OUR LIVES, because WE LET THEM !
Yes, but maybe that's a good thing. (Score:1)
Not just opinion polls... (Score:1)
You fail to note the influence of big money.
Anonymous Cowards (Score:1)
________________________________
only 1% of fund raising through net (Score:1)
way.
Re:Even if 100% are online, so what? (Score:1)
Encryption (Score:1)
Are there any public documents detailing their respective plans for cryptography export regulations?
Re:instant online polls after debates (Score:1)
Interesting. I haven't heard anything positive about him here either. I don't suspect race first, religion is far more likely in this forum; but I was curious about the Slashdot readership's opinion since I favor Mr. Keyes.
Anyone have anything to say on the subject?
cheers,
sklein
Re:hmm... (Score:1)
And good. You burned about 2200 gallons of gasoline, releasing lots of toxins and pollutants. Get a fuel-efficient car, let the inner-city asthmatic kids breathe better, and pay less taxes. Everybody wins.
Re:hmm... (Score:1)
Re:Media Quotient missed the boat (Score:1)
Yes, but we'd run into the crappy of options problem for those who, like myself, favor third-party wackos.
Read the candidate comparisons that are going to appear all over the web over the next 10 months. And make an intelligent decision.
While certainly no substitute for performing your own analysis, GoVote's VoteMatch [govote.com] is a pretty nifty and useful tool that compares your views to the candidates'. There's a terrible dearth of anyone but Democrats and Republicans (though Pat Buchanan is there -- yuck), but, honestly, one of them is going to win anyway.
Re:Encryption (Score:1)
Re:Yes, but... (Score:1)
Well, it's on the *Internet*, and we all know that the internet is only for perverts and anarchists, and that no *real* American would be caught dead in such a place, right?
People still have the tendency to view people on the Internet as machines or to dismiss actions that occur here as not worthy of "real people".
Unsurprisingly, this is still the case with the reactionary world of contemporary American politics.
~~~~~~~~~
auntfloyd
Re:Media Quotient missed the boat (Score:1)
I think this is an excellent idea, except for the fact that this is an international forum. Perhaps a seperate area where this can take place would be better and not all mixed in with the rest of the slashdot news.
I would love a nice collection of links that focus on the candidates since I'm too fscking lazy to spend hours tracking down decent information myself...
Re:Regressive flat tax? (Score:1)
*Sigh*... no, it wouldn't. Once you've eliminated the corporate taxes and compliance costs that are embedded into the price, the retail cost of most goods, including the national tax, will be roughly the same (within a few percent). Check out Americans for Fair Taxation [fairtax.org] for more details. The bill they sponsor, HR 2525, is a single-stage, single-rate tax on all new retail goods and services (used goods are not taxed, nor are non-retail sales such as business to business). The bill also provides a rebate set by the poverty line that everyone is eligible to receive the same dollar amount. In other words, it is that rarest of laws these days -- one that would treat every single person identically.
--
Re:Regressive flat tax? (Score:1)
Or did I missread you, and you are actualy stating that the price after a national sales tax would not be the same?
Because the government would not be collecting individual income taxes, people would have more disposable income, and retail sales would go up (even if only due to inflation, which is an unlikely risk) accordingly.
Add to that a more dynamic model of economics, which actually assumes that taxation levels and types actually have an impact on economic activity (this, BTW, is radical thinking for most government organizations...), and the fact that the reduced costs of production would make American (since we are talking about the US in this example) products more competitive with foreign goods, increasing the wage base, which increases the retail sales base, which decreases the necessary tax rate (cycle until the diminishing returns equal zero).
A retail sales tax (in lieu of an income tax) also gets rid of the intrusive IRS, and the need to fill out a return each year.
--
Re:Websites of the candidates. (Score:1)
Harry Browne ( [harrybrowne2000.org]) - Apache on BSD
Steve Forbes ( [forbes2000.com]) - Netscape Enterprise on Solaris
Alan Keys ( [keyes2000.org]) - Apache on Solaris
And just for the halibut, my favorite undeclared choice, Jesse Ventura, who, while he doesn't have a campaign website, does have a website on his current administration ( [jesseventura.com]), which runs (drumroll please) Apache+PHP on Linux! (My man is with it.)
Normally, I'm not a karma whore, but folks need to know about more than just the aforementioned heffalumps and woozles when they go to choose who will lead this nation into the 21st century (which starts in another 345 days!) For freedom, eh?
p.s. these are NOT THE ONLY GOOD CANDIDATES, go find your own, alreddie... and post back!
--
Elephants and asses
are scamming the masses
irrelevant (Score:1)
their success has nothing to do with their web
sites at all especially here since certain people
are usally frontrunners and that is the case here.
huh? (Score:1)
Heh, I guess it just took a while for those -5. Ah well. Enjoy your 'break' asshole
"Subtle Mind control? why do html buttons say submit?",
"troll protection" (Score:1)
I guess this guy just spammed the hell out of it before he got -5. After that though, he probably stopped... Unless he was on a dynamic IP...
"Subtle Mind control? why do html buttons say submit?",
flat tax (Score:1)
The rich will probably pay more money, but less persentages. The people paying the most will be the upper middle class, forwhom $20,000 is not a significant amount of there total income.
"Subtle Mind control? why do html buttons say submit?",
environmental modeling (Score:1)
There are certan things we don't know about the effects of greenhouse gasses. But we can guess. By changing the guesses, the effect of man-made polutants can be anywhere from 0 to a huge amount. Regardless of, cars, factories, whatever.
Anyway, if the earth gets to hot, all we need to do is insert some particulates to reflect the sun's light a bit before its hits the earth. Cooling the earth isn't reall even a problem.
"Subtle Mind control? why do html buttons say submit?",
Re:Internet information and the presidential race. (Score:1)
Whatever, that fundi-fuck would just as soon stomp all over your freedoms if it ment more votes from the Chirstian Coalition, or more money from ExxonMobil/AOL-Timewarner or whoever.
"Subtle Mind control? why do html buttons say submit?",
Re:Media Quotient missed the boat (Score:1)
This votey thing matched me up with some guy from the natural-law party first. Then henry brown, and Bill bradly. Lots of options for lil-guys.
"Subtle Mind control? why do html buttons say submit?",
Re:America: The Great Mediocracy (Score:1)
"Subtle Mind control? why do html buttons say submit?",
IRIX (Score:1)
I know, I know, its not as fun as doing it yourself. But anyway, McCain Uses IRIX. pretty weird.
"Subtle Mind control? why do html buttons say submit?",
Re:Regressive flat tax? (Score:1)
Why the hell should I care what the effects of a flat tax are to steive Forbs? I care about the effect of the tax on three things. How the poor will be taxed, how much money the government will loose/gain, and how much I'll have to pay. Since Forbs isn't poor, I see no reason to pay atention to how much he will benifit-loose by any tax plan.
"Subtle Mind control? why do html buttons say submit?",
Re:Regressive flat tax? (Score:1)
Hrm, I doubt thats correct. However, if it were true then the government would be getting the same amount of money from products as they are now, acsept no Income tax. So while the government looses a huge revinue stream it would gain nothing.
Or did I missread you, and you are actualy stating that the price after a national sales tax would not be the same?
"Subtle Mind control? why do html buttons say submit?",
Re:You mean posts/user (per unit time)? (Score:1)
LetterRip
Will it increase the number of people voting? (Score:1)
Maybe.
Resistence is futile (Score:1)
I hope you don't find this off topic - because the influence of politics on media must not be underestimated. There are very few news agencies out there, and a lot of the data they spread steems directly from the White House, the Pentagon and large corporations. Do you think Reuters verifies all the news they release? "It's from the White House speaker, it must be true!" Don't forget that all major government agencies spend millions every year on a staff of hundreds of press speakers. And they know who pays their salery.
Idiot (Score:1)
Who ever posted those comments needs first off to get a life. Don't ruin
It may even be a good idea to get rid of being able to post anonymously. Lets not have to resort to that, and just have everyone grow up.
Slashdot is a site for nerds, not for little pervs who think it is funny to post comments about Portman with hot grits down her pants.
So come on people, lets move
Re:hmmm (Score:1)
You mean like dependency on government and forced re-election of democrats( gee.. the republicans just want to take away all your entitlements that you're not guaranteed to under the constitution. They're mean so you better vote for your master.. er, I mean democratic candidate )
3. Shooting all poor people.
Losing your self-respect and becoming dependent on others for every facet of your daily life is far a worse punishment than death. Why is it that they're poor? Because they're too lazy to work? I've had a TON of people on welfare work for me... they do just enough to not get fired for 30 days and then do their damndest... why? Because if they "attempt" to get a job, they can go back to sitting around doing nothing.
It's about time for Americans to realize they need to take responsibility for their own lives. There's been enough government engulfment of everyone's responsibilities... Hell, most criminals don't even pay their full penance to society, only to go out and commit more crime. Of course, it's not their fault... they are disenfrachised because everyone else had it easier than him.
Give a man a fish and he'll eat for a day, teach a man to fish and he'll eat for the rest of his life.
How useful is an online presence??? (Score:1)
Reminds me of a long time ago when a poll was taken by telephone... The only problem was telephones were so expensive in them days, the poll was incredibly inaccurate...
Re:Let's see what OS their servers are running.. (Score:1)
Re:NT, I would say (Score:1)
Windows 2000 uses IIS 5.0, which is pretty much the same as IIS 4.0, although I'm not sure how it'd install on Win2K professional (the successor to NT Workstation).
Re:how about PRINCIPLES? (Score:1)
david freidman has also written a response [best.com] to a "non-libertarian faq".
Re:Anonymous Cowards (Score:1)
---
Al Gore (Score:1)
(someone got to say it...)
Re:DoSed (Score:1)
I can just picture it...
there's lxdoom and psdoom and now slashdoom...
Unfourtunately slashdoom is not open sourced
#include <signal.h> \ #include <stdlib.h> \ int main(void){signal(ABRT,SIGIGN);while(1){abort(-1)
Re:America: The Great Mediocracy (Score:1)
the winners... (Score:1)
I work for a law firm, and in research and polling, words matter. how you word something will totally change the results of the poll. I can't see how Americans would want to vote in another Democrat for a few years after the crap that Slick Willy has put us thru.
I'm glad we aren't relying on these internet guesses to actually elect officials.
Fook
Re:hmm... (Score:1)
Methinks not.
To the contrary, Anita Hill would be a web blockbuster.
Re:Media Quotient missed the boat (Score:1)
well... but what a show.
I don't think that is what anyone in politics wants anymore. I am so fed up with the political scene, it is so corupt. I am even more upset with the largely weak-minded, pop culture American people who believe - without even questioning or thinking for themselves - anything they read. The fringe does not matter to the candidates, other can be too easily brainwashed.
Without too much of a rant let me make a couple points that people should kep in mind:
o Campaign finance reform - someone who is not rich or very well connected to the rich canhardly run for office and CANNOT win a major election. Because of this business interests run the govt.
o Because of a lack of really devisive issues, most candidates will tend to be faximilies of each other as far as stances on issues - just a couple minor difference. Candidates now must sell themselves with personality (read b.s.-ing)
o I would love to see a completely imaginary candidate run using technology to support the election. I mean - get a great website, press releases, make up an identity, use some cool media production to fake interviews etc - i really think one major network would believe it and then the rest would follow. It could be a candidate how lives by the rules of open source. Too bad the candidate who would govern this way does not exist.
Re:hmm... (Score:1)
This seems like a great idea to me. Yes, businesses and maybe investors would still have complicated tax laws, but it would still be a big improvement for most of America.
Re:hmm... (Score:1)
In other countries gasonline taxes are over 100%. By using a car, you're hurting us all. You should have to pay big time for it. A measly 900% tax would still be ripping off your grandkids.
For example, I recently attended a scientific talk where the speaker showed plots of climate simulations run as far forward as they are trustworthy. According to their best model, merely permanetly parking every car in the world isn't enough action to prevent tempratures from rising 10 degrees F and cities being submerged! We need to take drastic measures fast. Imposing very large taxes on environment destroying things like gasoline is the least we can do.
Re:hmm... (Score:1)
Please do not simply dismiss our best efforts to understand what we're doing on the basis that we're not 100% sure. Scientists can run the same model with and without different effects, such as factories, rain forest burning, cars, etc. And the current best models show that there will be a significant difference depending on such factors.
I beleive nearly all researchers agree that there are significant environmental changes taking place. What is not agreed upon is whether human activity is causing those changes. I find the alarming thing is not the magnitude of the changes over the next 20 years (about as long as the models could reasonablely be trusted), but rather than rate of change. If such rates are maintained, it seems quite likely that something drastic will happen beyond the timescale of validity of the models, but not beyond the timescale of my lifetime.
Yes, there are people who put up websites saying there's nothing to worry about. That doesn't mean it is so. If you are really interested, I'd recommend researching the various sites credentials. While I don't completely trust anybody, I trust academic physics funded by NSF more than I trust "scientists" funded by oil companies.
WRT your particular situation: I beleive this is a serious enough problem that it's worth making serious sacrices. 90 miles/day would require a lot of time and effort on bike. Please consider relocating either your home or your place of work.
Don't count on it... (Score:1)
Now an on-line study of web-sites indicates McCain and Bradley leading. Does this mean anything? Probably not, since people that sponsor and run political web-sites are not indicative of the general population's tastes.
Besides, if they were really looking, they would have had to mention Harry Browne or one of the other Libertarian types... [lp.org]
Smart Cookies (Score:1)
I'm a registered Republican, but I'd rather see McCain or Bradley win than any of the other candidates
And Internet news had little to do with that decision, it's just that I think Bush is a puppet for the rich and Gore has about as much wit and charisma as I have in my left big toe.
Call it intuition.
Platforms do not equate (Score:1)
Re:Yes and No (Score:2)
how about PRINCIPLES? (Score:2)
MoNsTeR
You mean posts/user (per unit time)? (Score:2)
Frustrating for the legitimate cowards, but it could work...
Another idea is to make anonymous cowards even less visible than they are - but let registered people "sign" cowards posts and take responsibility for the content.
Cheers,
Ben
Re:hmm... (Score:2)
On the other hand, the middle ages were substantially colder than the current period. The Thames used to freeze over every winter. This has not happened for more than a century.
It's all because of filtering software! (Score:2)
"Gore", vulgar term for visceral matter released by serious injury: violence, block it.
"Bradley": inoffensive, let it through.
"McCain": inoffensive, let it through.
America: The Great Mediocracy (Score:2)
Face it: the Internet changes *nothing*. Sure, it allows the faster dissemination of knowledge and better communication between voters, but it doesn't affect the main problem which seems to strike at the presidential race: the candidates, for lack of a better phrase, suck.
In America, anyone can become president, so long as you are a middle-of-the-road white male 'republiocrat' who is willing to base both your campaign and administration soley on opinion polls. So we must be content with what the two parties are willing to give us: either a former crack addict who is adamant about tougher sentances for drug addicts (among his many other hypocracies and past failings) and bland party men such as Gore who, together with his wife Tipper, would censor anything which offended their delicate sensibilities.
The only way out is to truly bring America into the mult-party system. Break the monopoly of the GOP and Democrats on political power.
Ok. I'm done ranting.
For now...
~~~~~~~~~
auntfloyd
Re:Don't discount it too quickly. (Score:2)
But in fact, it's hardly just one "we" anymore, at least compared to the Net culture of old (and not to imply that the old days were one big happy family or anything...).
What I find much more potentially interesting about certain internet forums (Usenet groups, things like Slashdot, other chunks of the web) is that they are automatically archived, and reasonably searchable. In that kind of environment, it is
All in all, it's very possibly a politician's worst nightmare.
:-)
Regressive flat tax? (Score:2)
*sigh* it's amazing how uninformed people are. You don't want a flat tax beacuse it's regressive (not true) but you think a sales tax won't be? Are you crazy? Think about man, the less people have, the more % of there money they spend. Poor people want to buy more then food/clothing/books. A national sales tax, and suddenly getting computers to inner-city students just got 20%-30% more difficult. Talk about tech stratification. Meanwhile, Mr Rich spends a little of his (untaxed)money, and puts the rest in stocks and intrest berring bank acounts. He'd probably end up only spending about 2% of his income in taxes, wheras a low income person will spend almost the tax rate % of there income.
Oh, and no Flat-tax plan actualy flat. in general, the first $20,000 is not taxed. (plus $5,000 more per dependend). So a family of making $38,000 a year would only pay 17% of $3,000 -- $510. Not $6460.
A flat tax is by definition nither progressive or regresive. All flat tax 'plans' are progressive. A sales tax will certanly be extremely regressive.
but that said, I'm glad to see that you felt you could critize something that you obviously never even bothered to look up. I mean, why would you want to actualy know somthing, when its just as easy to spout of without knowing anything at all!?!?!
"Subtle Mind control? why do html buttons say submit?",
Don't discount it too quickly. (Score:2)
Perhaps a more important effect of the internet is the way news and rumors get around. I've heard talk show hosts bring up rumors and facts they've gotten from the internet often enough. We're a minority, but we're an influential one.
Direct result of Katz's 3-part tribute to Smargle? (Score:2)
I doubt we'll see him again, I think he's made his point. Nonetheless, I imagine some other fLamer will take up the torch.
The best way to deal with these is never to mention them (well, the best way is to have a trusted and ever-vigilant deleter, who deals only with extremely blatant repeat posts, but this works too). They always get bored and move on.
Different Interpretation (Score:2)
They have the strongest positive and negatives for Bush and Gore, and then strong positives for Bill Bradley and John McCain.
The reason for this, is that the strong criticism of either side, are likely from those with opposite political idealogies, who, for lack of information about the other side, focus on the most predominate individual in the other parties campaign, hence Bush and Gore. Essentially, Bradley and McCain are ignored by the naysayers because they aren't considered politically important.
Just a thought...
LetterRip
hmmm (Score:2)
-----------
"You can't shake the Devil's hand and say you're only kidding."
It is for the average Internet Person (Score:2)
The article states, "On the eve of the first series of primaries and caucuses in the 2000 presidential campaign, Democrat Bill Bradley and Republican Sen. John McCain are in the best position to win over a critical group of potential voters: Americans who use the internet for news."
I do not think that this means us - or highly advanced users. It means people that might get on and visit msnbc.com or do a little bit of Online trading. - We as a whole on
If I was an AOL'er, I would care about the candiates view on the Net somewhat and would visit thier page...
Also note that the average AOL'er is far more likely to vote for a mainstream canidate than a
TV and News is fading... and probably will be gone sooner than you think, even though net voting doesn't exist - it is very popular for people like Gov. Ventura of MN to host virtual forums. - Internet voting will appear soon... even though people may/may not trust it.
will the net broaden political participation? (Score:2)
some people see the internet as a means of reaching out to otherwise discontented and apathetic voters by providing more customized and relevant fora for discussion of electoral issues.
whether or not this actually occurrs is a whole other issue, cause much of the media coverage of the election itself is comparable to canned laughter: entirely predictable. will the internet be that much different?
personally i'm curious to see how slashdot covers the elections. so far i think its just fine
Re:hmm... (somewhat OT) (Score:2)
At the moment it seems to be thrown at everyone who ever spoke against one of the bullshit 'Protect our children from', 'protect Medicare from', 'protect BigCorp from' proposals. Microsoft lambasts the DOJ as liberals for prosecuting them, Buchanan calls everyone a liberal because they won't go for his form of state-sponsored religion, Gore calls Bradley liberal because he once *talked* to a gay-rights group, etc.
Ironically, 'conservative' is used much the same way among liberal circles, usually with 'bible-thumping' as a prefix. Unfortunatly, the public opinion polls shopw us a 'conservative' nation at the moment, so those circles are smaller and smaller.
Re:hmm... (Score:2)
And sin-taxes? Take smoking. In 1997, the total governmental cost of smoking related-illness was $20 billion. That very same year 24 billion packs of cigarettes were sold. I pay over a buck a pack in tax; Where else is the government mis-spending the money they said was to repay them for smoker's expenditures? And what about the untold billions they stand to make from the tobacco settlement? It certainly isn't being spent properly!
I vote we just toss all the bums out of office and start over. There's gotta be a more cost effective way of doing it!
Re:hmm... (Score:2)
If it can't be positively shown that we are causing the effect, who are we to screw with it? We are not gods, and we shouldn't be able to dictate the how earth deals with climatic variation. You would agree that selective extermination of 'harmful' plant or animal species is wrong, how is selective tinkering with the mechanism that produced them different?
Re:Gore '00 (Score:2)
Lest we forget, Tipper is the one who brought music censorship into the spotlight, and is the reason my college freshman brother can't buy Sex Pistols albums at the local record shop.. Anyone who can laugh about smoking pot as a kid and then support the mandatory sentancing bills needs a Volkswagon enema.
Re:hmm... (Score:2)
Fuel efficient? I get better highway mileage than most of the crop of Super-SUVs, and better city than at least one of them. Just because I could be driving a sub-compact hybrid doesn't mean I will.
Re:hmm... (Score:2)
I apologize.
Re:hmm... (Score:2)
A Contrarian View (Score:2)
Even politically conscious folks such as myself probably won't be swayed by a website.
Television and newspapers will still be the forum of choice for the next few cycles.
Internet information and the presidential race. (Score:2)
All of these factors allow for the internet to play a role just not a very large one. I for one think both Bradly and McCain(sp) are total idiots. I watched a debate that was I believe from the major party debate on NH on PBS a couple of weeks ago. Someone like George W. Bush would make a better choice about freedom compared to some of those people who could have quite easily been the real life counterparts to Ned Flanders of Simpsons fame. The real thing to look out for is when one of those 'moral' people decide to get in the hot seat.
Re:Anonymous Cowards (Score:2)
Well I just couldn't resist this little tidbit!
In general you must provide the name and address of the individual. Failing that a good picture or anything that can allow for facial expression analysis to go on. Then I can procure a handmade high powered weapon with telescopic sight produced with a custom plastic die process. A single bullet to the head will usually do the trick fired from a concealed location in a secluded area.
However the best/most sadistic way is to use a deadly toxin. Most of the best fast acting toxins include potassium cyanide caplets or hyrodgen cyanide gas that is released in a confined space like an elevator or stairwell or even the vitim's car. If you wish to avoid detection however the best method by far is to use a little thing the KGB cooked up back in the 70s. A little case involving a Bulgarian dissident who displeased them met with a rather unpleaseant end when an unidentified agent "accidentally" stumbled into him on a city street. What then occured was a small fine needle jabbed into his leg cavity implanting a metal sphere containing a small ammount of a deadly nerve toxin. He incidentally died about 24 hours later. So yes it is possible. What is really troubling is that (at least for me). The text of the little SMARGLE posts are in fact particularly nasty when viewed in IE5 (I am in it right now). Has anyone else noticed this? Perhaps a little DoS attack directed at the httpd log acces files will obtain something.
Online == Newspaper & other thoughts (Score:2)
Considering that 95%+ of online news is simply reprinted newspaper news (particularly from the associated press), what does this really mean? It seems to me that it's just an equivalent measure of positive stories in the paper press.
I will say that there is probably quite a bit of influence from the "new media" like Drudge. How much influence I think is impossible to say, and I don't think this study does anything to measure it.
I find the more interesting question is whether TV news is gaining less influence. The last 30 years has seen a huge surge in the power of national TV news. Are we seeing a return to people getting more information from printed sources? If so, I can't help but think this is a positive thing. I tend to think that people's brains are more engaged when they are reading something than when they have hysterical blow-dried anchors feeding information in just the right tone of voice.
---
Politicians offline.... (Score:2)
Let politics stay in the physical world as long as possible so that it has the farthest to catch up when it finally does move online. If the Internet is really about change, then let's not bring dead weight from politics into the mess of things in the online world.
The seporation of the digital world from the physical one is something that I personally enjoy a great deal. Not hearing about Clinton (except when it comes to crypto) this, Bush that, or Gore bleah bleah bleah is almost comforting. Sure politics are important, don't get me wrong, I vote and like to think that I am good at educating myself about whatever is on the ballot before an election, but the absence of politics online... is nice to say the least.
I hope politics stay offline for as long as possible... well... until the day when we have a canidate that knows (or knew) how to program in C and knows the first bit about how networks operate (or even the Internet for that matter, but I may be getting wishful at this point). The sad part is that I think I may have to settle... There are choices in soft drinks, operating systems, but not in politicians...
yeah yeah, offtopic, but a possible idea (Score:2)
I can't imagine any reasonable grounds to object to this on, since it usually takes 3 minutes or so just to read the relevant articles or posts. Saves users' time, prevents multiple trolls.
Just a thought...
-SaintAlex
Observe, reason, and experiment.
Websites of the candidates. (Score:2)
Al Gore's website at [algore2000.com]
is running Apache/1.3.9 (Unix) secured_by_Raven/1.4.2 PHP/4.0b3 on Linux.
Bill Bradley's website at [billbradley.com]
is running Apache/1.3.9 (Unix) mod_perl/1.21 on Solaris.
George W. Bush's website at [georgewbush.com]
is running Microsoft-IIS/4.0 on NT4 or Windows 98
John McCain's website at [mccain2000.com]
is running Rapidsite/Apa-1.3.4 FrontPage on IRIX
Re:hmm... (somewhat OT) (Score:2)
When you say "classic liberal", you're very nearly using the exact terminology. There is a distinction to be made between what is now often called "classical liberalism"... the position of John Locke, Adam Smith and Thomas Jefferson, and the "modern liberalism" of FDR and Ted Kennedy. The two share some positions, such as freedom of the press and sharp separation of church and state, but on issues such as gun rights and the free market classical liberals are aligned with today's US "conservatives".
The term "libertarian" was coined by people who saw themselves in the classical liberal tradition, but who found that in the US the term "liberal" had, oddly, become sturdily affixed to a populist, federalist position. From my understanding, the term "liberal" retains somewhat more of its original meaning in Europe and elsewhere... perhaps in Canada as well.
And IMHO, the real offense of income tax is against privacy. The 16th amendment needs to go.
hmm... (Score:3)
But... how many people out there get most of their political news from the internet? Maybe that would make a good slashdot poll, because I know I don't, but I'm sure other people do. I know the Starr report was a very popular download, so maybe this will start to make a difference. Heck, ever since Byte disappeared from the shelves, I haven't really supported dead-tree media at all...
Oh, and for future reference: don't support anyone who thinks the flat tax will solve all of your problems. They're morons. All it does is change the current (progressive) bracket system with a simpler, flat/regressive one. A better solution would be a national sales tax with exemptions for food / clothing / books, but I don't think people realize how large it would have to be.
---
pb Reply or e-mail; don't vaguely moderate [152.7.41.11].
Re:hmm... (Score:3)
This, too, could be argued to be regressive (rich people doesn't spend a large of a percentage of their income as the rest of us -- with necessities exempted to protect the poor, it winds up mostly a tax on the middle). On the other hand, I think that, even though it's not a perfect solution, it's better than the current one. I see several advantages to a national sales tax in lieu of income. I think we ought to eliminate drivers license fees and license plate tab fees, etc, and bump up the gasoline tax instead. Many of us would pay less this way, although gas guzzlers would of course pay more.
Ultimately, all taxes suck, but this seems to suck less than any of the alternatives.
--
Let's see what OS their servers are running.. (Score:3)
A little portscan and I'm all right
nmap number five...
[root@athens jhaas]# nmap -sS -O -v
Remote operating system guess: Linux 2.2.0-pre6 - 2.2.2-ac5
Wow, Al might be running Linux! Maybe he really did invent the Internet. OK, let's try Bill Bradley, my favorite..
Remote operating system guess: Solaris 2.6 - 2.7
Hmm... robust, enterprise level Solaris. OK, it's UNIX at least. I can respect that. It doesn't look like they're actually running it, which also makes sense.
I made the shocking (shocking!) discovery that George W. Bush laughs the same way as his dear old dad, that weird, stuttered giggle. Unfortunately he's probably going to win.
Initiating SYN half-open stealth scan against www-01.georgewbush.com (206.104.218.130)
It's going incredibly slowly, so I'll come back to that later. As you can tell, I am an 31337 h4x0r, and I own these b0x3s. Let's move on to the aliens from outer space candidates, Keyes and Bauer..
Woah! George W's just finished.. no wonder it took so long -- there's scads of ports open.
TCP Sequence Prediction: Class=random positive increments
Difficulty=85 (Medium)
Sequence numbers: 25507B62 25507CFC 25507F35 255081B8 255083EC 2550866D
Remote operating system guess: Windows NT4 / Win95 / Win98
Nmap run completed -- 1 IP address (1 host up) scanned in 465 seconds
Hah! Point for me. No surprise there that George W's campaign would probably be running NT or something icky like that. It just figures, you know? I suspect if Bradley's campaign was running their own box, it'd have Linux on it. And stiff old Gore would have Solaris or SCO or something like that. Anyway.. on to the space men..
Bauer doesn't seem to have a site up yet, according to bauer2000.com. nmap thinks it's running:
Remote operating system guess: BSDI BSD/OS 3.0
Hmm. Ok. Keyes... scan is going slowly.. maybe I'll do Hatch's for fun and giggles while that grinds away. Much better. Ooh, rail on the administration's abuses, Orrin. You go with your bad self.
Remote operating system guess: Solaris 2.6 - 2.7
No big surprise there. A buttoned down UNIX, if there is such a thing. Who thinks Hatch knows what a UNIX is?
Keyes server has shown us that port 80 is open (which I hadn't already figured out by going there with Netscape..), and is going about as quickly as Bush's. So we'll just ignore that, just like the voters will...
And last, Mr. Flat Tax himself, Steve Forbes. Solaris again. Hmm. Well, interesting. Gore and Bradley were reversed in my mind. Oh -- McCain.. nmap didn't know what to make of that one, so I'll be sending in the fingerprints. Hmm!
Amazing what you can learn while you're supposed to be beta testing something else.
Yes and No (Score:3)
Does it matter enough? Enough for what? To make a difference? Of course it will make a difference, it is one of the main news outlets (Smaller than TV and newspaper but larger than radio) for most of the US population. And we know media makes a huge difference in elections.
But, the nature of the internet (see what you want, at least more so than TV) makes it less helpful to candidates. So, yes it will make a difference in the sense it will be used like every other media outlet to spread propaganda. No, this isn't a revolution, just an evolution.
--Nick
Sales tax is definitly the way to go! (Score:3)
This, too, could be argued to be regressive (rich people doesn't spend a large of a percentage of their income as the rest of us -- with necessities exempted to protect the poor, it winds up mostly a tax on the middle).
You do not neded to do away with capital gains tax.. just income tax. The money needs to go someplace. I guess investment firms could be forced to deduct the tax automatically when you sell stuff, so individual people would not need to fill out taxes unless they actually took possetion of the stock. I suppose you would also need to keep things like inheretance.
These are all good fine reasons, but you missed a very importent reason: people see how much they are paing every day (well companies may include it in the cost of the product, but prices go up when they rase it, so it is still better then the gov. hiding it via paycheck deductions and stuff).
Related to tax reform: It is also worth mentioning that we need to privatise social security, but not give some agency the power to effect the market by having lots of dollars to invest. I supposet he best way to do this would be to allow people to open up social security accounts with financial institutions. People would be allowed to transfer money they have paid to socail security in the past into these accounts. The social security administration would restrict how much money people could have in privatized accounts (you don't want everyone to take the money out now or we would have big problems), but there would be soo much preasure on them to let people have more of their money that they wuold need to keep raising the precentage every year. Eventually, we would have a nice mandatory private investment system which did not need to invest in gov. bonds. Medicare could be a mandatory inshurace attached to these private accounts.
Jeff
Gore '00 (Score:3)
- SD
Re:hmm... (Score:3)
What public transportation? The nearest bus stop is twenty miles further than my employer, in the opposite direction! And is riding a bicycle 90 miles/day actually feasable? Some of us still live in the great wasteland that is Suburbia because we can't afford $1,200/month apartments in the major cities.
Media Quotient missed the boat (Score:5)
I am not a statistic. I am not a number. I am a minority of one and so is each and every person reading this. Don't let the pollsters tell you what you are likely to do. Go out and read the candidates' web sites. Read the candidate comparisons that are going to appear all over the web over the next 10 months. And make an intelligent decision.
Too many media outlets pretend that nothing matters in a presidential race each the Democratic and Republican Party nominees and the photo ops. They don't dig. They tell the stories that will attract the biggest audiences. The net not only doesn't have to do that, there is really no way to constrain it to do that.
I suggested it here before, and I'll suggest it again. It would be interesting to see Slashdot polls about how Slashdot readers will be voting. I would be particularly interested if a few of us, and I'll volunteer, post links to useful web sites with analyses by a variety of interest groups of the candidates' positions. I'm as interested in what the people I wouldn't trust with a soggy match think of the candidates as I am in what the people I like think of them.
Let's give them participatory democracy and see what happens. I bet there are candidates who will love it. It will attract the underdogs, and probably the lunatic fringe as well... but what a show. | https://slashdot.org/story/00/01/20/1748201/internet-effects-on-presidential-campaigns | CC-MAIN-2017-13 | refinedweb | 9,019 | 73.58 |
Introduction to Numpy
Numpy is a Python library which adds support for large, multi-dimension arrays and metrics, along with a large collection of high-level mathematical functions to operate on these arrays. More information about
numpy arrays can be found here.
Description¶
This notebook is designed to introduce users to
numpy arrays using Python code in Jupyter Notebooks via JupyterLab.
Topics covered include:
How to use
numpyfunctions in a Jupyter Notebook cell
Using indexing to explore multi-dimensional
numpyarray data
Numpydata types, broadcasting and booleans
Using
matplotlibto plot
numpydata
Getting started¶
To run this notebook, run all the cells in the notebook starting with the “Load packages” cell. For help with running notebook cells, refer back to the Jupyter Notebooks notebook.
Load packages¶
In order to be able to use
numpy we need to import the library using the special word
import. Also, to avoid typing
numpy every time we want to use one if its functions we can provide an alias using the special word
as:
[1]:
import numpy as np
Introduction to Numpy¶
Now, we have access to all the functions available in
numpy by typing
np.name_of_function. For example, the equivalent of
1 + 1 in Python can be done in
numpy:
[2]:
np.add(1, 1)
[2]:
2
Although this might not at first seem very useful, even simple operations like this one can be much quicker in
numpy than in standard Python when using lots of numbers (large arrays).
To access the documentation explaining how a function is used, its input parameters and output format we can press
Shift+Tab after the function name. Try this in the cell below
[3]:
np.add
[3]:
<ufunc 'add'>
By default the result of a function or operation is shown underneath the cell containing the code. If we want to reuse this result for a later operation we can assign it to a variable:
[4]:
a = np.add(2, 3)
The contents of this variable can be displayed at any moment by typing the variable name in a new cell:
[5]:
a
[5]:
5
Numpy arrays¶
The core concept in
numpy is the “array” which is equivalent to lists of numbers but can be multidimensional. To declare a
numpy array we do:
[6]:
np.array([1, 2, 3, 4, 5, 6, 7, 8, 9])
[6]:
array([1, 2, 3, 4, 5, 6, 7, 8, 9])
Most of the functions and operations defined in
numpy can be applied to arrays. For example, with the previous operation:
[7]:
arr1 = np.array([1, 2, 3, 4]) arr2 = np.array([3, 4, 5, 6]) np.add(arr1, arr2)
[7]:
array([ 4, 6, 8, 10])
But a more simple and convenient notation can also be used:
[8]:
arr1 + arr2
[8]:
array([ 4, 6, 8, 10])
Indexing¶
Arrays can be sliced and diced. We can get subsets of the arrays using the indexing notation which is
[start:end:stride]. Let’s see what this means:
[9]:
arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) print("6th element in the array:", arr[5]) print("6th element to the end of array", arr[5:]) print("start of array to the 5th element", arr[:5]) print("every second element", arr[::2])
6th element in the array: 5 6th element to the end of array [ 5 6 7 8 9 10 11 12 13 14 15] start of array to the 5th element [0 1 2 3 4] every second element [ 0 2 4 6 8 10 12 14]
Try experimenting with the indices to understand the meaning of
start,
end and
stride. What happens if you don’t specify a start? What value does
numpy uses instead? Note that
numpy indexes start on
0, the same convention used in Python lists.
Indexes can also be negative, meaning that you start counting from the end. For example, to select the last 2 elements in an array we can do:
[10]:
arr[-2:]
[10]:
array([14, 15])
Multi-dimensional arrays¶
Numpy arrays can have multiple dimensions. For example, we define a 2-dimensional
(1,9) array using nested square bracket:
[11]:
np.array([[1, 2, 3, 4, 5, 6, 7, 8, 9]])
[11]:
array([[1, 2, 3, 4, 5, 6, 7, 8, 9]])
To visualise the shape or dimensions of a
numpy array we can add the suffix
.shape
[12]:
print(np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]).shape) print(np.array([[1, 2, 3, 4, 5, 6, 7, 8, 9]]).shape) print(np.array([[1], [2], [3], [4], [5], [6], [7], [8], [9]]).shape)
(9,) (1, 9) (9, 1)
Any array can be reshaped into different shapes using the function
reshape:
[13]:
np.array([1, 2, 3, 4, 5, 6, 7, 8]).reshape((2, 4))
[13]:
array([[1, 2, 3, 4], [5, 6, 7, 8]])
If you are concerned about having to type so many squared brackets, there are more simple and convenient ways of doing the same:
[14]:
print(np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]).reshape(1, 9).shape) print(np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]).reshape(9, 1).shape) print(np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]).reshape(3, 3).shape)
(1, 9) (9, 1) (3, 3)
Also there are shortcuts for declaring common arrays without having to type all their elements:
[15]:
print(np.arange(9)) print(np.ones((3, 3))) print(np.zeros((2, 2, 2)))
[0 1 2 3 4 5 6 7 8] [[1. 1. 1.] [1. 1. 1.] [1. 1. 1.]] [[[0. 0.] [0. 0.]] [[0. 0.] [0. 0.]]]
Arithmetic operations¶
Numpy has many useful arithmetic functions. Below we demonstrate a few of these, such as mean, standard deviation and sum of the elements of an array. These operation can be performed either across the entire array, or across a specified dimension.
[16]:
arr = np.arange(9).reshape((3, 3)) print(arr)
[[0 1 2] [3 4 5] [6 7 8]]
[17]:
print("Mean of all elements in the array:", np.mean(arr)) print("Std dev of all elements in the array:", np.std(arr)) print("Sum of all elements in the array:", np.sum(arr))
Mean of all elements in the array: 4.0 Std dev of all elements in the array: 2.581988897471611 Sum of all elements in the array: 36
[18]:
print("Mean of elements in array axis 0:", np.mean(arr, axis=0)) print("Mean of elements in array axis 1:", np.mean(arr, axis=1))
Mean of elements in array axis 0: [3. 4. 5.] Mean of elements in array axis 1: [1. 4. 7.]
Numpy data types¶
Numpy arrays can contain numerical values of different types. These types can be divided in these groups:
Integers
Unsigned
8 bits:
uint8
16 bits:
uint16
32 bits:
uint32
64 bits:
uint64
Signed
8 bits:
int8
16 bits:
int16
32 bits:
int32
64 bits:
int64
Floats
32 bits:
float32
64 bits:
float64
We can specify the type of an array when we declare it, or change the data type of an existing one with the following expressions:
[19]:
# Set datatype dwhen declaring array arr = np.arange(5, dtype=np.uint8) print("Integer datatype:", arr) arr = arr.astype(np.float32) print("Float datatype:", arr)
Integer datatype: [0 1 2 3 4] Float datatype: [0. 1. 2. 3. 4.]
Broadcasting¶. This can make operations very fast.
[20]:
a = np.zeros((3, 3)) print(a) a = a + 1 print(a)
[[0. 0. 0.] [0. 0. 0.] [0. 0. 0.]] [[1. 1. 1.] [1. 1. 1.] [1. 1. 1.]]
[21]:
a = np.arange(9).reshape((3, 3)) b = np.arange(3) a + b
[21]:
array([[ 0, 2, 4], [ 3, 5, 7], [ 6, 8, 10]])
Booleans¶
There is a binary type in
numpy called boolean which encodes
True and
False values. For example:
[22]:
arr = arr > 0 print(arr) arr.dtype
[False True True True True]
[22]:
dtype('bool')
Boolean types are quite handy for indexing and selecting parts of images as we will see later. Many
numpy functions also work with Boolean types.
[23]:
print("Number of 'Trues' in arr:", np.count_nonzero(arr)) # Create two boolean arrays a = np.array([1, 1, 0, 0], dtype=bool) b = np.array([1, 0, 0, 1], dtype=bool) # Compare where they match np.logical_and(a, b)
Number of 'Trues' in arr: 4
[23]:
array([ True, False, False, False])
Introduction to Matplotlib¶
This second part introduces
matplotlib, a Python library for plotting
numpy arrays as images. For the purposes of this tutorial we are going to use a part of
matplotlib called
pyplot. We import it by doing:
[24]:
%matplotlib inline import matplotlib.pyplot as plt
An image can be seen as a 2-dimensional array. To visualise the contents of a
numpy array:
[25]:
arr = np.arange(100).reshape(10, 10) print(arr) plt.imshow]]
[25]:
<matplotlib.image.AxesImage at 0x7f1fe1f5b430>
We can use the Pyplot library to load an image using the function
imread:
[26]:
im = np.copy(plt.imread("../Supplementary_data/07_Intro_to_numpy/africa.png"))
Let’s display this image using the
imshow function.¶
[27]:
plt.imshow(im)
[27]:
<matplotlib.image.AxesImage at 0x7f1fe1ee4130>
This is a free stock photo of Mount Kilimanjaro, Tanzania. A colour image is normally composed of three layers containing the values of the red, green and blue pixels. When we display an image we see all three colours combined.
Let’s use the indexing functionality of
numpy to select a slice of this image. For example to select the top right corner:
[28]:
plt.imshow(im[:100,-200:,:])
[28]:
<matplotlib.image.AxesImage at 0x7f1fe19fb940>
We can also replace values in the ‘red’ layer with the value 255, making the image ‘reddish’. Give it a try:
[29]:
im[:, :, 0] = 255 plt.imshow(im)
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
[29]:
<matplotlib.image.AxesImage at 0x7f1fe19dc040>
Recommended next steps¶
For more advanced information about working with Jupyter Notebooks or JupyterLab, you can explore JupyterLab documentation page.
To continue working through the notebooks in this beginner’s guide, the following notebooks are designed to be worked through in the following order:
-
-
Products and Measurements
-
-
Performing a basic analysis
Introduction to Numpy (this notebook)
-
Parallel processing with Dask
Once you have you have completed the above nine tutorials, join, NCI compatible, numpy, matplotlib, plotting, beginner | https://docs.dea.ga.gov.au/notebooks/Beginners_guide/07_Intro_to_numpy.html | CC-MAIN-2022-05 | refinedweb | 1,744 | 63.39 |
Finally managed to get it working on Alpha/Linux- you can get a binary from this place, if you're interested. The page also includes rough build instructions and a link to my outdated patch. DrCode registered me as a developer just after fingolfin added most of that patch; I'll try to fix the remaining issues as soon as I have some spare time again (ca. April 2032).
FreeSCI
Fixed the dynview display list (mostly), and released two screenshots that didn't look too broken. The new graphics subsystem definitely takes more time to render the background pictures (it uses flood fill, after all), but, personally, I like the results. Also, the actual screen update time (time spent in the Animate system call) has improved significantly (3x3 currently plays at roughly the speed of the old 1x1; if nothing changes on the screen, network traffic should be minimized when playing over X as well), and, of course, it's more scalable, but I mentioned those two things here before, so I'm not going to go into any detail here.
I still hope I'll have some spare post-christmas time to devote to the gfx subsystem, but a seminar presentation I have to prepare may take a lot of that time.
Alpha
Compaq have released JDK1.2.2 for Alpha/Linux to the general public. This is an important event, since it almost obliterates one of the three platform disadvantages of the Alpha I mentioned here (or was it the Heise newsticker?) a few months ago- they were:
- Broken g++
- No recent JDK
- No hw-accellerated GLX
Anyway, regarding the other two points: cxx is quite good,
if you ignore the implicit g++ namespace mangling. cxx is
evil, proprietary, and binary-only, of course, but there's
not much of
a point in preferring a free broken compiler over a working
non-free compiler.
WRT to GLX, I've heard a few success reports regarding PCI graphics cards (Voodoo 3), but AGP cards still aren't fully supported on my UP1000 because of firmware troubles (an upcoming internal API contact promised to give me an estimated date for the release of the upgrade next year, though).
University
AI test tomorrow. This should be fun- I like the subject. One of the few things that are more fun than building compilers or engines for 10-year-old games. | http://www.advogato.org/person/jameson/diary/15.html | CC-MAIN-2015-18 | refinedweb | 399 | 55.78 |
I'm using Webstorm 3.0 EAP and I want to use typescript path alias feature after reading this introduction:
tsconfig.json:
{
"baseUrl": "./",
"paths": {
"@baseImages/*": ["images/*"]
}
}
When I import the module like this in a tsx file:
import * as Images from "@baseImages"
Webstorm always says unable to `find the module @baseImages`. Does it support path alias?
WebStorm 2018.3 definitely does support Typescript path mappings. But your mappings are wrong - you will see the same error when running tsc in terminal:
tsc -p .
app.ts:1:25 - error TS2307: Cannot find module '@baseImages'.
1 import * as Images from "@baseImages"
~~~~~~~~~~~~~
you just can't use barrel import from path that exactly matches the specified name prefix when using wildcards.. Adding one more path mapping seems to the the only way to go:
see, | https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001349919-Does-Webstorm-support-typescript-path-alias- | CC-MAIN-2020-40 | refinedweb | 132 | 65.93 |
Introduction: Big, Auto Dim, Room Clock (using Arduino and WS2811)
First Hello instructables.
This is my first contact with :
- Instructables
- Arduino
- Programmable LED's
So please don't trow rocks at me for noobish mistakes.
Keeping that in mind I'm waiting to read your comments with grate interest and I'm open to any suggestion
Features :
- big digits ( each digit is approximately the size of a A4 paper).
- slim in order to fit in a photo frame (a big one).
- auto dim the light depending on the light in the room.
- dedicated DST button.
Step 1: Prerequisites
Things I used for this project :
Electronics :
-)
Total cost of electronics : 17.78 $ (without arduino donation)
Miscellaneous :
Heat Shrink Tubing - 7.99$ ebay (assortment, it total 33m)
20 pcs 5 x 7 cm prototype pcb - 3$ ebay
3 pcs Micro Switch - 1$ locally bought
Solder - 1$ locally bought
- Flux - 1$ locally bought
- UTP cable (individual wires used for various connections)
- LCD font () - free
- Cardboard - free loacal supermarket
Polystyrene board - 1.50$ locally bought
Various tools.
Step 2: Preparing - Digit Template
- download and install LCD font (
- open word or similar editor and make a template similar to the image (first img)
- font size ~800,
- white font color black outline,
- gray boxes where led strip fits
- Print and cut the gray strips with a exacto knife (second img)
Step 3: Preparing - Cut Cardboard and Led Strip
Using the digit template cut the cardboard to size (don't forget to leave space for the dots between hours and minutes)
If your LED strips came with connectors at each end (like mine did) desolder the connector and cut them in sets of 3.
Step 4: Stick the LED Strips
Using the template stick the LED strip on the cardboard.
It's not mandatory but I used a pencil to mark where the LED strips should be placed, this way I got to see the final form before attaching the LED's. It was a good thing since this is how I noticed I left two much space for those dots in the middle, as a result I had stuck the LED strips a little closer.
Step 5: Solder LED Strips
Now starts a long soldering session.
Solder the LED strips in order to form a continues strip.
Notice the order in which to solder the strips in the picture.
For the middle dots I used a single LED strip and covered the middle LED with duct tape.
I used the following color code
- Blue for ground
- Green for data
- Red for Vcc (12v)
Step 6: Wire Arduino on Breadbord
I tried doing a sketch in fritzing but I can't find all the parts :( , Sorry
So here is a list with all the connections and another picture with the setup on a breadboard
Step 7: Test LED's
Before loading this sketch (for which I assume no credit) don't forget to add FastLED library.
If everything went OK the LED's should cycle trough colors. If you have any problems first check your soldered points.
Step 8: Program the Clock
After struggling a little I managed to get a working clock that covers all my needs. I'm sure there is room for improvement.
The code is very commented, if you have any questions please feel free to ask. Also if you have any suggestions, please do tell.
All debugging messages are commented as well.
In order to change the color used you must modify the variable at line 22 ( int ledColor = 0x0000FF; // Color used (in hex)). You can find a list of colors at the bottom of this page:...
If you have problems downloading the code file from instructables here is a mirror :
Step 9: Make Digits Form Using Polystyrene
Cut each segment in the template printed at the beginning.
Form each digit in the polystyrene using a exacto knife (very hard) or a Hot Wire Cutter.
You can see how I made mine in the pictures.
If you don't have a guitar string you can use just about any thin STEEL wire.
In order to power the Hot Wire Cutter I used the 12v LED power supply.
Also there is a picture with a cut digit. (sorry I forgot to take pictures in the process).
Step 10: Glue Digits and Adding Diffuser
After cutting all 4 digits and the dots glue all of them on the cardboard with the LED strips. (for this process I used
double sided adhesive tape).
In order to diffuse the LED light I used 2 paper sheets on top of the polystyrene. For convenience and aesthetics I used a single A2 size paper folded in two.
Also for finishing touches I've put the entire assembly in a large picture frame.
Very good project. Well done.
could someone pass me the code please
Hello everyone!!! Thank you for this awesome project! I already built, but I have a little problem... I conected D0 pin from light sensor to D3 arduino pin and no working, but when i connect D0 pin to A3 arduino pin it's working...
This is good or bad? can someone help me...
Thanks!!
Sar plz add a HH:MM:SS code
Where is 5 x 7 cm prototype pcb was used ?
Thanks for your instructable ;)
After i realized that i shorted the sdl and scl line it works like a charm.
I've found a bug in your arduino script.
You can't use integer for the ledcolor, you have to use longinteger. Else your unable to use the red color.
Also i added some lines to use different colors at different times of day.
regards Martin
amigo serias tan amable de pasarme el codigo de programacion!!! he armado la circuiteria pero no se cual de las que exponen sea la correcta,por lo que muestras considero que la suya es la correcta.
amigo podrias pasar el codigo
Bug and addition
can you post your code on github or directly here? I cant see well on those pictures.. thanks
Thank you everyone, i made my 1st version based on WS2812B cut by 3.
I will finish it later, maybe try to print the Temperature or add some effects! so many possibilities with those Leds it's awesome!!
puedes pasarme el codigo amigo..hebuscado el codigo y nadie lo comparte!
tek renk şerit led kullanarak yapmak mümkün mü
termometre de ekleyebilir miyiz
Nice work,
You can get the temperature form RTC module using this code
int t = RTC.temperature();
float celsius = t / 4.0;
float fahrenheit = celsius * 9.0 / 5.0 + 32.0;
You can comment the last line if you want celsius.
hi, im almost finished with this great project. I just dont understand how to put this temperature code into the full code. Im total noob to programming ;-) can u help ? thanks a lot
Thanks for sharing this with us and thx for the tip i think you meant float t ;)
here is a video of what it looks like : every minute i add the cylon effet example and then it changes the color randomly from preselected array of colors.
Here is my code :
#include <DS3232RTC.h>
#include <Time.h>
#include <Wire.h>
#include <FastLED.h>
#define NUM_LEDS 90 // 5 by segment + 6 in the middle
#define LED_TYPE WS2812
#define COLOR_ORDER GRB // Define color order for your strip
#define BRIGHTNESS 150
#define LED_PIN 5 // Data pin for led comunication
CRGB leds[NUM_LEDS]; // Define LEDs strip
byte digits[10][21] = {
{
0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }
, // Digit 0
{
0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1 }
, // Digit 1
{
1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0 }
, // Digit 2
{
1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1 }
, // Digit 3
{
1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1 }
, // Digit 4
{
1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1 }
, // Digit 5
{
1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }
, // Digit 6
{
0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1 }
, // Digit 7
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }
, // Digit 8
{
1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1 }
}; // Digit 9 | 2D Array for numbers on 7 segment
byte firstdigit[2][10] = {
{
0,0,0,0,0,0,0,0,0,0 }
, // Digit 0 first number
{
1,1,1,1,1,1,1,1,1,1 }
}; // Digit 1 first number | 2D Array for numbers on 7 segment
bool Dot = true; //Dot state
bool DST = false; //DST state
int last_digit = 0;
//long ledColor = CRGB::DarkOrchid; // Color used (in hex)
long ledColor = CRGB::MediumVioletRed;
long ColorTable[16] = {
CRGB::Amethyst,
CRGB::Aqua,
CRGB::Blue,
CRGB::Chartreuse,
CRGB::DarkGreen,
CRGB::DarkMagenta,
CRGB::DarkOrange,
CRGB::DeepPink,
CRGB::Fuchsia,
CRGB::Gold,
CRGB::GreenYellow,
CRGB::LightCoral,
CRGB::Tomato,
CRGB::Salmon,
CRGB::Red,
CRGB::Orchid};
void setup(){
Serial.begin(9600);
Wire.begin();
FastLED.addLeds<WS2812B, LED_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );
pinMode(2, INPUT_PULLUP); // Define DST adjust button pin
pinMode(4, INPUT_PULLUP); // Define Minutes adjust button pin
// pinMode(5, INPUT_PULLUP); // Define Hours adjust button pin
}
// Check Light sensor and set brightness accordingly
void BrightnessCheck(){
const byte sensorPin = 3; // light sensor pin
const byte brightnessLow = 75; // Low brightness value
const byte brightnessHigh = 100; // High brightness value
int sensorValue = digitalRead(sensorPin); // Read sensor
if (sensorValue == 0) {
Serial.println("Brightness High");
LEDS.setBrightness(brightnessHigh);
}
else {
Serial.println("Brightness Low");
LEDS.setBrightness(brightnessLow);
}
};
// Get time in a single number
int GetTime(){
tmElements_t Now;
RTC.read(Now);
//time_t Now = RTC.Now();// Getting the current Time and storing it into a DateTime object
int hour=Now.Hour;
int minutes=Now.Minute;
int second =Now.Second;
if (second % 2==0) {
Dot = false;
}
else {
Dot = true;
};
return (hour*100+minutes);
};
void DSTcheck(){
int buttonDST = digitalRead(2);
Serial.print("DST is: ");
Serial.println(DST);
if (buttonDST == LOW){
if (DST){
DST=false;
Serial.print("Switching DST to: ");
Serial.println(DST);
}
else if (!DST){
DST=true;
Serial.print("Switching DST to: ");
Serial.println(DST);
};
delay(500);
};
}
// Convert time to array needet for display
void TimeToArray(){
int Now = GetTime(); // Get time
int cursor = 90; //116
Serial.print("Time is: ");
Serial.println(Now);
if (Dot){
leds[42]=ledColor;
leds[44]=ledColor;
leds[45]=ledColor;
leds[46]=ledColor;
leds[47]=ledColor;
//leds[48]=ledColor;
}
else {
leds[42]=0x000000;
leds[44]=0x000000;
leds[45]=0x000000;
leds[46]=0x000000;
leds[47]=0x000000;
//leds[48]=0x000000;
};
for(int i=1;i<=4;i++){
int digit = Now % 10; // get last digit in time
if (i==1){
cursor =69; //82
Serial.print("Digit 4 is : ");
Serial.print(digit);
Serial.print(", the array is : ");
for(int k=0; k<=20;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){
leds[cursor]=ledColor;
}
else if (digits[digit][k]==0){
leds[cursor]=0x000000;
};
cursor ++;
}; // fin for
Serial.println();
if (digit != last_digit)
{ fadefonction();
ledColor = ColorTable[random(16)];
}
last_digit = digit;
}// fin if
else if (i==2){
cursor =48;
Serial.print("Digit 3 is : ");
Serial.print(digit);
Serial.print(", the array is : ");
for(int k=0; k<=20;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){
leds[cursor]=ledColor;
}
else if (digits[digit][k]==0){
leds[cursor]=0x000000;
};
cursor ++;
};
Serial.println();
}
else if (i==3){
cursor =21;
Serial.print("Digit 2 is : ");
Serial.print(digit);
Serial.print(", the array is : ");
for(int k=0; k<=20;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){
leds[cursor]=ledColor;
}
else if (digits[digit][k]==0){
leds[cursor]=0x000000;
};
cursor ++;
};
Serial.println();
}
else if (i==4){
cursor =0;
Serial.print("Digit 1 is : ");
Serial.print(digit);
Serial.print(", the array is : ");
for(int k=0; k<=20;k++){
Serial.print(digits[digit][k]);
if (digits[digit][k]== 1){
leds[cursor]=ledColor;
}
else if (digits[digit][k]==0){
leds[cursor]=0x000000;
};
cursor ++;
};
// Serial.println();
};
Now /= 10;
};
};
void TimeAdjust(){
int buttonH = digitalRead(5);
int buttonM = digitalRead(4);
if (buttonH == LOW || buttonM == LOW){
delay(500);
tmElements_t Now;
RTC.read(Now);
int hour=Now.Hour;
int minutes=Now.Minute;
if (buttonH == LOW){
if (Now.Hour== 24){
Now.Hour=1;
}
else {
Now.Hour += 1;
};
}
else {
if (Now.Minute== 59){
Now.Minute=0;
}
else {
Now.Minute += 1;
};
};
RTC.write(Now);
}
}
void fadeall() {
for(int m = 0; m < NUM_LEDS; m++) {
leds[m].nscale8(250);
}
}
void fadefon);
}
// Now go in the other direction.
for(int i = (NUM_LEDS)-1; i >= 0;);
}
}
void loop() // Main loop
{
/*BrightnessCheck(); // Check brightness
DSTcheck(); // Check DST
TimeAdjust(); // Check to se if time is geting modified*/
TimeToArray(); // Get leds array with required configuration
FastLED.show(); // Display leds array
/*float t = RTC.temperature();
float celsius = t / 4.0;
Serial.println();
Serial.print("Temp is : ");
Serial.print(celsius);
Serial.println();*/
}
Thx for this nice project. I made also a pcb for it. I'm totally new with Arduino. Can someone tell me how I can change the color on different times. For example: 8 am red, 10 am green, 10.15 am red 12 am green, 1 pm red, ... I used the clock.ino file of the site.
Hello!! Someone have the corect code for this project, cause i get some error from this code. In principle the 'tmElements_t' was not declared.
Can anybody give me a solution? Thanks.
Did it a few weeks ago with 3 WS2812/segment and some 3D printing. Everything works but after some time, the clock just stop working (some lag at first then stucked)
https: //tr.aliexpress.com/item/1m-4m-5m-WS2812B-Sm ... acaba
hello, i interest with this project, but i use ws2812b for the segment, is anybody have a code, i try in saxos1983 github it's not available... i want 24 hours clock like onlynoise build.. thanks
error
error code please help.
sketch_mar31a.ino:1:23: fatal error: DS3232RTC.h: No such file or directory
compilation terminated.
my gmail. kedarp9697@gmail.com
bu projenizi çok beğendim. bende yapmak istiyorum .kodlamada sorun yaşıyorum. program derlemede hata gösteriyor. bana projenizin detaylarını yollarmısınız. teşekkür ederim. iyi çalışmalar. hcenqiz20@gmail.com
In English please, I can't understand where you need help....
with this product this project Can we work
We only want to use arduino and rtc in the circuit, and we want to show the time on the screen.
Could you help.
calisan kod var mi hocam sizde
Hi there, this is a cool project. I have already built the clock, but i'm having a problem with the code. When i try to compile it i get the error
exit status 1
'tmElements_t' was not declared in this scope
I have already fastled and DS3232RTC libraries.
Any idea? Thanks.
I am getting the same mistake, how did you solve
I added
#include
and the problem was solved .
Http: //urun.gittigidiyor.com/ev-bahce/5-metre-3-ci ...
tek renk şerit led kullanarak bu projeyi yapabilir miyiz
bu kodlar ile çalışır mı
I had to add
#include
Problem solved :). I had to add
#include <TimeLib.h>
Thankyou :)
Cool project! He decided to build this same! () Few had to rewrite the code, I have a number of LEDs in segments - more! It wanted to make it shows the date and temperature! I already have DHT11 module! Unfortunately, I do not know how to program the Arduino.
projeniz calisir durumda mi
kod ve devre semasini paylasir misiniz
I have made the same project, it is gr8 weekend project
yaptiginiz projeye ait devre semasi ve kodlari paylasir misiniz.
than you
good day sir! can i ask how you code this clock? i want to have a countdown timer similar to this display. can you help me how to program it? only 24 seconds for a shot clock. thanks.
Hello Friend! I also plan to assemble LED ws2812b, but none like can`t find a suitable sketch. Could you share your sketch?
Hello friend. share the sketch, too, wanta thermometer
Thank you. I did on the 2812b, 2 pieces per segment. The hardest part was cut out pattern ... and it's not a joke, too small partitions in numbers. Thanks again.
hey how do i add the temperature on the 7 digit display ?
i made the clock with the ws2811 led's.
Great build! I want build it but i want to edit a little. I want to make a stopwatch that can count until 99,99 seconds, please can you answer me to some questions ?
1. What more parts i need to make it work?
2. Can I add 3 buttons, Start,Stop and reset?
3 Can i use two stopwatches on one Arduino board and have there 4 buttons,Start, Stop 1, Stop 2 and reset?
Thank you in advantage
ps:I don't know nothing about Arduino, I am learning it now and i like it :)
ayuda me brindarías los archivos no soy premiun
metro es bryan_1300@hotmil.com
muchas gracias
In English, please.
I don't understand where you need help.
Hello, cool project. I was wondering if i can make the same with just a single color led strip instead of RGB?
If they are individually addressable then yes.
alguien que me heche una mano hace mucho tiempo que intente hacer este proyecto con ws2811 pero hice todo como el tuto dice y sismpre me sale error en la compilacion de arduiino,,simplemente no funciona,,alguien podria pasarme el codigo completo y correcto ,ya que tengo todo el material pero no me funcione,espero me ayuden porfavor que quiero hacer este reloj tambien
Would the code for this be available please it's great
Can this clock be modded to add seconds like 00:00:00?
thanks in advance ordering the parts now | http://www.instructables.com/id/Big-auto-dim-room-clock-using-arduino-and-WS2811/ | CC-MAIN-2017-47 | refinedweb | 3,043 | 66.84 |
Iam working on a program that can read XML files and will list
the information in a dataGrid.
It works like this:
I have a class : ListViewModel which contains the
data for the dataGrid in which format it can be displayed.
Then I got a Timer which will fire an event every second
to search for new lines in the XML file.
and at the end, i got a filter method which will filter the
information from the XML file before it will display on the dataGrid.
The thing is that I had a version where I used dataGrid.ItemsSource = filteredList;
But it bothered me that it flickered when a new items was added to the list.
So i heard about binding and the dataContext, maybe someone can explain
the correct use of Binding with DataContext?
I searched a while for what I was looking but i didnt found
an answer/explaination for me.
I think what you're after is a ListCollectionView - it's created off your list and that's what you bind to in the UI. And you then add filtering (or sorting) to it. Also useful for tracking changes to the current selection.
// create your list - this is where you add data var rawList = new ObservableCollection<SomeStuff>(); // get a view into your list - thisis what you bind to in the UI var publicViewThatYouBindTo = (ListCollectionView)CollectionViewSource.GetDefaultView(rawList); // and now you can filter on that publicViewThatYouBindTo.Filter = (o) => { return ((SomeStuff)o).SomeLogicToFilterBy(); };
Then you would do dataGrid.ItemSource = publicViewThatYouBindTo. | https://codedump.io/share/ZqcOeDWnjAe9/1/c-wpf-binding-poblem---datacontext-doesnt-work-as-thought | CC-MAIN-2017-13 | refinedweb | 252 | 72.26 |
Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
How to perform a relational division in a domain expression? left[] "is contained in" right[]
Due to the fact, that in the standard ORM expressions.py there is no operator for a relational division, I wonder how I can acomplish this or with a core hack, or with a custom code on a higher level. Case many2many (actually the one 2 many case works as - if I understand it right - it can be solved without a true division)
Please do not suggest the "in" operator as it is a chained in statment in the form (refer to expression.py arround line 967):
The intermediary table has the folowing form:
rel_id1 , rel_table, rel_id2
Then a first SQL executes:
SELECT rel_id1 FROM rel_table WHERE rel_id2 IN right[]
This is stored in a list2[] with then is passed into a substitution leaf like so: ('id', 'in', list2[])
This is then transforemd into something so that, it returns true whenever a a single value of a many2many field is within right[].
What is needed is a true relational division with an remainder, if cardinality is not equal. So that we can say in plain english semantics:
left[] "is contained in" right[] instead of "at least one of the items in" left[] "is contained in" right[] <=> left[] "in" right[]
Thank you!
GRAEME GELLATLY posted an answer on the communtiy maling list, which is a python workaround, so no raltional division is needed on the database level. It will be copied:
Sorry, I just can't understand why adding an ORM search operator is the right solution here given the difficulty of the underlying SQL and how simple it is to do in python/using ORM. Especially since this is hardly a major issue faced by lots of people. Then again I am more functional than technical. Why can't you just omit that part of the domain and test after using python's set operations? All the below is untested pseudocode with no exception catching but should give the idea. Again - not a techie, just how a functional person with a little bit of python would write it. I wouldn't mind betting this would be faster as well.
e.g.
In your function
right_set_of_ids = [n,n,n,...]
some_list_of_ids = self.search(...args)
# If you only want True results as a list - dict version
some_list_of_ids = [record_id for record_id, value in self.x2many_issubset(cr, uid, some_list_of_ids, 'x2m_field_name', right_set_of_ids, context=context).iteritems() if value]
# If you only want True results as a list - tuple version
some_list_of_ids = [record_id for record_id, value in self.x2many_issubset(cr, uid, some_list_of_ids, 'x2m_field_name', right_set_of_ids, context=context) if value]
then have
dict version - as everyone loves dicts[record.id] = left_ids.issubset(right_ids)
return res
tuple version.append((record.id, left_ids.issubset(right_ids))
return res
Then either assign the function at ORM level or within the object model itself
e.g
openerp.osv.orm.BaseModel.x2many_issubset = x2many_issubset
or just using normal _inherit(s) mechanism for object models.
extend it any way you want, you could add a top level function which takes an operator for example and dynamically calls the correct lower set operation, but that one function covers the use case as I understand. Should be quick, but one-liner versions below which for large lists of ids should be quite a bit quicker, tuple version quickest.
dict version
v2.6
def x2many_issubset(self, cr, uid, ids, field_name, right_ids, context=None):
right_ids = set(right_ids)
return dict([(rec.id, set([x2m.id for x2m in rec[field_name]]).issubset(right_ids) for rec in self.browse(cr, uid, ids, context=context)])
v2.7)}
tuple version)]
As far as I understand, you are looking for something like an 'all in' operator.
Maybe I'm confused but this should be achievable by using:
('!', 'left[]', 'not in', 'right[]')
Line of thoughts:
- 'in' performs elementwise test if left[] elements are in right[], and returns true if any element is in right[]:
left[1] in right[] OR ... OR left[n] in right[] => test_1 or test_2 or ... or test_n
- what you want is a similiar behavior, but it should only return true if all elements are in right[]:
left[1] in right[] AND ... AND left[n] in right[] => test_1 and test_2 and ... and test_n
- Unfortunately the 'in' operators are always 'or-connected'. So how to convert logical and to logical or?
Using De Morgans Law: (test_1 and test_2) = not(not(test_1) or not(test_))
Hope it helps a little.
EDIT:
Unfortunately the 'in' operators are always 'or-connected'.
This might not be true....
Maybe ('left[]', 'not in', 'right[]') is the same as (''!', 'left[]', 'in', 'right[]')
In that case, my solution would fail.
Regards.
About This Community
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
Extremely interessting question! Do you want to left[] to be contained in right[] in the exact order? What type of lists do you want to compare?
Servus! The order is not important in my case, however curiosity has the reputation of killing cats... In my search on relational division I however did not find any comments on ordering at first glance. I imagine however this is an even more cmplex task, as ordering information (if it should be significant added value) is not in the id itself, but in a sequence field. The Stackoverflow-Rerference post on this topic is:
And should left[] be containted consecutively in righ[]?
Type of List: Its a construction of a large domain statment for a .search() on some tax rules that aply in a given context. To be flexible, the tax properties have kind of meta classifieres and are applied (context aware, thanks to meta classifiers) onto several objects (product, company, partner) as many2many attributes. On runtime the attributes_all_ids is constructed (reverse context aware) to constitute the right-side list. If, now, the attributes (m2m) specified in a rule (left list) are a subset or equal to the right list, this domain statment should return true. In other words, this rule applies. The point is about the m2 side which in combination with the 2m side makes a relational division (with conditional remainder) required. m2m is used to maintain flexiblity end be able to reduce complexity through multidimensionality of attirbute-sets thanks to metha classifieres...
With this I negate your third question as well. Consecutively is not important. In subset theroy a subset or equal set should return true.
Additional referenc on the community mailing list: Actual Non-Working Code:
Rene, your reasoning is quite interesting. It sugest's to make use of this weirdness of in. It assumes that "! not in" (double negation) "in", the rational being, that "!" and "not" would not have the same effect. (As "in" does not what we would expect from english semantics I'm proned to believe that this is not a bad guess) The point might be the "not" rahter then the "!" part: "in" results true if there is a signle hit. So the problem is, what is "not"? Does "not" mean if there is not a "single hit" (eg. a duble hit)? I suppose "not" is not "not" here. And the semantics might be confused, as in the code, one can see, that the many2many case hasn't been thought trough thouroughly... On the other hand, I've seen a method in expressions.py which renders "!" to "not", if my above assumption is true (which would make your advise work in the first place) this would be a terrible violation of logical semantics. On the other henad, this method would make your advise not work, which would have worked in the first place.. Please correct me, I like those discussions ;) But they are on the edge of my usual brain usage.. ;)
"! not in" (double negation) "in" Here was an UNEQUAL SING which was absorbed by the page renderer like this: "! not in" (double negation) UNEQUAL SING "in" | https://www.odoo.com/forum/help-1/question/how-to-perform-a-relational-division-in-a-domain-expression-left-is-contained-in-right-55571 | CC-MAIN-2017-43 | refinedweb | 1,345 | 64.41 |
The of Rails, the respond_to block was introduced, which made serving up differerent data types, like XML or JSON really easy. All you needed to do was something like this:
def index @stories = Story.find :all respond to { |format| format.html {} format.xml { render :xml => @stories.to_xml } format.json { render :json => @stories.to_json } } end
Then, on the web browser, if you appended the file extension (eg /stories/index.xml) and you would get the content delivered in the requested format. You could even create your own custom types by adding MIME::Type.register to the bottom of your environment.rb file.
One of the problems with this approach though, was there was no way to serve up different HTML pages based on the file extension. Because of the way the MIME::Type parser worked, adding another content handler with a mime type of text/html clobbered the default handler which meant the above code would serve up the wrong view.
Enter Mime::Type.register_alias
Now you can tell Rails to respond with HTML to as many file types as you like! Say you are designing a mobile version and an iPhone version of your site, you can create two new formats by dropping the following code in to the new /config/initializers/mime_types.rb file:
Mime::Type.register_alias "text/html", :iphone Mime::Type.register_alias "text/html", :mobile
This makes the following possible:
def index @stories = Story.find :all respond to { |format| format.html {} format.xml { render :xml => @stories.to_xml } format.json { render :json => @stories.to_json } format.iphone { // Serve up the iPhone version } format.mobile { // Serve up the mobile version } } end
Of course, having to manually render a different version in every respond_to block isn’t very DRY, so a new naming convention has been created for all of the view files. Rather than calling the view file in the example above index.rhtml, you can create three different versions based on the format that you are serving up, eg: index.html.erb, index.iphone.erb and index.mobile.erb.
If rails finds a matching view it will serve that up, if not it will serve up the default .html.erb or .rhtml file. This makes serving up different versions of your site even easier.
October 26th, 2007 at 5:37 pm
I’m keen to check out 2.0RC… but I’m not interested in the preview.
Hmm.. wish there was a ballpark ETA.. i know its just around the corner!
October 30th, 2007 at 2:04 am
Unless DHH has taken up sewing, I think that the seed has been “sown.”
October 31st, 2007 at 8:27 am
right on brothers | http://www.sitepoint.com/blogs/2007/10/26/rails-20-features-multiple-views/ | crawl-002 | refinedweb | 442 | 67.45 |
How can i create a drop-down menu in Tkinter?
Make sure the data is presented to the OptionMenu() as a list that is unpacked with the * operator. Testprint choices and use *choices as an argument.
I think it's called an OptionMenu ...
''' tk_OptionMenu1.py using Tkinter's Optionmenu() as a combobox allows one item to be selected use a button to show selection ''' try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk def ok(): sf = "value is %s" % var.get() root.title(sf) root['bg'] = var.get() root = tk.Tk() # use width x height + x_offset + y_offset (no spaces!) root.geometry("%dx%d+%d+%d" % (330, 80, 200, 150)) root.title("tk.Optionmenu as combobox") var = tk.StringVar(root) # initial value var.set('red') choices = ['red', 'green', 'blue', 'yellow','white'] option = tk.OptionMenu(root, var, *choices) option.pack(side='left', padx=10, pady=10) button = tk.Button(root, text="check value slected", command=ok) button.pack(side='left', padx=10, pady=10) root.mainloop()
Thank you @vegaseat.
@vegaseat, look at line 29 of your code please. As you typed on the code, we need to have line 29 in our file from the beginning of running the program.
I mean i want to use
load_choices for example instead of line 29. I want to load the choices list from a text file (my db file), and send it into() in lime 30.
What should i do?
No idea what your file looks like.
# let's assume your data is read from a file like this data = '''\ red green blue yellow white ''' choices = [color for color in data.split()] print(choices) ''' result ... ['red', 'green', 'blue', 'yellow', 'white'] '''
This a the first part of my code:
import os import pickle DBFILENAME = 'linknames.db' loaded = True choices = [] def pathtofile(filename = DBFILENAME): folder = os.path.dirname(os.path.abspath(__file__)) return os.path.join(folder, filename) def load_choices(): global choices, loaded if loaded: return filepath = pathtoile() if not os.path.isfile(filepath): with open(filepath, 'wb') as fout: pickle.dump([], fout) with open(filepath, 'rb') as fin: choices = pickle.load(fin) loaded = True def dump_choices(): filepath = pathtofile() with open(filepath, 'wb') as fout: pickle.dump(choices, fout) import sqlite3 as db conn = db.connect('linkuserpass.db') cursor = conn.cursor() cursor.execute('CREATE TABLE IF NOT EXISTS linkuserpass(mylink TEXT, myusername TEXT, mypassword TEXT)') print ('table is created') conn.commit() cursor.close() conn.close() def add(): import sqlite3 as db link = ent1.get() user = ent2.get() password = ent3.get() conn = db.connect('linkuserpass.db') cursor = conn.cursor() cursor.execute('INSERT INTO linkuserpass(mylink, myusername, mypassword) VALUES(?,?,?)', (link, user, password)) print ('Done!') conn.commit() cursor.close() conn.close() load_choices() choices.append(ent1.get()) dump_choices() def show(): import sqlite3 as db key_link = var.get() conn = db.connect('linkuserpass.db') conn.row_factory = db.Row cursor = conn.cursor() cursor.execute('SELECT * FROM linkuserpass WHERE mylink=(?)' , (key_link,)) row = cursor.fetchone() data_str1 = "" data_str2 = "" data_str1 = (row['myusername']) data_str2 = (row['mypassword']) print data_str1 print data_str2 userlabel['text'] = 'username: ' + data_str1 passwordlabel['text'] = data_str2 conn.commit() cursor.close() conn.close()
And the rest is the Tkinter code part. Look at this please:
var = StringVar(root) var.set('') load_choices() option = OptionMenu(root, var, choices) option.pack() btn2 = Button(frame5, text = 'show', command = show) btn2.pack(side = 'left')
With
load_choices that i have typed, when i run the program, no value will be shown on the option menue, its empty.
What should i do?
Make sure the data is presented to the OptionMenu() as a list that is unpacked with the * operator. Testprint choices and use *choices as an argument. ... | https://www.daniweb.com/programming/software-development/threads/491734/drop-down-menu-in-tkinter | CC-MAIN-2017-09 | refinedweb | 597 | 54.39 |
Hi,
I'm trying to write a console app that will take in a base 10 number and output that number in binary form. I created a character array for the binary number and a couple of for loops (one to mod the number and divide. One to print the contents of the array.) but, I must have the syntax of something incorrect. I have looked at the code for a couple hours though and cannot figure out the issue. It seems to me when I run the app like the for loops are not even running. Anyways tia for any help.
Code:#include <iostream> #include <stdlib.h> using namespace std; int main(void) { int num = 0; int i = 0; //array to store the binary digits. all values are initialized to 0. int binary[8] = {0}; cout << "Please enter a base10 number between 0 and 255:" << endl; cin >> num; //loop from 7 to 0 modding the number by 2 and then dividing it in half. for (i = 7; i < 0; i--) { binary[i] = (num % 2); num = num / 2; } cout << "Your number is:" << endl; //loop through the binary array printing each digit. for (i = 0; i > 7; i++) { cout << binary[i]; } cout << endl; return 0; } | http://cboard.cprogramming.com/cplusplus-programming/47212-having-some-newb-troubles.html | CC-MAIN-2015-32 | refinedweb | 204 | 81.43 |
closelog, openlog, setlogmask, syslog - control system log
[XSI]
#include <syslog.h>#include :
- LOG_EMERG
- A panic condition.
- LOG_ALERT
- A condition that should be corrected immediately, such as a corrupted system database.
- LOG_CRIT
- Critical conditions, such as hard device errors.
- LOG_ERR
- Errors.
- LOG_WARNING
-
Warning messages.
- LOG_NOTICE
- Conditions that are not error conditions, but that may require special handling.
- LOG_INFO
- Informational messages.
- LOG_DEBUG
- Messages that contain information normally of use only when debugging a program.
The facility indicates the application or system component generating the message. Possible facility values include:
- LOG_USER
- Messages generated by arbitrary processes. This is the default facility identifier if none is specified.
-:
- LOG_PID
- Log the process ID with each message. This is useful for identifying specific processes.
- LOG_CONS
- Write messages to the system console if they cannot be sent to the logging facility. The syslog() function ensures that the process does not acquire the console as a controlling terminal in the process of writing the message.
- LOG_NDELAY
- Open the connection to the logging facility immediately. Normally the open is delayed until the first message is logged. This is useful for programs that need to manage the order in which file descriptors are allocated.
- LOG_ODELAY
- Delay open until syslog() is called.
- LOG_NOWAIT
- Do not wait for child processes that may have been created during the course of logging the message..);
None.
None.
None.
fprintf
XBD <syslog.h>
First released in Issue 4, Version 2.
Moved from X/OPEN UNIX extension to BASE.
IEEE Std 1003.1-2001/Cor 1-2002, item XSH/TC1/D6/13 is applied, correcting the EXAMPLES section.
return to top of pagereturn to top of page | http://pubs.opengroup.org/onlinepubs/9699919799/functions/closelog.html | CC-MAIN-2013-20 | refinedweb | 270 | 52.87 |
#include <Xm/ComboBox.h>
XmComboBox combines the capabilities of a single-line TextField widget and a List widget. It allows users to perform opoerations like typing and pasting information, and it also provides a list of possible choices that the user can select from to complete the TextField entry field. The list can either be displayed at all times or can be dropped down by the user. When the list portion of the ComboBox is hidden, users are given a visual cue (a downward-pointing arrow) next to the TextField field. The position of the arrow relative to the TextField field depends on the XmNlayoutDirection resource of the widget. This version of the ComboBox is called the "drop-down" ComboBox. Drop-down ComboBoxes are useful when screen space is limited, or when users will complete the text entry field more often by typing text than by selecting the entry field text from the list. The user can access the drop-down ComboBox in either one of two ways:
The application provides an array of strings that fill the list. At creation time, string items can be passed to the ComboBox via an arglist. Each string becomes an item in the list, with the first string becoming the item in position 1, the second string becoming the item in position 2, and so on. The size of the list is set by specifying the number of items that are visible in the list (XmNvisibleItemCount). If the number of items in the list exceeds the number of items that are visible, a vertical scroll bar will automatically appear that allows the user to scroll through a large number of items.
ComboBox creates two child widgets: a TextField widget for entering text and a ScrolledWindow containing a List for the list of items. The name of the items list itself is List, and the name of the TextField is Text. The application or user can specify resource values for these widgets in a resource file, and the application can use XtNameToWidget (specifying "*List" for the items list or "*Text" for the TextField widget) to obtain the widget IDs of the descendant widgets. At creation time, ComboBox passes appropriate resource values in the creation arglist, including XmNitems, to the items list. Note that the result of providing the XmNdestroyCallback resource in the creation arglist is unspecified. The application should use the XtAddCallback function to add callbacks to the appropriate widget (TextField or List) after creating it.
ComboBox forces the following resource values on its List child:
When XmNcomboBoxType is XmDROP_DOWN_LIST, ComboBox forces the following resource values on its TextField child:
By contrast, when XmNcomboBoxType is XmCOMBO_BOX or XmDROP_DOWN_COMBO_BOX, ComboBox forces the following resource values on its TextField child:
ComboBox always forces the values of the following resources on the TextField:
ComboBox allows a single item to be selected in two ways: by selecting the desired item from the List or by entering text into the TextField. ComboBox does not automatically select a list item if the user types that string into the TextField. It selects the item when the user presses KActivate or moves the focus. ComboBox supports the Browse Select selection model of List (see the XmList reference page for a description of this model), so selections are mutually exclusive. Selecting an item from the list causes that item to be displayed in the TextField portion of the ComboBox. If an application sets the XmNvalue resource of TextField, that string is shown in the TextField. If the application has not provided any list items, or if there is no current selection, the TextField is empty.
The TextField in the ComboBox widget can be either editable or noneditable, depending on the value of the XmNcomboBoxType resource.
If the TextField is editable, the user can type into it. When the user presses the Return key, the ComboBox will compare the typed entry to the items in the List. If there is an exact match, then the matched List item is selected. If the application wishes to validate the entered text (for example, to ensure that the typed selection is a valid one), it can do so by setting XmNmodifyVerifyCallback on the TextField widget.
If the TextField is noneditable, typing text may invoke a matching algorithm that will attempt to match the entered text with items in the list. The specific matching algorithm applied, which may be none, is determined by the value of the XmNmatchBehavior resource in ComboBox, which can be either XmNONE or XmQUICK_NAVIGATE. A value of XmNONE indicates that no matching algorithm will occur. A value of XmQUICK_NAVIGATE indicates that when the List widget has focus, one-character navigation is supported. In this algorithm, if the typed character is the initial character of some item in the List, this algorithm causes that item to be navigated to and selected, and the item is displayed in the TextField. Subsequently typing the same character will cycle among the items with the same first character.
Regardless of the selection mechanism used (either selected directly from the List or typed into the TextField), when an item in the List is selected, that item is highlighted in the List. In addition, the selected item is displayed in the TextField of the ComboBox. If the user performs an action that would move focus away from ComboBox, or selects a List item, the XmNselectionCallback callbacks are invoked to notify the application of the current contents of the TextField (or choice). The application then takes whatever action is required based on those contents (or choice).
ComboBox uses the XmQTspecifyRenderTable trait and holds the XmQTaccessTextual trait.
XmComboBox inherits behavior, resources, and traits from Core, Composite, and XmManager classes.
The class pointer is xmComboBoxWidgetClass.
The class name is XmComboB).
ComboBox inherits behavior and resources from superclasses described in the following tables. For a complete description of each resource, refer to the reference page for that superclass.
A pointer to the following structure is passed to each callback. The callback structure is defined as follows:
typedef struct { int reason; XEvent *event; XmString item_or_text; int item_position; } XmComboBoxCallbackStruct;
The ComboBox translations are listed below. KPageUp and KPageDown translations do not take effect unless the List child widget is posted.
The following lists the List translations in the drop-down list. When ComboBox XmNcomboBoxType is XmDROP_DOWN_LIST, <osfActivate>, <osfCancel>, and Return are overriden by ComboBox actions.
The following accelerators are added to ComboBox and its children. The accelerators may not directly correspond to a translation table. If the translation is not listed below, it may depend on the context of the event.
A drop-down ComboBox also adds accelerators to its List child. Aside from the accelerators that are already listed in this section, those accelerators are the default TextField key translations.
The XmComboBox action routines are as follows:
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3).
The toolkit will display a warning if the application tries to set the value of XmNlist or the XmNtextField resource, which are read-only (marked G in the resource table).
Composite(3), Core(3), XmCreateComboBox(3), XmList(3), XmManager(3), XmTextField(3), XmVaCreateComboBox(3), and XmVaCreateManagedComboBox(3). | http://www.makelinux.net/man/3/X/XmComboBox | CC-MAIN-2014-42 | refinedweb | 1,198 | 51.58 |
User talk:Bradaphraser/archive6
From Uncyclopedia, the content-free encyclopedia
Make a separate header for each topic, as always. archive1 archive2 archive3 archive4 archive5
(If you miss something, it's probably archived)
UN:AUDIO
Brigadier Sir Mordillo
GUN UotY WotM FP UotM AotM MI3 AnotM VFH +S 10:09, 29 January 2007 (UTC)
Intelligent design
Am I allowed to nominate the article again, so soon after it has been removed? Weri long wang 02:15, 26 December 2006 (UTC)
- Yes, you may. There only penalty for this is that the voters may hold it against you somehow. The is no rule against renomming.--<<
>> 02:49, 26 December 2006 (UTC)
so nearly not late
Happy late Xmas, thanks for what you)}" /> - 16:30, 26 December 2006 (UTC)
- You are very welcome. I stole the idea from It's a Wonderful Life ( ;) ) but it's a good one.--<<
>> 18:08, 26 December 2006 (UTC)
Worst_100_Reflections_on_2006
What about the confusion between Brad, Brayd, and bard? —Braydie at 23:27, 28 December 2006 (UTC)
- Feel free to add it. I just put that whores thing in there to make up the difference in case we don't fill it up all the way.--<<
>> 23:31, 28 December 2006 (UTC)
Oi you!
Some kind person renomms Wicker Man like an hour ago, and you nuke it with +3 votes? Have I got to come round there? Well? I know where your house lives... --. /me walks out, looking really cool. —Braydie at 00:22, 30 December 2006 (UTC)
Another PLS
The Main Page suggests that you're running another PLS. If we're still doing amazon gift certificates, I'd be willing to toss $10 in to the cause. Also, if you need judges, I'd like to throw myself in as a candidate if you need any more. --Sir gwax (talk) 05:18, 30 December 2006 (UTC)
- Thanks for the offer gwax. We actually aren't hurting for money, as Wikia is taking care of that aspect of it. I have the judges lined up, too, but... well... according to some previous runners of the show, people have been known to pull out without warning at the last minute. I'll DEFINATELY keep you in mind in case that happens. Thanks a bundle for the generous offers of help, but I've got it under control for now. Maybe. I hope. /me crosses fingers.--<<
>> 08:49, 30 December 2006 (UTC)
- Ok, if you do need me, drop me a note on my talk page; I try to check there at least once every day or two. Also, if you do anymore, let me know. --Sir gwax (talk) 08:37, 31 December 2006 (UTC)
The amazing new and exciting VFH
My comment on Forum:8-ish_reflections_needed_for_Worst_100_Reflections_on_2006 was because of that link I provided...which lead me to realize that on the new faster VFH half of my own humble features wouldn't pass, as they were a vote for every once in awhile, just often enough to not get culled as stagnated and enough to eventually make feature (they were during the summer slow period, so I may be reading more into this than there is). I can only speak from my own experience, but I found that to be disquieting; however, if I'm the only person in this metaphorical boat, then it's not worth kvetching over. On the plus side, it lead me to go back and reread them and they hold up fairly well. But then I'm biased.--Sir Modusoperandi Boinc! 23:08, 30 December 2006 (UTC)
- Heh, I've found that all of my articles are works of art as well. ;) Since traffic ebbs and flows, the only way I know of to judge the articles is how they're doing vs articles from the same time, or judging, as objectively as possible "how popular is the article?" (VFH is, after all, just one big popularity contest for articles). If a whole bunch of articles are voted on at once and one is doing worse compared to the others than any other article on the page, it's safe to assume that article is a weaker article (at least, I hope it is, because that's what I've been doing). I'm more than willing to listen to other methods of judging (though I strive to keep it as structured as possible in the dynamic world of VFH).--<<
>> 23:51, 30 December 2006 (UTC)
New year
I WAS HERE -kjhf!- 20:56, 1 January 2007 (UTC)
HowTo:Convince People You're a Heterosexual Male
Thanks for your vote!
Gestures
I'll put some together for you soon. - Lemon. 00:15, 4 January 2007 (UTC)
Third Epistle to the Thessalonians
The article on the front page links to the UnBook, not the article. Not that I'm complaining, but y'know, I did write the article . . .--Procopius 15:43, 4 January 2007 (UTC)
- Hmm... yeah, I think I'll go fix this now...--<<
>> 15:44, 4 January 2007 (UTC)
Thanks for the Shower
I humbly accept the Urine Ninjastar, Brad. I'll continue to do what I can for Pee but I can't in good conscience sign up on the Urinizor Squad after all. Recently developing family pressures makes it likely I'll have to neglect Uncyc for days or weeks at a time over the next several months. But it is a worthy effort, and you personally have shouldered the burden like a veritable Atlas of Pee. Kudos to you, Sir. ----OEJ 17:03, 5 January 2007 (UTC)
Arsemas Card
Feature for 11th January
No-one else was around and the article was getting not so fresh, so I put another one up. I put Wicker Man up because it was supposed to be the one for the 10th ... this is probably wrong and evil, but makes the universe seem just that little bit more heartless and random. I hope I didn't fuck anything up - David Gerard 01:12, 11 January 2007 (UTC)
PLS
Isn't this what {{WC}} is for? • Spang • ☃ • talk • 00:29, 14 Jan 2007
- Hmm... I didn't realize that was a template (since it's only used on one page, that seems a bit silly to me). Do you think we need to change it?--<<
>> 00:53, 14 January 2007 (UTC)
- Nah, doesn't really matter :) Although when it's on a template, there's no need to go back through the main page's history to find the code from the last one.
- I only pointed it out because it's already linked on the front page, just commented out, and might have been easier for you to edit the already existing one. Didn't occur to me at the time that seeing as you'd already done it, this was a bit pointless! • Spang • ☃ • talk • 01:02, 14 Jan 2007
- Well, I've read the rules and seems that I've missed something between the jokes. Maybe they could be expressed better, but no problemo. Another subject, I've noticed you are using the Golden Shower Award. Should we make it official, pasting it in the main space? -- herr doktor needsAscalpel [scream!] 00:23, 18 January 2007 (UTC)
- Sorry about the mixup. I'd appreciate help in making the rules more clear. Also, I'd love the Golden Shower to be in official space! :)--<<
>> 00:42, 18 January 2007 (UTC)
- Hi, chap, it's me again. So, after almost one month of silly celebration I'll finally put my lazy ass to work again and start a new article. It's a howto and guess I'll start it today or tomorrow. Will it be elligible for the PLS? -- herr doktor needsAscalpel [scream!] 20:57, 22 January 2007 (UTC)
Hey, the Image judging is done, and we have a winner already. The rest of ya'll need to get off your assets. =P R 13:51, 29 January 2007 (UTC)
NFL
Thanks for the kind words on the New England Patriots article (and now I'm a Colts fan). You weren't kidding about the NFL page; I'll work on it on and off. I did revise the Steelers' entry, though I readily admit it may have some of my fan's fingerprints over it.--Procopius 14:17, 15 January 2007 (UTC)
- Heh, awesome. I'm kind of wanting to make the whole page in somewhat of the format of the NFC North articles, where it mocks the great history/players/coaches of each team and mentions the current players near the end (this will be easier to maintain year-to-year).--<<
>> 14:19, 15 January 2007 (UTC)
- I should mention, however, that anything you do with the page will be better than it is now, so if you just rewrite it in general, I'll love you, whether or not you take it in the direction I was thinking.--<<
>> 14:20, 15 January 2007 (UTC)
Thanks for peeing
Thanks for taking the time to Pee Review my UnNews article. That was precisely the kind of feedback I was looking for with regards to my typical UnNews articles. Thanks for the effort. --Composure1 02:00, 16 January 2007 (UTC)
Rookie Mistake
Hello friend! Can you please transfer my transcendent article about honey to my userspace? Pretty please?--Auvrey 03:51, 18 January 2007 (UTC)
- You can move Honey to your namespace by clicking the "move" at the top of the page. I've checked the history, and you should be good to move it yourself. Also, due to the conversation we had, I changed the PLS page so everyone can edit it (since you were having trouble with that page before). Hope that helps.--<<
>> 04:20, 18 January 2007 (UTC)
Testing
Hmm... I think I see a problem with my sig already...--<<
>> 21:36, 19 January 2007 (UTC)
- Test again... 3, 2, 1...--<<
>> 01:04, 20 January 2007 (UTC)
- I call upon the powers of Cthulhu!--<<
>> 01:10, 20 January 2007 (UTC)
- How about now?--<<
>> 01:12, 20 January 2007 (UTC)
- By the power of greyskull...--<<
>> 01:15, 20 January 2007 (UTC)
- TALKPAGE SPAM!--<<
>> 01:17, 20 January 2007 (UTC)
- Don't make me come over there... why aren't you working?--<<
>> 01:20, 20 January 2007 (UTC)
- I win! • Spang • ☃ • talk • 01:22, 20 Jan 2007
- Wow, thanks Spang. You're like the Spiderman of Uncyclopedia!--<<
>> 01:24, 20 January 2007 (UTC)
- Admin Spang, Admin Spang, does whatever an sysop can!
- And the lesson we learned here today, for anyone who is interested, is that when a template is included on an indent (e.g.
:Blah blah {{User:Bradaphraser/sig}}), any line breaks within the template are forced onto new lines themselves. • Spang • ☃ • talk • 01:39, 20 Jan 2007
+S
—Braydie at 23:57, 21 January 2007 (UTC)
Thanks
Hey- Thanks for understanding my issue with the seasonal timing issue on the Christmas shopping thing. Hugs, Dame
GUN PotY WotM 2xPotM 17xVFH VFP Poo PMS •YAP• 02:44, 29 January 2007 (UTC)
WOTM
Thank you.--Sir Modusoperandi Boinc! 08:51, 1 February 2007 (UTC)
- You're welcome. Thanks again for judging PLS so quickly.--<<
>> 12:30, 1 February 2007 (UTC)
- As long as I judged it, um, rightly.--Sir Modusoperandi Boinc! 14:08, 1 February 2007 (UTC)
- I personally don't think you did. Also, you, as unbiased as I'm sure Mhaille is, I'm afraid I disagree with him. You did a great job judging, Modus.--<<
>> 14:23, 1 February 2007 (UTC)
- Ooooooh no he didn)
- /me pats Mhaille on back. There there. There there.--Sir Modusoperandi Boinc! 21:21, 1 February 2007 (UTC)
UotM
Also, thanks for nomming me :) —Braydie at 15:09, 2 February 2007 (UTC)
Babel:Spb
Don't you think this years' Superbowl reskin should have it's own page, rather than overwriting the old one? ---Rev. Isra (talk) 04:19, 4 February 2007 (UTC)
- I overwrote the old one just to make it easier to move for the day in question. I plan on reverting it back to the old one and using the one at User:Bradaphraser/SupperBowl for records.--<<
>> 04:22, 4 February 2007 (UTC)
Thanks
...for helping me put all the "u"s in England. --Emmzee 05:13, 4 February 2007 (UTC)
Pee Review
I thought that this was pretty funny, so I saved it. (You can get rid if you want) —Braydie at 00:15, 5 February 2007 (UTC)
Stan Comics
I'm doing my good deed for the day and replacing your title with what you should have had there in the first place. Luckily, this article doesn't exist, so it's an easy review.--<<
>> 03:08, 5 January 2007 (UTC)
Give a poop
Hello! Thank you for giving Poop a Pee Review. Anyway, I have one or two issues with your review and am hoping you might see your way to listening to them. In order of the Pee Review:
1) Scat stuff. Fair enough. Though, in the article's defence, it uses the scatological references lightly (Esp. when compared to, say, Poop Cuisine!) As such, it's not that scatty, IMHO.
2) If you think it's less funny than Poop Cuisine, fine. I have no problem with your opinion, and you've been doing this Uncyc thing a lot longer than I. Saying it READS like that article...I don't see it. That's a food article, this one is a band/music article.
3) Lists. Sir Todd warned me about that. I'll clean that up pronto...though it's part of the long-lived, washed-up band joke, again IMHO.
4) Images - thank you! I like them also, though I don't see a single one on Poop Cuisine that matches any on Poop. See #2.
5) Fair enough, and thank you for your opinion. I wasn't looking to add to the scat lore, I was looking to create a long-lived band and run jokes around them.
- Check the date of the pee review. My review came before the article you created existed. (Jan 6)--<<
>> 02:11, 8 February 2007 (UTC)
- Also, sign your posts please, smart guy. ;)--<<
>> 02:14, 8 February 2007 (UTC)
- Crazy! How does that happen? The Pee Review just showed up today... Ok, my bad. I hope that when & if the new Poop article gets Pee reviewed, it does better than that! I won't change a thing unless I feel like it. :-) Smrt-guy 02:30, 8 February 2007 (UTC)
- Well, it turns out that articles are submitted to pee review by the authors that wrote them, and they aren't moved to the page's talkpage until one month after the review (so give another user a chance to review them, if they wish). Notably, anyone that thinks they understand what it takes to get featured at Uncyclopedia can review an article, and we're always looking for more reviewers. So feel free to post anything at pee review you want, and review someone else's article, too, while you're at it. ;)--<<
>> 02:36, 8 February 2007 (UTC)
- I did as you suggested, and got a great Pee Review! Thanks for the suggestion. Now, I'm sticking my head firmly into the giant smashing machine by nominating Poop for VFH. When you have some time, I'd like to get your vote (preferrably for, but a constructive against is ok as well) for it. Thanks! Smrt-guy 19:53, 15 February 2007 (UTC)
poo lit noms
I'm just a bit curious as to why you disqualified my n00b nomination. It said, "Was in original namespace," what does that mean? --AmericanBastard 22:13, 11 February 2007 (UTC)
- The article was on Uncyclopedia before the competition began, so it was disqualified, as that was against the rules. The rules were posted in terms that most people agreed were very clear, and were only removed Yesterday, which is why I find it odd that you're asking this now, of all times. The rules can still be found in the history.--<<
>> 22:20, 11 February 2007 (UTC)
- Shite, my dumb ass thought it was for users and articles created after Nov 2006. Sorry for bothering you. --AmericanBastard 08:19, 12 February 2007 (UTC)
Dyselixa
you didn't typo the references or text under pictures. I think I had an idea for what to do, although it might piss people)}" /> - 15:28, 13 February 2007 (UTC)
- Yeah, I wasn't sure I wanted to change that part. Does it look too out of place having them not typoed?--<<
>> 20:52, 13 February 2007 (UTC)
- a little out of place yeah, not horribly. i couold do it myslef but i thought i'd let you, since you did the rest of the)}" /> - 11:48, 14 February 2007 (UTC)
- Heh, ok, I'll work on the picture section. The reference section, I may just change the title though, as big words lose legibility if you misspell them more easily than familiar words.--<<
>> 12:38, 14 February 2007 (UTC)
Congratulations!
You are the recipient of the Mhaille Award For Excellence for the month of February 2007.
I know its not "up there" with the great awards of Uncyclopedia, but its a way for me to show my own support and appreciation for what people are doing out there to make this place better. Your continued level of commitment in that regard is, I feel, to be commended, and that you do it with an even hand and good heart makes you all the more, Mhaille. I'd give you a Mhaille Award for Excellence, too, except that apparently I'm not allowed to give those out. But, of course, you already won UotY, so you don't need any more damn awards, do you? ;) (Seriously, though, I do appreciate the kind words.)--<<
>> 22:24, 16 February 2007 (UTC)
I suck
I am the suckiest suck ever and lost connectivity just in time not to judge the PLS.
I go now to fall on my sword.
AIEEE! IT IS OFFLINE!
- And in fact I suck so much that I forgot to log in to say how much I suck. Suck! - David Gerard 11:59, 18 February 2007 (UTC)
- Heh, no worries. I had a backup plan, so everything went as planned. I had expected, with how busy several of the people I'd asked to judge were, that someone wouldn't be able to judge, so no harm done. I'm glad to see you're back online. Out of curiosity, what internet provider do you have? (I'll add them to my "bad" list. >))--<<
>> 12:39, 18 February 2007 (UTC)
- Also, dogs ate his homework. A wild pack of them. Big ones. With many teeth. It was terrible. --)
- Cats, actually - David Gerard 18:02, 19 February 2007 (UTC)
- Zen, who are really good. But all DSL provisioning is done by BT, who suckethest mightily - David Gerard 18:02, 19 February 2007 (UTC)
Wot.
I don't come here anymore, Brad. Continue on your quest to spill funny all over the world, 'cause you're good at that and thatnks for remembering me. --Boy Toy bitch at me 20:22, 5 March 2007 (UTC)
- No prob (I assume this is because of the Christmas Card from three months ago). I do get nostalgic from time to time, you know? :)--<<
>> 20:53, 5 March 2007 (UTC)
Darwin Rule
More just curiosity. What is the meaning of the "Levels" you put at the summary of de-VFDed articles? Ex.: "Darwin Rule, Level 9". -- herr doktor needsAscalpel [scream!] 19:31, 7 March 2007 (UTC)
- Levels explain how far something is is from the nearest score above or below. If there is a +10 above and a +7 below, a +5 article would be removed at level 2, for example, instead of level 5. I try to remove the highest level first. I pull the newest article with the same highest Darwin level (since it is assumed more votes will come the longer something is on the page, something losing early is worse than losing late, so to speak. Anywhere, there you go.--<<
>> 19:40, 7 March 2007 (UTC)
Thank you!
This is *your* fault
Hey Brad, here's the rough content...any thoughts?--Shandon 11:22, 9 March 2007 (UTC)
- You asked for thoughts, so here are some.
- It's a little long for one sitting. I don't know how you'll fix this, but I do know the longer it is, the more it has to be absolutely hilarious/brilliant to keep your audience's attention.
- Piglet should stutter more. Maybe have him stutter every time he says a curse word. While that lowers the "edginess" of the character in this context, that's sorta the idea of putting him in as verbal.
- I personally think "bear shit" would be a funnier thing to call pooh than "nigger bear," but that's up to you.
- It's not a bad start, but it definitely needs some more work still.--<<
>> 13:37, 9 March 2007 (UTC)
Thanks!
--El Zoof 10:22, 10 March 2007 (UTC) 01:55, 15 March 2007 (UTC)
Your comment on the obscenity topic
You presented a well-reasoned and very civilized response to my silly cavilling about the definition of obscenity, and I wanted to compliment you on it. Then I got distracted, the forum topic moved on, and so forth. But as no good deed should go unpunished I'll present you with a silly template:
--OEJ 02:05, 24 March 2007 (UTC)
Wa-hey! Free Food!
RabbiTechno 11:35, 29 March 2007 (UTC)
- Why thanks! I eat bagels with schmear ever day. (I hope I spelled that right. I mean cream cheese, not that medical procedure that they do on women.)<<
>> 12:47, 29 March 2007 (UTC) | http://uncyclopedia.wikia.com/wiki/User_talk:Bradaphraser/archive6?oldid=1753944 | CC-MAIN-2013-48 | refinedweb | 3,654 | 81.73 |
RealWorldWPDev Part 4: The Panorama
The windows phone panorama
Many apps lend themselves nicely to a Windows Phone Panorama. CTA Watch looks similar but it’s actually a Pivot with a background image. After going back and forth for a bit with Real-world Stocks I decided that the panorama looked pretty nice and went with it.
Thanks again @Templarian for the background! Be sure to hit him up if you’re in need of a great designer who actually gets metro!
This post is going to cover a lot of topics so I will do my best to whet your appetite, but please be sure to Download the Code and check out the app for yourself! The code should be pretty easy to follow as you get more familiar with how Caliburn does things.
What helps make a great experience?
- Lazy load sections after the user has swiped to them
- Panorama animations take ~0.5 seconds; don’t run your code until the animation is finished to prevent stuttering
- Show a nice BusyIndictator with friendly messages for each panorama section
- Customize the app bar buttons depending on which panorama section is active
- The News section show time relative dates (just now, 2 hours ago, etc)
Disclaimer
This entire series assumes a basic understanding of Silverlight and MVVM. If you aren’t familiar with these topics then I am hopeful that you can still follow along, but you may need to do some further reading outside of this to cover the fundamentals and framework primitives. That said, the following post is going to remain fairly high level and try to let the source code speak for itself. I am intentionally not going to deep-dive into topics that are covered elsewhere.
Documentation
Caliburn.Micro has great documentation. Check out the following links if you’re looking to deep dive into anything covered here.
Caliburn.Micro Documentation
Working with Windows Phone 7
MVVM Recap
MVVM is covered everywhere, so all I will say about here is the following – it stands for Model-View-ViewModel.
- ViewModels are just regular classes. In Caliburn many of them inherit from Screen. They provide the logic for your View, including what data should be displayed, and what code should execute when actions are taken on the view (like Button clicks)
- Views are your standard XAML artifacts, like Pages and UserControls. In MVVM they rely heavily on the rich Binding support in XAML/Silverlight to interact with the ViewModel that it is bound to.
- Model is everything else.
The Anatomy of the HomeViewModel
Now then, the HomeViewModel is a great starting point. At the time of the writing you can see the full HomeViewModel source. It’s actually a pretty simple class for doing a whole lot of stuff for us. Let’s dissect this bad boy.
public class HomeViewModel : Conductor<IScreen>.Collection.OneActive, IRefreshable, IAppBarController { private readonly INavigationService _navigation; public HomeViewModel(INavigationService navigation, HomeWatchListViewModel watchList, HomeNewsViewModel news, HomeQuoteViewModel quote) { _navigation = navigation; Items.Add(watchList); Items.Add(news); Items.Add(quote); } }
Conductor
A Panorama is normally comprised of 3-4 individual panes. Most of the time these panes are completely isolated and have nothing to do with each other; aside from being housed within the same container. If you actually think about it like that, then you can come up with some highly maintainable and extensible designs.
Rather than creating one giant HomeViewModel that is responsible for controlling every single out of those panes, let’s instead give our HomeViewModel the responsibility it deserves: conducting each of these panes.
You’ll notice that HomeViewModel inherits from Conductor<IScreen>. This provides some great infrastructure for us right out of the box. First up, it exposes a property from the base class of time IObservableCollectio<IScreen> called Items. In the code above, we are using this Items collection to add our Children View Models. It also handled Activation of our child items, telling them what to Initialize themselves – this lends itself amazingly to lazy loading the panorama panes, discussed at the end of this post.
How is this used in HomeView.xaml?
So we have a HomeViewModel, with an Items property that now contains 3 other ViewModels. How exactly is this used in our view? In 2 ways:
- The Panorama control inherits from ItemsControl, which means it supports binding to collections just like a ListBox does. In the end, since our “Items” are just ViewModels themselves, they are in turn rendered as Views in the Panorama. This concept is the basis of known as building Composite Views.
- No ItemsSource=”{Binding Items}”?? You may notice there is no explicit binding in the XAML below – Caliburn is a Convention over Configuration framework (if you want it to be!). This means it will by default use its x:Name and look for a property on the ViewModel that it can bind itself to. If you prefer to explicitly bind your Views then please do so! The conventions are entirely optional.
<controls:Panorama x: <controls:Panorama.HeaderTemplate> <DataTemplate> <TextBlock Text="{Binding DisplayName}" /> </DataTemplate> </controls:Panorama.HeaderTemplate> </controls:Panorama>
IOC / Constructor Injection
Now you might be wondering, in the HomeView I just created a constructor that takes 4 parameters, INavigationService, HomeWatchListViewModel, HomeNewsViewModel, and HomeQuotesViewModel.
When our HomeView.xaml is loaded, what is creating our HomeViewModel for us, and more importantly, how did it know how to pass these parameters to our constructor?
This concept is known as Inversion of Control. Our HomeViewModel relies on other classes to complete it’s job, but rather than being responsible for creating these dependencies itself, it externalizes that responsibility and simply declares ‘hey, I need these things! Framework, you give them to me!’
When you create new ViewModels and other services, you just need to register them in your AppBootstrapper. A snippet can be seen below. Once these ViewModels are registered in the Bootstrapper, Caliburn will take care of the rest.
public class AppBootstrapper : PhoneBootstrapper { private PhoneContainer _container; protected override void Configure() { LogManager.GetLog = type => new DebugLog(); _container = new PhoneContainer(RootFrame); _container.RegisterPhoneServices(); _container.Singleton<IStocksWebService, StocksWebService>(); _container.Singleton<HomeViewModel>(); _container.Singleton<HomeNewsViewModel>(); _container.Singleton<HomeWatchListViewModel>(); _container.Singleton<HomeQuoteViewModel>(); } }
Let’s Talk Polish
The following concepts were used to create the full Panorama experience seen in the YouTube video. You may need to watch it more than once to notice the subtle attention to detail.
BusyIndicator
Mango improved panoramas in many ways. For one, the System Tray now has an Opacity property, so you can finally show the tray in a full screen panorama and it still looks great. Another big improvement is the native ProgressIndicator experience. It’s built into the SystemTray and interacts excellently to the rest of the tray, like hiding the loading message when the user taps it to see the clock. It also has some great out of the box animations.
For our app I wanted a global hook into the ProgressIndicator from my ViewModels. To do so, I created a simple BusyIndicator.Show() method which hooks right into the System Tray. You can use this API directly from your ViewModel in a very simple fashion.
I will be going more into the BusyIndicator in a future post.
public void RefreshData() { BusyIndictator.Show("Loading watch list..."); ThreadPool.QueueUserWorkItem(callback => { Coroutine.BeginExecute(UpdateWatchList().GetEnumerator()); }); }
IRefreshable
Refreshing data is very common in these types of apps. Acknowledging this I decided to create a simple IRefreshable interface, which in our Conductor’s case, simply delegates along to the ActiveItem (the currently active panorama pane ViewModel) and says “Hey, do you know how to refresh data? If so, please proceed to do!”
public void RefreshData() { var refreshableChild = ActiveItem as IRefreshable; if (refreshableChild != null) refreshableChild.RefreshData(); }
Then, in the HomeWatchListViewModel for example, it also implements IRefreshable, and proceeds to refresh the current Watch List.
This is another example of compositing pieces together to write really extensible code as our app progresses.
public class HomeWatchListViewModel : Screen, IRefreshable { public void RefreshData() { BusyIndictator.Show("Loading watch list..."); ThreadPool.QueueUserWorkItem(callback => { Coroutine.BeginExecute(UpdateWatchList().GetEnumerator()); }); } }
Polishing up the AppBar
If you look closely at the video, you will notice some careful consideration we needed on our home screen. Each swipe of the panorama changes the ApplicationBar in some way.
- Watch List shows 2 app bar buttons: Add and Refresh
- News shows only 1 app bar button: Refresh
- Lookup shows 0 app bar buttons, and it set it’s Mode to Minimized
In order to achieve this I created a simple IAppBarController interface and an AppBarHelper class. To try and keep this post from getting too long I will be dedicating an entire article to this topic soon. In the mean time, please see the code if you want to see how it works!
WatermarkedTextbox and PriceChangeArrow
Again a keen eye may have noticed 2 other niceties on the home screen:
- PriceChangeArrow – the price change arrow (showing positive or negative gains) had a little animation when the Watch List loaded. It’s a little thing but I think goes a long way to making the app feel polished and enjoyable. I will be blogging exactly how to create such a control in the future.
- WatermarkedTextBox – this control I found from an open source Silverlight project and improved it a bit for Mango. I will be blogging in more detail about this control in the future.
Lazy Loading the Panorama Panes and Keeping the Animations Fluid!
This is perhaps the most important part of the home screen, so I’m not entirely sure why I left it ‘til the end. In any event, high framerates are very important, and maintaining a nice fluid user experience throughout the app is crucial to getting those coveted 5-star rating.
Caliburn Screens have a few important methods that you will want to override to make your app do something.
- OnInitialize – Override this method to add logic which should execute only the first time that the screen is activated. After initialization is complete, IsInitialized will be true.
- OnActivate – Override this method to add logic which should execute every time the screen is activated. After activation is complete, IsActive will be true.
- OnDeactivate – Override this method to add custom logic which should be executed whenever the screen is deactivated or closed. The bool property will indicated if the deactivation is actually a close. After deactivation is complete, IsActive will be false.
- OnViewLoaded – Since Screen implements IViewAware, it takes this as an opportunity to let you know when your view’s Loaded event is fired. Use this if you are following a SupervisingController or PassiveView style and you need to work with the view. This is also a place to put view model logic which may be dependent on the presence of a view even though you may not be working with the view directly.
Read more about Screens, Conductors, and Composition
In addition to the above events, a while ago I came up with OnViewReady and submitted the patch to Rob. The idea is simple: fire after OnViewLoaded, but also after the first LayoutUpdated; meaning the base UI is rendered, so feel free to start doing hogging CPU! By waiting until OnViewReady you make sure that your code doesn’t start running and burning precious CPU cycles while the platform is trying to finish starting up (and animating things into view, like the panorama).
Workaround to OnViewReady
At the time of this writing, in the 1.2 NuGet package, I could not get it to behave correctly, so instead opted for a slightly uglier workaround. Essentially this creates a background thread, and then sleeps for 1 second in that thread, before starting to work. 1 second should be plenty of time for any base loading and animations to complete.
protected override void OnInitialize() { RefreshData(); } public void RefreshData() { BusyIndictator.Show("Loading watch list..."); // TODO: Move this to OnViewReady in CM 1.3 // For now sleep for a bit to let the panorama load smoothly ThreadPool.QueueUserWorkItem(callback => { Thread.Sleep(1000); Coroutine.BeginExecute(UpdateWatchList().GetEnumerator()); }); }
Summary
Kudos if you followed all of that! This one took me a little while to write and contains a lot of stuff, but it also leaves the door open for a whole lot more to talk about in the future!
Please post any questions you have here, and again, please pull down the code and follow along as we go. Feedback is greatly appreciated! | http://matthidinger.com/archive/2011/10/21/RealWorldWPDev-Part-4-The-Panorama/ | CC-MAIN-2017-30 | refinedweb | 2,059 | 55.13 |
Have a .NET program that uses the System.Net.Main namespace to send an email via SMTP.
Its on a customers site so from there it will go via a (series of?) SMTP relay servers before it reaches its destination.
At the moment I have no information about this smtp replay / email infrastructure (and getting that information is going to be hard).
Somewhere along the line an exclamation mark is being inserted into long URL's in the the
email around 100 chars in from the start of a line.
EDIT- Actually have found its about 1000 chars in
This is not happening on a test system or hundreds of other sites.
I feel sure this has to be something to do with escape codes to break long lines up.
Anyone got any ideas?
Got hit with this myself.
If you are building a html message without any carriage returns in it, you may get errors somewhere around the 1000 character mark.
Solution is to add a few \r\n characters so that each line is smaller than 1000 (or 988 if you don't count the \r\n characters).
See section 2.1.1. Line Length Limits of RFC 2822 for more details.
Wrapping at a certain number of characters is usually a client issue. If you're not seeing it at your other sites, or on a test machine I don't think its your code. See if you can't find out what client is being used to receive the message-it could be some crufty old thing thats auto wrapping at a certain number of characters.
It does not sound like the .Net app is causing the issue if the problem is not happening on many other sites where the same code is running. Is the problem site behind some kind of application firewall or anti-spam device that might be monitoring the smtp stream? If so, there might be a rule about truncating long URLs that is being triggered which then causes the URLs in the email to be shortened.
By posting your answer, you agree to the privacy policy and terms of service.
asked
4 years ago
viewed
1128 times
active | http://serverfault.com/questions/62545/exclamation-marks-being-inserted-into-emails-at-approx-1000-character-mark | CC-MAIN-2014-35 | refinedweb | 367 | 81.22 |
So I’m follwing Stephen Grider’s Modern React course on udemy, and there’ something that is not quite clear to me, I can’t find any helpful answer on the Q&A section so I hope someone can clarify this to me before moving on with the course.
First, let me provide with the code for some context:
class App extends Component { constructor(props) { super(props) this.state = { videos: [] }; YTSearch({key: API_KEY, term: 'surfboards'}, videos => { // Same as {videos: videos} as key and value are the same, ES6 syntax this.setState({ videos }); }); } render() { return ( <div> <SearchBar /> <VideoList videos={this.state.videos}/> </div> ); } } // Take this components' generated HTML and put it on the page ReactDOM.render(<App />, document.querySelector('.container'));
My doubt comes with this piece of code here
<VideoList videos={this.state.videos}/> I know how we define state and how to change it (Here we are just getting the value of state property videos) and I know we define variables in React using brackets
{} but what’s “videos”? The name of the variable?
I am playing around with the code but if I change the name of the key (I think videos is a key here?, not sure) nothing works. If it’s a variable then the name can be anything.
For more context, this is the code from the child component that we are passing the data to.
const VideoList = (props) => { const VideoItems = props.videos.map(video => { return <VideoListItem video={video} />; }); return ( <ul className="col-md-4 list-group"> {VideoItems} </ul> ); }
I know with this code we are just using map to iterate through the array we defined in our state (VideoListItem is just a
<li></li> component)
but againt, something I don’t quite understand is happeing:
video={video}
For example I have no problem understanding the following code:
<div> <input value = {this.state.term} onChange = {event => this.setState({ term: event.target.value })} /> </div>
“value” in this case is a valid HTML attribute and we are just setting the value of the input tag to be equal to whatever the value os state is, but video? I am completely lost.
I really want to be able to understand this before moving on, I feel it’s a very important concept. Any help is appreciated. | https://forum.freecodecamp.org/t/question-about-react-keys/221985 | CC-MAIN-2022-27 | refinedweb | 377 | 71.14 |
Using SOAP Faults
Scott Seely
Microsoft Corporation
September 20, 2002
Summary: Scott Seely shows how to use SOAP Faults to deliver the appropriate level of detail to the developer at development time, and to the customer while the Web service is in production. (14 printed pages)
Introduction
In development, when an error is thrown, you will want to know where the error originated. Because this information is not useful to consumers of the Web service, you won't want to return meaningless line numbers when the service is deployed. Instead, you will want to provide other contextual information about what happened. In this column, I want to take a look at how to use SOAP Faults to deliver the right levels of detail to you at development time and to your customers while the Web service is in production. In case you are unfamiliar with the basic layout of a SOAP Fault, let's first take a quick look at the SOAP Fault element.
The SOAP Fault element has four separate pieces:
- faultcode: Contains a value of VersionMismatch, MustUnderstand, Client, or Server. We'll look at how each of these items is set later in the column.
- faultstring: Provides a human-readable explanation of why the Fault occurred.
- faultactor: Indicates the URI associated with the actor that caused the Fault on the message path. In RPC-style messaging, the actor should be the URI of the invoked Web service.
- detail: Carries information about why the error happened. This element may contain more XML elements or it might just be plain text.
In general, a Fault is analogous to an application exception. All SOAP toolkits that I am aware of convert a returned SOAP Fault into an exception (.NET, various Java stacks) or an error code (Microsoft SOAP Toolkit, SOAP::Lite). Why do I mention this? When your Web service returns a Fault, the Fault will be presented as an exception to the calling code. When returning a Fault, it is vital to know your audience; the SOAP Fault should offer meaningful information.
What the phrase "meaningful information" means, however, depends on your context. If you are the developer of a Web service and something bad happens, meaningful information might mean, for instance, the exact location of where the exception happened within your code and the associated call stack. If you are consuming the Web service, you will be very interested in why your input is invalid, but you may not care what server-side code failed.
To generate meaningful faults, we will look at the following related topics:
- Setting the appropriate faultcode.
- Data returned in Fault/faultmessage.
- Leaking application exceptions.
- Using the detail element.
We will take a look at all of this with respect to Microsoft® ASP.NET Web services. As such, we will be focusing pretty heavily on two classes: System.Web.Services.Protocols.SoapException and System.Web.Services.Protocols.SoapHeaderException. These two classes work the same. The only difference: if an error is found when processing a header, you must use SoapHeaderException. If the error is in the body, use SoapException. This discussion will focus on using SoapException. Let's start this discussion out by looking at setting the faultmessage.
Fault/faultmessage
Whenever the code within a Web service raises an exception, ASP.NET catches that exception and transforms it into a SOAP Fault. For example, let's assume that under a certain set of circumstances, the following line will be executed before the Web service can respond to the client:
When this code is executed, the ASP.NET ASMX handler will catch the exception. If you generated the Web service project using Microsoft Visual Studio® .NET and left all the default settings alone, the returned Fault will look like this:
<soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: Something bad happened at AYS17Sept2002.Service1.CallFault() in c:\inetpub\wwwroot\AYS17Sept2002\Service1.asmx.vb:line 49 --- End of inner exception stack trace ---</faultstring> <detail /> </soap:Fault>
This type of information is great for when you are developing the Web service and writing clients to exercise the code. It pinpoints where you have made mistakes and lets you know where you need to add items such as parameter validation. At development time, this is great. This feature is not so great when you deploy the Web service. When clients begin using the Web service, you do not want to be returning things such as what function failed in which module. This reveals information about the structure of the code and may aid an attacker in breaking your Web service.
So what do you do when you deploy the Web service? You need to open up Web.config and edit the /configuration/system.web/customErrors/@mode attribute. By default, this attribute is set to RemoteOnly. The @mode attribute accepts two other values as well:
- On
- Off
The On setting tells ASP.NET not to add the stack trace information to any Faults. RemoteOnly causes the extra information to show up for clients on the same server and hides the information for remote users. When set to Off, the extra information shows up for all calls to the Web service. This is the same behavior you will see for Web pages. By setting the @mode attribute to On and throwing the same exception, I will get the following Fault instead:
At this point, I am returning the same Fault without any information about where the exception was generated. I like that because I'm not revealing the structure of my code to anyone. By returning whatever exception is generated by the internal code, I still might reveal interesting tidbits to the caller. For example, if the Web service accesses a database, many of the exceptions could reveal the user identity accessing the database as well as the table structure. Knowing the table structure, an attacker might try to wreak some havoc. Average users may not care that an overflow occurred or that the database could not be accessed. They would probably be happier with a return value that simply says the server could not process the request. For that, you can use the SoapException class. This class gets special handling and can hide more information that the client does not care about (and often should not know about). Consider a function such as the following:
The above code always throws an exception. It could just as easily be accessing a database, reading a file, or grabbing data over the network. The point here is that the Web service, as written, does not tell the caller about internally generated exceptions. Instead, the service tells the client that something bad happened and returns. Because one Exception is caught and a SoapException is thrown, the faultstring is reduced to:
While hiding the reason why the server could not process the request is a good idea (you won't reveal information about the internal structure of your application), you will probably want to store the actual reason why the Fault was thrown in some location. Places to log problems include a database, event logs, and the Web application trace. Of these three, only one will be available to your application all the time: the application trace. If the database is unreachable due to network/security issues, or the application does not have the right permissions to log to an event log, you may never capture the exception. The application trace has its own problems. In particular, it only holds a finite number of trace statements and those statements may disappear if the Web application is reset or cycled for any reason. As a result, I recommend logging the messages in two locations: a database table or event log, and the application trace.
To make CallFault use the application trace, I edited it to look like this:
<WebMethod()> _ Public Sub CallFault() Try ' Deliberately throw an exception here Throw New Exception("Throwing a fault at " + _ DateTime.Now.ToString()) Catch ex As Exception Me.Context.Trace.Write(ex.ToString()) Throw New SoapException( _ "Server was unable to process request.", _ SoapException.ServerFaultCode) End Try End Sub
For the trace to work, the /configuration/system.web/trace element in Web.config must have the enabled attribute set to true. I recommend leaving the remaining items alone. For a heavily used Web service, you may consider raising the value of the requestLimit attribute as well so that the trace can keep more values around. This particular Web service is deployed in a Web application called AYS17Sept2002. To view the trace messages, I navigate to the URL,. After running an application that calls the Web service 10 times, the application trace has 10 entries. Selecting one entry, I get lots of information about what happened during the execution of the Web service. The trace section is of particular interest to me. It contains the following information:
Figure 1. The trace information for the captured exception
That pretty much sums up how to use faultmessage and how to use the element from the server. The next item of interest is looking at the faultcode. Not all problems happen at the server, but the server can detect a number of them. For these situations, it is really important to state who caused the problem so that it can be fixed.
Fault/faultcode
Lots of things can go wrong with a Web service message. The server may encounter a problem, input data may be wrong, or a header may come across that the server does not understand. The faultcode can have any one of the following values:
- VersionMismatch: The SOAP receiver saw a namespace associated with the SOAP envelope that it does not recognize. When this faultcode is received, the message should not be resent. The SOAP namespace needs to be set to something the receiver does understand.
- MustUnderstand: An immediate child of the SOAP header had mustUnderstand set to true. The receiver of the message did not understand the header. The receiver will need to be updated somehow (new code, new libraries, and so on) in order to make sense of the header.
- Client: Something about the way that the message was formatted or the data it contained was wrong. The client needs to fix its mistake in order for the message to be sent back. When returning this faultcode, you should also fill in the details element with some specifics on what needs to happen in order for the message to go through.
- Server: An error happened at the server. Depending on the nature of the error, you may be able to resend the exact same message to the server and see it processed. Of course, the server itself may need an update. For example, if a database connection string is incorrect, no amount of resending the message will result in success.
When any exception other than System.Web.Services.Protocols.SoapException is thrown from the code executed by the server side of the Web service, ASP.NET will set the faultcode to Server. Of the above faults, you will typically allow ASP.NET to handle inspecting the message for the VersionMismatch and MustUnderstand faultcodes. VersionMismatch is caught whenever the SOAP Envelope namespace does not match up with what the environment expects. A MustUnderstand Fault will be sent whenever a Header child element comes along that has the mustUnderstand attribute set to either true or 1 and it is not understood. In most WebMethod-based Web services, the header is handled by the SoapHeaderAttribute. This attribute maps a public element of the Web service class to an incoming header child element. When a header child element comes along, ASP.NET will look for the SoapHeaderAttribute attribute on the target method. If none is found for the particular mapping and mustUnderstand is true or 1, the Web service will return a MustUnderstand faultcode.
All the faultcode values are held in the SoapException class as static class members. They are:
- VersionMismatchFaultCode
- MustUnderstandFaultCode
- ClientFaultCode
- ServerFaultCode
When writing a Web service that throws a SoapException, you should really only throw Faults that use the ClientFaultCode or ServerFaultCode. The other two will normally be handled and thrown by ASP.NET. In general, you will want to use the ClientFaultCode for errors detected in the data sent to you. The values may be invalid or missing. The user may also pass in a value meant to lookup a particular record. If the value does not reference an existing item, you may also choose to return a Fault. Keep in mind that it may be appropriate to return nothing. Let's look how you might do validation for a Web service that takes some basic user information. The class it is taking in looks like this:
While it would be best to perform validation in PersonData by adding custom properties, this contrived example will do the validation in the Web service code. Using regular expression evaluation, the data is verified and an appropriate Fault is returned.
})(\]?)$") If Not (nameRegEx.IsMatch(pd.FirstName)) Then Throw New SoapException("Invalid First Name", _ SoapException.ClientFaultCode) ElseIf Not (nameRegEx.IsMatch(pd.LastName)) Then Throw New SoapException("Invalid Last Name", _ SoapException.ClientFaultCode) ElseIf Not (emailRegEx.IsMatch(pd.EmailAddress)) Then Throw New SoapException("Invalid e-mail address", _ SoapException.ClientFaultCode) End If ' Do something to store the data End Sub
By the way, I did not cook up the e-mail regular expression on my own. I found this one at. It handles many special cases I didn't think of when I first tried to create the expression on my own.
This validation code reflects how you would want to create your own parameter validation for your own Web service. When returning a Fault, you may also want to give extra details. To do that, you use the Fault/detail element.
Fault/detail
When you have a client Fault, you should explain to the client why the Fault occurred and how they could fix their own code. To add this information, the Fault has an optional detail element. This element can contain any valid XML and can only be used when the Fault is describing something that happened in the SOAP body. This is the only element that cannot be set using both the SoapException and SoapHeaderException class. This includes plain old text. To show how to use this element, I thought it might be interesting to validate all the elements in the PersonData class and return a Fault if any elements are invalid. This will return information on all invalid elements. To handle this, I created an enumeration that can be used to identify the element that is invalid.
Then I created a small class that I can use to explain what is wrong with the element. Since I use regular expressions to validate the input, why not simply send a regular expression to show the right format?
Why did I create a special class? I want to be able to use the XmlSerializer class and its ability to automatically serialize the class. The error-checking code would now look something like this:
})(\]?)$") Dim errorDetails(3) As PersonErrorInfo Dim errorIndex As Integer = 0 ' Check the information and see if it is valid. ' If not, add an entry to the errorDetails array. If Not (nameRegEx.IsMatch(pd.FirstName)) Then errorDetails(errorIndex) = New PersonErrorInfo() errorDetails(errorIndex).ItemInError = PersonDataItem.FirstName errorDetails(errorIndex).CorrectRegularExpression = _ nameRegEx.ToString() errorIndex = errorIndex + 1 End If If Not (nameRegEx.IsMatch(pd.LastName)) Then errorDetails(errorIndex) = New PersonErrorInfo() errorDetails(errorIndex).ItemInError = PersonDataItem.LastName errorDetails(errorIndex).CorrectRegularExpression = _ nameRegEx.ToString() errorIndex = errorIndex + 1 End If If Not (emailRegEx.IsMatch(pd.EmailAddress)) Then errorDetails(errorIndex) = New PersonErrorInfo() errorDetails(errorIndex).ItemInError = _ PersonDataItem.EmailAddress errorDetails(errorIndex).CorrectRegularExpression = _ emailRegEx.ToString() errorIndex = errorIndex + 1 End If ' If we found an error, prepare and send the SOAP Fault. If (errorIndex > 0) Then ' Set up the serialization items Dim ser As New XmlSerializer(GetType(PersonErrorInfo)) Dim stm As New MemoryStream() Dim utfEnc As New UTF8Encoding() Dim xmlw As New XmlTextWriter(stm, System.Text.Encoding.UTF8) Dim index As Integer ' Write the start element to the stream xmlw.WriteStartElement("detail") ' Create the serialization of the details For index = 0 To errorIndex - 1 ser.Serialize(xmlw, errorDetails(index)) Next ' Close the last tag and flush the contents xmlw.WriteEndElement() xmlw.Flush() ' Create a new document to write the stream to. Dim doc As New XmlDocument() Dim xmlStr As String = utfEnc.GetString(stm.GetBuffer()) ' The string contains a byte string that indicates the ' byte order. Delete it right away. xmlStr = xmlStr.Substring(1) System.Diagnostics.Trace.WriteLine(xmlStr) doc.LoadXml(xmlStr) ' Were done with the stream, so close it. xmlw.Close() ' Send the fault Throw New SoapException("Invalid input", _ SoapException.ClientFaultCode, _ Context.Request.Url.ToString(), _ doc.DocumentElement) End If End Sub
If all the elements have something wrong, the output message would look like this:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns: <soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>Invalid input</faultstring> <faultactor ></faultactor> <detail> <PersonErrorInfo xmlns: <ItemInError>FirstName</ItemInError> <CorrectRegularExpression >^([A-Z])([a-z])+</CorrectRegularExpression> </PersonErrorInfo> <PersonErrorInfo xmlns: <ItemInError>LastName</ItemInError> <CorrectRegularExpression >^([A-Z])([a-z])+</CorrectRegularExpression> </PersonErrorInfo> <PersonErrorInfo xmlns: <ItemInError>EmailAddress</ItemInError> <CorrectRegularExpression >^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0- 9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3}) (\]?)$</CorrectRegularExpression> </PersonErrorInfo> </detail> </soap:Fault> </soap:Body> </soap:Envelope>
That's pretty much all you need to know about using a special detail element. For a client that receives such a Fault with a custom detail element, that client can walk the detail element or serialize it to an internal type. Here is some sample code that generates a slightly more readable version of the Fault for users who do not like to read XML.
First, we have a function that calls the StoreData Web service:
Sub CallStoreData() Dim svc As New localhost.Service1() Console.WriteLine("Calling StoreData") Try Dim pd As New localhost.PersonData() pd.EmailAddress = "sseely@microsoft.com" ' The following line should generate an error. ' The first letter of each name must be ' capitalized. pd.FirstName = "scott" pd.LastName = "Seely" svc.StoreData(pd) Catch ex As SoapException DisplayNode(0, ex.Detail) Catch ex As Exception Console.WriteLine("Unexpected exception: " & ex.ToString()) Finally If Not (svc Is Nothing) Then svc.Dispose() End If End Try End Sub
When a SoapException is received, the code calls DisplayNode to show the detail element in a more readable fashion:
Sub DisplayNode(ByVal displayDepth As Integer, _ ByVal theNode As XmlNode) Dim indentString As String = _ New String(ChrW(32), 3 * displayDepth) Dim elem As XmlNode ' Don't display whitespace nodes. If (theNode.Name <> "#whitespace") Then Console.WriteLine(indentString & theNode.Name & _ ": " & theNode.Value) End If ' Display the child nodes For Each elem In theNode.ChildNodes DisplayNode(displayDepth + 1, elem) Next End Sub
Because the client code to StoreData intentionally pushes out invalid information, the error information is displayed. When I run the client against the Web service, I get the following output:
Okay, so that isn't super easy to understand, but for many people it may be easier to read than the straight XML. At any rate, you can comb over the returned detail element and create something that is meaningful for the computer or any humans that happen to be using the computer.
Summary
As a developer of Web services, you need to focus on how any error information is returned to clients. Things that are helpful to you as a developer can reveal details about your application that you may not want to display once the Web service is deployed. To handle visibility, you need to capture exceptions before they are handled by ASP.NET so that details are not leaked out inadvertently. The visibility is handled by editing web.config appropriately, and by wrapping exception-throwing code in try/catch blocks.
Once visibility is handled, you also need to validate client input. ASP.NET only performs simple checks and transforms the XML into CLR types. Once the transformation is complete, you may need to do extra validation. As a result of this validation, the code will set a custom faultmessage and send some details to the caller as to what was wrong.
At Your Service | http://msdn.microsoft.com/en-us/library/aa480514.aspx | CC-MAIN-2014-15 | refinedweb | 3,394 | 56.86 |
Chad Whitacre wrote: >> > 2. I'm not clear on how Paste Deploy's abstractions map to the >> > filesystem. What does my website root look like? >> >> The way I have generally configured websites like this is like: >> >> [composite:main] >> use = egg:Paste#urlmap >> / = config:root.ini >> /blog = config:superblog.ini > > Right, that's the configuration, but where is "egg:Paste#urlmap" on > the filesystem? Are the three ini files alone in some directory? Where > is paste? Where is SuperBlog? Where is the rest of the site? I find it > easier to start with the filesystem and then move up into > object/config abstractions. You just have to understand what egg:Paste#urlmap is, probably from some documentation. Admittedly that's boilerplate in the eyes of most people who use it. It's there explicitly because Paste Deploy doesn't build *any* WSGI anything into it, it only composes pieces, one of the most common being urlmap. You can see docs for it with "paster points paste.composite_factory urlmap", though I now notice I haven't written any docs for it (bad of me), and that is hardly a simple command line. I would certainly want to build a command-line help/browser (and probably web one too) as part of a rewrite of the system. The three ini files do go in the same directory, though of course you could do config:superblog/app.ini or something like that if you wanted to set it up differently. It's a relative filename, relative to the file where it is given. The applications themselves are eggs. You install them however you want to install them (of course I'd strongly recommend workingenv, virtual-python, or zc.buildout, but that's a separate concern). Some people have mentioned some frustration about having to build full libraries with a namespace, setup.py, eggs, etc. just to use applications. But I think even pretty modest shops writing very one-off apps gain a real benefit from these patterns, once you get over the initial hump (and we can build tools to make the initial hump not so bad, that's the point of paster create). Anyway, here's one reply I made to that request: There's a lot of practices around library management that *has* to be done, because people use libraries. Most of this applies pretty well to applications as well -- and since everyone *needs* to learn how to manage their libraries, using the same mechanisms for managing applications has some advantage. Incidentally, one change to the config format that would make it possible to remove the explicit idea of "composite" apps, is to make some key syntax that will instantiate the named object. E.g.,: app / = config:root.ini Then the keywords passed would just be {"/": <actual WSGI app>}, instead of the current {"/": "config:root.ini"} (where the "config:root.ini" is passed to the loader object that the composite factory gets). >> > Also, I don't think we should underestimate the importance of the >> > file/executable distinction. A standard "file format" for a >> > website enables a wider tool ecosystem to evolve: interactive >> > shells, debuggers, test runners, skel systems, configuration UIs. >> > It also makes any given website easier to comprehend and maintain. >> >> I'm not sure about the distinction you are making here. > > ODT vs. DOC > ODS vs. XLS > ODP vs. PPT Still unclear. -- Ian Bicking | ianb at colorstudy.com | | https://mail.python.org/pipermail/web-sig/2007-March/002514.html | CC-MAIN-2016-44 | refinedweb | 567 | 67.04 |
get_server 1.2.1
get_server: ^1.2.1 copied to clipboard
Get Server #
GetServer allows you to write backend applications with Flutter. Everything here is familiar, from the widgets, to the setState, initState and dispose methods, to the way you manage your projects with GetX using controllers and bindings. You don't need any additional knowledge to use GetServer, if you know Flutter, you can write your application's API using it. GetServer gives you 100% reuse of code between backend and frontend.
Flutter has become increasingly popular, and as it grows, there is also a new need for a niche of developers who want to use the same Stack. GetX for its ease and practicality has attracted many new developers every day, who started using Flutter to build mobile, desktop and also web applications. However, the GetX community has turned to a common need: the lack of a cohesive ecosystem for backend programming without a large learning curve. The purpose of this project is to supply the needs of these developers, who can now build backend applications with a 0% learning curve. If you already program in another language, I invite you to test it, if you feel good, or mastered another language, maybe GetServer is not for you, but we are happy to bring ease to people's lives, so if you program mobile but you have no idea how to create an api, you may have found what you were looking for. If you have a local database written in dart (like Hive and Sembast), you can turn it into a backend and build your api to provide them with a simple copy and paste. All of your Model classes are reused. All its route syntax is reused (if you use GetX) All of your business logic is reused.
Getting Started #
Installing
Add Get to your pubspec.yaml file:
run
dart create project and add to your pubspec:
dependencies: get_server:
Import get in files that it will be used:
import 'package:get_server/get_server.dart';
To create a server, and send a plain text:
void main() { runApp( GetServerApp( home: Home(), ), ); } class Home extends StatelessWidget { @override Widget build(BuildContext context) { return Text('Welcome to GetX!'); } }
However, if you don't need to have a single page, you will need named routes to define your urls. This is stupidly simple, and identical to GetX routes for frontend
void main() { runApp(GetServerApp( getPages: [ GetPage(name: '/', page:()=> Home()), ], )); } class Home extends StatelessWidget { @override Widget build(BuildContext context) { return Text("Welcome to GetX"); } }
you just define the path of your URL, and the page you want to deliver!
What if you want to return a json page?
class Home extends StatelessWidget { @override Widget build(BuildContext context) { return Json({ "fruits": ["banana", "apple", "orange"] }); } }
Ok, you created your project with Flutter web, and you have no idea how to host it on a VPS, would it be possible to create the API for your application, and use the same GetX to display the Flutter web project? Yep. You need only copy your web folder from Flutter project, and paste on directory from server file. Flutter web generates an html file that calls a js file, which in turn requests several files that must be in a public folder. To make the Flutter web folder a public folder, just add it to your GetServer. That way when you enter your server, you will automatically be directed to site made with Flutter.
void main() { runApp( GetServerApp( home: FolderWidget('web'), getPages: [ GetPage(name: '/api', page: () => ApiPage()), ], ), ); }
- Note: Static folder only can be the root folder. It will replace any '/' route
If you have an html that does not call files from the server, but only external files, you can use the Html widget for a specific path.
class Home extends StatelessWidget { @override Widget build(BuildContext context) { final path = '${Directory.current.path}/web/index.html'; return Html(path); } }
Ok, but what if I want to do a POST method to send a photo to my server, for example, how do I do this?
Okay, that sounds crazy, but you upload the file to your server, and retrieve it with an "upload.data". For the example not to be small, I will return a json response with the name of the file, his mimeType, and the same file back decoded in base64 so the example doesn't have just 5 lines.
class Home extends GetView { @override Widget build(BuildContext context) { return MultiPartWidget( builder: (context, upload) { return Json({ "nameFile": upload.name, "mimeType": upload.mimeType, "fileBase64": "${base64Encode(upload.data)}", }); }, ); } }
How about Authentication? We have this as well.
First define a secret for your JWT:
void main() { runApp( GetServerApp( jwtKey: 'your key here', ), ); }
Second, retrieve your token:
final claimSet = JwtClaim( expiry: DateTime.now().add(Duration(days: 3)), issuer: 'get is awesome', issuedAt: DateTime.now(), ); var token = TokenUtil.generateToken(claim: claimSet);
and finally just flag your routes that need the token to work:
GetPage( name: '/awesome-route', method: Method.get, page: () => YourPage(), needAuth: true, ),
I'm still not convinced, this is just an http server, but what if I want to create a chat that has real-time communication, how would I do that?
Okay, today is your lucky day. This is not just an http server, but also a websocket server.
class SocketPage extends GetView { @override Widget build(BuildContext context) { return Socket(builder: (socket) { socket.onOpen((ws) { ws.send('socket ${ws.id} connected'); }); socket.on('join', (val) { final join = socket.join(val); if (join) { socket.sendToRoom(val, 'socket: ${socket.hashCode} join to room'); } }); socket.onMessage((data) { print('data: $data'); socket.send(data); }); socket.onClose((close) { print('socket has closed. Reason: ${close.message}'); }); }); } }
Dart is not popular for servers, however, attracting people who already program in Flutter to the backend is now also a mission of GetX. Transforming one-dimensional programmers into full stack developers with 0% learning curve, and reusing code is also one of GetX's goals, and I hope you will help us on this journey.
Like most of the "node.js" way? #
The purpose of this package is to make development for Flutter developers easier. However, the javascript ecosystem is very large and you may be used to a more functional syntax. With get_server you can use this path. You can use get_server as well:
import 'package:get_server/get_server.dart'; void main() { final app = GetServer(); app.get('/', (ctx) => Text('Get_server of javascript way')); app.ws('/socket', (ws) { ws.onMessage((data) { print('data: $data'); }); ws.onOpen((ws) { print('new socket opened'); }); ws.onClose((ws) { print('socket has been closed'); }); }); }
More Power #
If you host your Getserver on a cheap server with few cores, the default option is more than enough. However, if you have a server with many cores and want to make the most of it, you can start the multithreaded server with isolates. This requires only a small step.
Create a global function (isolated requirement), insert your runApp into it, and start it in
runIsolate.
void main() { runIsolate(init); } void init(_) { runApp( GetServerApp( home: Home(), ), ); }
Note: This is a function that creates a thread for each CPU and you can use it throughout your application with GetServer. If you need activity with intense CPU and memory activity, you can use runIsolate.
How can you help? #
- Creating Pull requests, adding resources, improving documentation, creating sample applications, producing articles, videos about Getx, suggesting improvements, and helping to disseminate this framework in development communities.
- Supporting this project.
TODO:
Add Auth options Remove requirements dart:mirrors to allow people to compile the server and use only the binary, protecting its source code. Creation of Bindings and Controllers (as in the main GetX) to adapt the project 100% with Getx for frontend.
- Add some ORM
Accessing GetX: #
GetX starts by default on port 8080. This was done to, if you want to install a reverse proxy like nginx, do it without much effort.
You could, for example, access the home page created in this example, using:
or
However, if you want to start it on another port, such as 80, for example, you can simply do:
void main() { runApp(GetServer( port: 80, getPages: [ GetPage(name: '/', page:()=> Home()), ], )); }
To SSL you have too the
certificateChain,
privateKey, and
password, configurations on GetServer | https://pub.flutter-io.cn/packages/get_server | CC-MAIN-2022-33 | refinedweb | 1,367 | 62.88 |
Are you sure?
This.............. 8..2.... 8.. Permanent Failures............ 7.....4......... Aborting a Session.. Success........15...........6......... Protocol Messages............12. Failed-AVP AVP.. Diameter User Sessions... Experimental-Result-Code AVP..2.... Multi-Round-Time-Out AVP............. Server-Initiated Re-Auth... 8.................... Re-Auth-Answer.........21. Re-Auth-Request... Auth-Grace-Period AVP..............................11................... 7............................................ 7....16.. User-Name AVP. Fault Resilience................................ 8...RFC 3588 Diameter Based Protocol September 2003 7...3...............................1..................................................20. Accounting Session State Machine......... 9. Session-Termination-Answer.... 8.................. 7.................................................1.............2... Abort-Session-Request.....4....................................... Accounting...........3................... 8.. 8.......2........ Session-Id AVP................ Authorization-Lifetime AVP............... 8..... 8.........1..... 8................ Session-Termination-Request..................9.................6......5...5...........18........6........10.....................19... Application Document Requirements............... Authorization Session State Machine............. 7....... 9.. 7............. 9.3.4. Correlation of Accounting Records........... 8... 9....................... Experimental-Result AVP...........................1.................... Class AVP....... 8..... 7....................1... 8... Inferring Session Termination from Origin-State-Id...........................................1........ Standards Track [Page 4] ... et al...3......... Session-Timeout AVP..... Auth-Session-State AVP.................. 8......... Error-Reporting-Host AVP....................... 8..... Session-Server-Failover AVP.......13......... Accounting Records....... 8.... 8... Session Termination........... 9...2.....1................... 7...... 7.... 8.........5...... 8.. Auth-Request-Type AVP..................2....... Abort-Session-Answer.......... 8......... Error Handling.1.............4...1...........7...............5...........3..... Server Directed Model.... Re-Auth-Request-Type AVP...7........5......5................... 8......14...... 7. Error Bit. Origin-State-Id AVP..........................................4. 8................ 8................ 8........................ Informational............. 8....... Protocol Errors... Result-Code AVP....17.... 9.1........ 8........... Error-Message AVP................................. 8. 7.............1... Termination-Cause AVP... 9.....................2.4....1......8......... Event-Timestamp AVP......................... Transient Failures............. Session-Binding AVP..
............... 11...2.4...... 11... 11.. 9................ 9........... Termination-Cause AVP Values.......... 11....4............................... 9.... Accounting-Record-Number AVP............ 10.. Base Protocol Command AVP Table............. 13............... 9....4....................... 11......5.8..................... Command Flags........ IANA Considerations.7..................................8....2... Accounting AVPs.....................8..........1..................... AVP Code.6... Standards Track [Page 5] ....5..........1....2.... 11... Diameter Header.. Result-Code AVP Values.................8........... Command Codes..1..10................................... Redirect-Host-Usage AVP Values........1................ 11........... Informative References......2... 9........................... 10.. Accounting-Request..........4... Auth-Request-Type AVP Values................... 12.7....2.............4........................3.. Appendix B...... 11... 11............4....................... AVP Header... 9........ Accounting AVP Table..................4..... Disconnect-Cause AVP Values.......... Appendix A........1....... 10........9.. Duplicate Detection.4........................... et al.... AVP Occurrence Table...1..4.... 15...... Accounting-Record-Type AVP Values................2.............6............ 9.....................1..........4......... Session-Binding AVP Values.................... Re-Auth-Request-Type AVP Values.......8.. Accounting-Sub-Session-Id AVP........ 13.............. 11............... NAPTR Example..... 11............... Acct-Multi-Session-Id AVP.... Acct-Session-Id AVP.....3........... 11............. TLS Usage......RFC 3588 Diameter Based Protocol September 2003 Accounting Command-Codes..... Security Considerations......... 14..............................2.......1. 11....... 11..... 11... NAPTR Service Fields.......... Application Identifiers...5..............4.....11........... AVP Flags...3... Accounting-Realtime-Required AVP Values......... Diameter TCP/SCTP Port Numbers..........8..8........................... Diameter Service Template.......7............. Diameter Protocol Related Configurable Parameters.. Accounting-Realtime-Required AVP......4.. Acct-Interim-Interval AVP... 11.... Normative References........ 11....... 11...............7.....3............2. 11..........1.............. 11... 14.. 11......2.4.. AVP Values......6. References. Peer-to-Peer Considerations............ Accounting-Answer................. Appendix C............. Auth-Session-State AVP Values.................8...8.....1.....1.....2..................... Accounting-Record-Type AVP............2........ 13............................ 9... 9.... IPsec Usage........ Acknowledgements...4....... 9........ 9... 14............... 11.............. Session-Server-Failover AVP Values.........7... 13....................
and TLS support is optional. et al. While [RFC3162] defines the use of IPsec with RADIUS... Calhoun. Authorization and Accounting (AAA) protocols such as TACACS [TACACS] and RADIUS [RADIUS] were initially deployed to provide dial-up PPP [PPP] and terminal server access... it is typically not possible to define separate trust or authorization schemes for each application....... These include: Failover [RADIUS] does not define failover mechanisms....RFC 3588 Diameter Based Protocol September 2003 Appendix D....... including wireless. This is described in Section 5... Introduction Authentication.... IPsec support is mandatory in Diameter. use is only required during Extensible Authentication Protocol (EAP) sessions.... and as a result....... In accounting... Standards Track [Page 6] .. 147 1........ Transmission-level security [RADIUS] defines an application-layer authentication and integrity scheme that is required only for use with Response packets.... putting new demands on AAA protocols. While attribute-hiding is supported. DSL....... Over time... [RADIUS] does not provide support for per-packet confidentiality.. routers and network access servers (NAS) have increased in complexity and density. and defines failover algorithms and the associated state machine.... rather than within the protocol itself. and enable both intra........ Diameter supports application-layer acknowledgements................ [RADACCT] assumes that replay protection is provided by the backend billing server...... support for IPsec is not required... Security is discussed in Section 13.. Mobile IP and Ethernet. 145 Authors’ Addresses. In order to provide well defined failover behavior........ While [RADEXT] defines an additional authentication and integrity mechanism.. This limits the usefulness of IPsec in inter-domain AAA applications (such as roaming) where it may be desirable to define a distinct certificate hierarchy for use in a AAA deployment.and inter-domain AAA deployments. failover behavior differs between implementations.. 146 Full Copyright Statement... Intellectual Property Statement... Since within [IKE] authentication occurs only within Phase 1 prior to the establishment of IPsec SAs in Phase 2.5 and [AAATRANS].. In order to provide universal support for transmission-level security. Network access requirements for AAA protocols are summarized in [AAAREQ]. with the growth of the Internet and the introduction of new access technologies.....
where packet loss may translate directly into revenue loss. untrusted proxies may modify attributes or even packet headers without being detected. In order to provide well defined transport behavior. et al. reliability varies between implementations. it varies between implementations. Since the expected behavior is not defined. As described in [ACCMGMT]. and does not define retransmission behavior. Auditability RADIUS does not define data-object security mechanisms. Redirects and Relays. and as a result. as well as within gateways enabling communication between legacy RADIUS devices and Diameter agents. Agent support [RADIUS] does not provide for explicit support for agents. SCTP) as defined in [AAATRANS]. This makes it difficult to implement features such as unsolicited disconnect or reauthentication/reauthorization on demand across a heterogeneous deployment. these capabilities are supported. this is a major issue in accounting. as a result. Server-initiated messages While RADIUS server-initiated messages are defined in [DYNAUTH]. Transition support While Diameter does not share a common protocol data unit (PDU) with RADIUS. enables Diameter support to be added to legacy networks. While implementation of data object security is not mandatory within Diameter. Support for server-initiated messages is mandatory in Diameter. and are described in [AAACMS]. Standards Track [Page 7] . This capability. Diameter runs over reliable transport mechanisms (TCP. by addition of a gateway or server speaking both RADIUS and Diameter. so that the two protocols may be deployed in the same network. this is described in Section 2. support is optional. Initially. including Proxies. described in [NASREQ].RFC 3588 Diameter Based Protocol September 2003 Reliable transport RADIUS runs over UDP. Combined with lack of support for capabilities negotiation. Diameter defines agent behavior explicitly. it is expected that Diameter will be deployed within new network devices. this makes it very difficult to determine what occurred in the event of a dispute.8. considerable effort has been expended in enabling backward compatibility with RADIUS. and is described in Section 8. Calhoun.
detailed roaming requirements [ROAMCRIT]. capability negotiation. However. Diameter enables dynamic discovery of peers. while Diameter is a considerably more sophisticated protocol than RADIUS. Diameter includes support for error handling (Section 7). Derivation of dynamic session keys is enabled via transmission-level security. Since RADIUS clients and servers are not aware of each other’s capabilities. capability negotiation (Section 5. Peer discovery and configuration RADIUS implementations typically require that the name or address of servers or clients be manually configured. the capabilities of Network Access Server (NAS) devices have increased substantially. and creates the temptation to reuse the RADIUS shared secret. As a result. Roaming support The ROAMOPS WG provided a survey of roaming implementations [ROAMREV].RFC 3588 Diameter Based Protocol September 2003 In addition to addressing the above requirements. and lacks auditability and transmission-level security features. et al. even be aware of what service has been implemented. they may not be able to successfully negotiate a mutually acceptable service.1). or a mandatory/non-mandatory flag for attributes.3). In the decade since AAA protocols were first introduced. defined the Network Access Identifier (NAI) [NAI]. Diameter also provides support for the following: Capability negotiation RADIUS does not support error messages. it remains feasible to implement Calhoun. and mandatory/non-mandatory attribute-value pairs (AVPs) (Section 4. [PROXYCHAIN] introduced the concept of proxy chaining via an intermediate server. This results in a large administrative burden.7 and 6). Diameter addresses these limitations and provides for secure and scalable roaming. In order to improve scalability. along with the corresponding shared secrets. Through DNS. and documented existing implementations (and imitations) of RADIUS-based roaming [PROXYCHAIN]. and transmission-layer security (Section 13) features. since RADIUS does not provide explicit support for proxies. auditability [AAACMS]. As a result. which can result in major security vulnerabilities if the Request Authenticator is not globally and temporally unique as required in [RADIUS]. By providing explicit support for inter-domain roaming and message routing (Sections 2. Standards Track [Page 8] . or in some cases. it is not suitable for wide-scale deployment on the Internet [PROXYCHAIN]. facilitating roaming between providers. RADIUSbased roaming is vulnerable to attack from external parties as well as susceptible to fraud perpetrated by the roaming partners themselves.
Basic services necessary for applications. AVPs may be added arbitrarily to Diameter messages. it is imperative that the designers of new applications understand their requirements before using Diameter. Relaying. Diameter Protocol The Diameter base protocol provides the following facilities: Delivery of AVPs (attribute value pairs) Capabilities negotiation Error notification Extensibility. through addition of new commands and AVPs (required in [AAAREQ]). At this time the focus of Diameter is network access and accounting applications. Standards Track [Page 9] . between client and servers. proxying and redirecting of Diameter messages through a server hierarchy. or network access [NASREQ]. Calhoun. AVPs are used by the base Diameter protocol to support the following required features: Transporting of user authentication information. The base protocol may be used by itself for accounting purposes only. Therefore. It is also possible for the base protocol to be extended for use in new applications. etc. A truly generic AAA protocol used by many applications might provide functionality not provided by Diameter. such as Mobile IPv4 [DIAMMIP]. so long as the required AVPs are included and AVPs that are explicitly excluded are not included. Exchanging resource usage information.RFC 3588 Diameter Based Protocol September 2003 within embedded devices. for the purposes of enabling the Diameter server to authenticate the user.1. 1. given improvements in processor speeds and the widespread availability of embedded IPsec and TLS implementations. as required by [AAAREQ]. or it may be used with a Diameter application. via the addition of new commands or AVPs. such as handling of user sessions or accounting All data delivered by the protocol is in the form of an AVP. Transporting of service specific authorization information. et al. Some of these AVP values are used by the Diameter protocol itself. capacity planning. which MAY be used for accounting purposes. while others deliver data associated with particular applications that employ Diameter. allowing the peers to decide whether a user’s access request should be granted. - - - The Diameter base protocol provides the minimum requirements needed for a AAA protocol.
1. authorization. A Diameter server performs authentication and/or authorization of the user. A Diameter agent is a node that does not authenticate and/or authorize messages locally. such as a request to abort service to a particular user. and NASREQ [NASREQ]. this document defines the base protocol specification for AAA. Diameter is a peerto-peer protocol. and accounting services for the user. Transport Profile [AAATRANS] and applications: Mobile IPv4 [DIAMMIP]. Consideration was given for servers that need to perform protocol conversion between Diameter and RADIUS. Description of the Document Set Currently. The Transport Profile document [AAATRANS] discusses transport layer issues that arise with AAA protocols and recommendations on how to overcome these issues. The NASREQ [NASREQ] application defines a Diameter Application that allows a Diameter server to be used in a PPP/SLIP Dial-Up and Terminal Server Access environment. the Diameter specification consists of a base specification (this document). The Diameter protocol also supports server-initiated messages. This document also defines the Diameter failover algorithm and state machine. A Diameter node MAY act as an agent for certain requests while acting as a server for others. such as a Network Access Server (NAS) or a Foreign Agent (FA). The Mobile IPv4 [DIAMMIP] application defines a Diameter application that allows a Diameter server to perform AAA functions for Mobile IPv4 services to a mobile node.RFC 3588 Diameter Based Protocol September 2003 See Section 2. Calhoun. A Diameter client generates Diameter messages to request authentication. In that sense. Authorization and Accounting.1. 1. which includes support for accounting. et al. Any node can initiate a request. In this document. In summary. a Diameter Client is a device at the edge of the network that performs access control. The Mobile IPv4 and the NASREQ documents describe applications that use this base specification for Authentication.4 for more information on Diameter applications. Standards Track [Page 10] . redirects and relay agents. agents include proxies.
2. an application may require a new value to communicate some service-specific information. it is recommended that a Grouped AVP be used (see Section 4. a request MUST be sent to IANA [IANA]. new AVP being defined MUST use one of the data types listed in Section 4. 1. new command codes can only be created by IETF Consensus (see Section 11.1). with a specification for the AVP. In the event that a logical grouping of AVPs is necessary.2.2. using several mechanisms. Calhoun.2.RFC 3588 Diameter Based Protocol September 2003 1. It is expected that command codes are reused. For AVPs of type Enumerated. Creating New Authentication Applications Every Diameter application specification MUST have an IANA assigned Application Identifier (see Section 2. The request MUST include the commands that would make use of the AVP. Standards Track [Page 11] . along with an explanation of the new AVP value. a request MUST be sent to IANA. including: Defining new AVP values Creating new AVPs Creating new authentication/authorization applications Creating new accounting applications Application authentication procedures Reuse of existing AVP values. AVPs and Diameter applications are strongly recommended. 1. Approach to Extensibility The Diameter protocol is designed to be extensible.1.2.4).2.4) or a vendor specific Application Identifier.2. Reuse simplifies standardization and implementation and avoids potential interoperability issues. 1. et al. Creating New AVPs The When no existing AVP can be used. as opposed to creating new AVPs. Defining New AVP Values New applications should attempt to reuse AVPs defined in existing applications when possible. In order to allocate a new AVP value. In order to create a new AVP. a new AVP should be created. IANA considerations for Diameter are discussed in Section 11.3. and multiple "groups" are possible in a given command.
Major changes to an application include: Adding new AVPs to the command. et al.2). Please refer to Section 11.g. 1.3). application foo has a command that requires one round trip. or add new mandatory AVPs to the ABNF. Since a new EAP authentication method can be supported within Diameter without requiring new AVPs.RFC 3588 Diameter Based Protocol September 2003 Should a new Diameter usage scenario find itself unable to fit within an existing application without requiring major changes to the specification. Adding support for an authentication method requiring definition of new AVPs for use with the application.1 for details. Creating New Accounting Applications There are services that only require Diameter accounting. which have the "M" bit set.4. including vendor-specific AVPs without needing to define a new application. in order to avoid defining multiple AVPs that carry similar information. a new Diameter application SHOULD reuse existing Diameter AVPs. just because a new authentication application id is required. When possible. it may be desirable to create a new Diameter application.1. An implementation MAY add arbitrary non-mandatory AVPs (AVPs with the "M" bit not set) to any command defined in an Calhoun. Diameter applications MUST define one Command Code. Requiring a command that has a different number of round trips to satisfy a request (e. - Creation of a new application should be viewed as a last resort. However. but new application bar has a command that requires two round trips to complete). If the Diameter application has accounting requirements.2. it MUST also specify the AVPs that are to be present in the Diameter Accounting messages (see Section 9. Such services need to define the AVPs carried in the Accounting-Request (ACR)/ Accounting-Answer (ACA) messages. Standards Track [Page 12] . does not imply that a new accounting application id is required.. In order to justify allocation of a new application identifier. An implementation MAY add arbitrary non-mandatory AVPs to any command defined in an application. addition of EAP methods does not require the creation of a new authentication application. but do not need to define new command codes. The expected AVPs MUST be defined in an ABNF [ABNF] grammar (see Section 3.
. A DIAMETER base accounting implementation MUST be configurable to advertise supported accounting applications in order to prevent the accounting server from accepting accounting requests for unbillable services. Basic accounting support is sufficient to handle any application that uses the ACR/ACA commands defined in this document. Application Identifiers are still required for Diameter capability exchange. application defined state machine). as long as no new mandatory AVPs are added. et al.g. or new mandatory AVPs are added to the ABNF. application defined state machine) is defined within the application.. a new Diameter accounting application SHOULD attempt to reuse existing AVPs. including vendor-specific AVPs.4) MUST be used in ACR/ACA commands. If the base accounting is used without any mandatory AVPs.. When possible. billing server) or the accounting server itself MUST understand the AVP in order to compute a correct bill.1. without needing to define a new accounting application. authentication/authorization commands). Calhoun. Every Diameter implementation MUST support accounting.e. Standards Track [Page 13] . even if the "M" bit is set when the same AVP is used within other Diameter commands (i. when the AVP is included within an accounting command.1 for details. setting the "M" bit implies that a backend server (e. The creation of a new accounting application should be viewed as a last resort and MUST NOT be used unless a new command or additional mechanisms (e.g.. new commands or additional mechanisms (e. regardless of whether it is required or optional within the ABNF for the accounting application. it MUST NOT have the "M" bit set. Please refer to Section 11. A mandatory AVP is defined as one which has the "M" bit set when sent within an accounting command. Within an accounting command. If the AVP is not relevant to the billing process. The combination of the home domain and the accounting application Id can be used in order to route the request to the appropriate accounting server. in order to avoid defining multiple AVPs that carry similar information. then the base protocol defined standard accounting application Id (Section 2.g.4) or a vendor specific Application Identifier. Every Diameter accounting application specification MUST have an IANA assigned Application Identifier (see Section 2.RFC 3588 Diameter Based Protocol September 2003 application.
3. SHOULD be used. authentication frameworks. Depending on the business model. Broker A broker A broker operated a broker agents. authorization or accounting information. AVP The Diameter protocol consists of a header followed by one or more Attribute-Value-Pairs (AVPs). proxy or redirect agent. Authorization The act of determining whether a requesting entity (subject) will be allowed access to a resource (object). Application Authentication Procedures When possible.2. is either a relay.RFC 3588 Diameter Based Protocol September 2003 1. An AVP includes a header and is used to encapsulate protocol-specific data (e. Authorization and Accounting.5. routing information) as well as authentication. billing or cost allocation. When possible. applications SHOULD be designed such that new authentication methods MAY be added without requiring changes to the application. Authentication The act of verifying the identity of an entity (subject).g. auditing. such as Extensible Authentication Protocol [EAP]. Terminology is a business term commonly used in AAA infrastructures.. This MAY require that new AVP values be assigned to represent the new authentication transform. or any other scheme that produces similar results. and MAY be by roaming consortiums. may either choose to deploy relay agents or proxy Calhoun. 1. Accounting Record An accounting record represents a summary of the resource consumption of a user over the entire session. Accounting The act of collecting information on resource usage for the purpose of capacity planning. et al. Accounting servers creating the accounting record may do so by processing interim accounting events or accounting events from several devices serving the same user. Standards Track [Page 14] . AAA Authentication.
Diameter Node A Diameter node is a host process that implements the Diameter protocol. End-to-End Security TLS and IPsec provide hop-by-hop security. or security across a transport connection. authorization and accounting requests for a particular realm. et al. Diameter Peer A Diameter Peer is a Diameter Node to which a given Diameter Node has a direct transport connection. When relays or proxy are involved. Diameter Server A Diameter Server is one that handles authentication. An example of a Diameter client is a Network Access Server (NAS) or a Foreign Agent (FA). Standards Track [Page 15] . Diameter Security Exchange A Diameter Security Exchange is a process through which two Diameter nodes establish end-to-end security. Calhoun. Home Server See Diameter Server. redirect or translation services. and acts either as a Client. possibly communicating through Diameter Agents. End-to-end security is security between two Diameter nodes. Home Realm A Home Realm is the administrative domain with which the user maintains an account relationship. a Diameter Server MUST support Diameter applications in addition to the base protocol.RFC 3588 Diameter Based Protocol September 2003 Diameter Agent A Diameter Agent is a Diameter node that provides either relay. This security protects the entire Diameter communications path from the originating Diameter node to the terminating Diameter node. its very nature. this hop-by-hop security does not protect the entire Diameter user session. proxy. Agent or Server. By Downstream Downstream is used to identify the direction of a particular Diameter message from the home server towards the access device. Diameter Client A Diameter Client is a device at the edge of the network that performs access control.
An administrative domain MAY act as a local realm for certain users. This is typically accomplished by tracking the state of NAS devices. a logical linking of several sessions. or whether they must be routed or redirected. It is typically implemented in order to provide for partial accounting of a user’s session in the case of a device reboot or other network problem prevents the reception of a session summary message or session record. NAI realm names are required to be unique. Standards Track [Page 16] . or NAI [NAI]. Local Realm A local realm is the administrative domain providing services to a user. proxies make policy decisions relating to resource usage and provisioning. Realm The string in the NAI that immediately follows the ’@’ character. While proxies typically do not respond to client Requests prior to receiving a Response from the server.RFC 3588 Diameter Based Protocol September 2003 Interim accounting An interim accounting message provides a snapshot of usage during a user’s session. Each a session while the entire bundle would Network Access Identifier The Network Access Identifier. and are piggybacked on the administration of the DNS namespace. is used in the Diameter protocol to extract a user’s identity and realm. by using the Acct-Multi-Session-Id. Multi-session A multi-session represents Multi-sessions are tracked example of a multi-session leg of the bundle would be be a multi-session. they may originate Reject messages in cases where policies are violated. et al. to determine whether messages can be satisfied locally. As a result. realm names are not necessarily piggybacked on the DNS namespace but may be independent of it. Proxy Agent or Proxy In addition to forwarding requests and responses. and may not support all Diameter applications. also loosely referred to as domain. Calhoun. while the realm is used for message routing purposes. An would be a Multi-link PPP bundle. while being a home realm for others. In RADIUS. The identity is used to identify the user during authentication and/or authorization. Diameter makes use of the realm. proxies need to understand the semantics of the messages passing through them.
although they may be configured only to redirect messages of certain types. and are capable of handling any Diameter application or message type. redirect agents do not keep state with respect to sessions or NAS resources. Session A session is a related progression of events devoted to a particular activity. Calhoun. Relay Agent or Relay Relays forward requests and responses based on routing-related AVPs and realm routing table entries. et al. Since relays make decisions based on information in routing AVPs and realm forwarding tables they do not keep state on NAS resource usage or sessions in progress. Time constraints are typically imposed in order to limit financial risk. As a result. relationships among peer ISPs within a roaming consortium. As with proxy agents. Standards Track [Page 17] . while acting as relay or proxy agents for other types. they do not examine or alter non-routing AVPs. Redirect Agent Rather than forwarding requests and responses between clients and servers. and relationships between an ISP and a roaming consortium. redirect agents refer clients to servers and allow them to communicate directly. even in the presence of relays and/or proxies. Each application SHOULD provide guidelines as to when a session begins and ends. Since relays do not make policy decisions. Redirect agents do not originate messages and are capable of handling any message type. do not need to understand the semantics of messages or non-routing AVPs. Roaming Relationships Roaming relationships include relationships between companies and ISPs. Since redirect agents do not sit in the forwarding path. All Diameter packets with the same Session-Identifier are considered to be part of the same session. relays never originate messages.RFC 3588 Diameter Based Protocol September 2003 Real-time Accounting Real-time accounting involves the processing of information on resource usage within a defined time window. Security Association A security association is an association between two endpoints in a Diameter session which allows the endpoints to communicate with integrity and confidentially. they do not alter any AVPs transiting between client and server.
A stateless agent is one that only maintains transaction state. User The entity requesting or using some resource.. QoS or data characteristics) provided to a given session. otherwise known as a Peerto-Peer Connection. Translation Agent A translation agent is a stateful Diameter node that performs protocol translation between Diameter and another AAA protocol. simultaneous voice and data transfer during the same session) or serially. Transaction state The Diameter protocol requires that agents maintain transaction state. Calhoun. the Hop-by-Hop identifier is saved. et al. 2.g. which is used for failover purposes. Two Diameter applications are defined by companion documents: NASREQ [NASREQ]. or by expiration. Each authorized session is bound to a particular service. which is restored to its original value when the corresponding answer is received. The request’s state is released upon receipt of the answer. by keeping track of all authorized active sessions. but for use in authentication and authorization it is always extended for a particular application. the field is replaced with a locally unique identifier. Standards Track [Page 18] . such as RADIUS. Protocol Overview The base Diameter protocol may be used by itself for accounting applications. and its state is considered active either until it is notified otherwise. Transaction state implies that upon forwarding a request.RFC 3588 Diameter Based Protocol September 2003 Session state A stateful agent is one that maintains session state information. These changes in sessions are tracked with the Accounting-Sub-Session-Id. Upstream Upstream is used to identify the direction of a particular Diameter message from the access device towards the home server.g. Transport Connection A transport connection is a TCP or SCTP connection existing directly between two Diameter peers. These services may happen concurrently (e.. Sub-session A sub-session represents a distinct service (e. in support of which a Diameter client has generated a request.
g. protocol transparent. In addition. which includes accounting. MUST be referred to as "Diameter X Proxy" where X is the application which it supports. et al. e. Diameter Servers MUST support the base protocol. they MUST fully support each Diameter application that is needed to implement proxied services. how messages are sent and how peers may eventually be abandoned. Diameter Relays and redirect agents are. Standards Track [Page 19] . In addition. and not a "Diameter Server". MUST be referred to as "Diameter X Server" where X is the application which it supports. MUST be referred to as "Diameter X Client" where X is the application which it supports. and MUST transparently support the Diameter base protocol. A Diameter Server that does not support both NASREQ and Mobile IPv4. and all Diameter applications. or reject it by returning an answer message with the Result-Code AVP Calhoun. NASREQ and/or Mobile IPv4. which includes accounting. NASREQ and/or Mobile IPv4. Additional Diameter applications MAY be defined in the future (see Section 11. The initial request for authentication and/or authorization of a user would include the Session-Id. One AVP that is included to reference a user’s session is the Session-Id.g. A Diameter Client that does not support both NASREQ and Mobile IPv4. and not a "Diameter Client". by definition. A Diameter proxy which does not support also both NASREQ and Mobile IPv4. they MUST fully support each Diameter application that is needed to implement the client’s service. The set of AVPs included in the message is determined by a particular Diameter application. they MUST fully support each Diameter application that is needed to implement the intended service. The base protocol also defines certain rules that apply to all exchanges of messages between Diameter nodes. NASREQ and/or Mobile IPv4. which includes accounting.RFC 3588 Diameter Based Protocol September 2003 Mobile IPv4 [DIAMMIP].g. Diameter Clients MUST support the base protocol. The base Diameter protocol concerns itself with capabilities negotiation. e... These applications are introduced in this document but specified elsewhere. e.3). and not a "Diameter Proxy". The communicating party may accept the request. which includes accounting.. In addition. Diameter proxies MUST support the base protocol. Communication between Diameter peers begins with one peer sending a message to another Diameter peer. The Session-Id is then used in all subsequent messages to identify the user’s session (see Section 8 for more information).
followed by TCP.1. Diameter clients MUST support either TCP or SCTP. Session-TerminationAnswer. et al. Transport Transport profile is defined in [AAATRANS]. The specific behavior of the Diameter server or client receiving a request depends on the Diameter application employed.RFC 3588 Diameter Based Protocol September 2003 set to indicate an error occurred. Standards Track [Page 20] . A given Diameter instance of the peer state machine MUST NOT use more than one transport connection to communicate with a given peer. while agents and servers MUST support both. whose recommended value is 30 seconds.2 for more information on peer discovery. subject to security policy on trusting such messages. an attempt to connect SHOULD be periodically made. SCTP SHOULD be tried first. expiration of authorized service time in the Session-Timeout AVP. Future versions of this specification MAY mandate that clients support SCTP. A Diameter node MAY initiate connections from a source port other than the one that it declares it accepts incoming connections on. When no transport connection exists with a peer. 2. This behavior is handled via the Tc timer. Calhoun. Session state (associated with a Session-Id) MUST be freed upon receipt of the Session-Termination-Request. Diameter implementations SHOULD also be able to interpret a reset from the transport and timed-out connection attempts. Diameter implementations SHOULD be able to interpret ICMP protocol port unreachable messages as explicit indications that the server is not reachable. and according to rules established in a particular Diameter application. such as when a peer has terminated the transport connection stating that it does not wish to communicate. There are certain exceptions to this rule. The base Diameter protocol is run on port 3868 of both TCP [TCP] and SCTP [SCTP] transport protocols. and MUST be prepared to receive connections on port 3868. unless multiple instances exist on the peer in which case a separate connection per process is allowed. See Section 5. When connecting to a peer and either zero or more transports are specified.
2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP streams available to the association to prevent head-of-the-line blocking. 2.3. Standards Track [Page 21] . This also eases the requirements on the NAS support certificates. 2. For a given application. the stream is compromised and cannot be recovered.3).1 and 13. SCTP Guidelines The following are guidelines for Diameter implementations that support SCTP: 1. and the AVPs specified in the associated ABNFs. Diameter servers MUST support TLS and IPsec. advertising support of an application implies that the sender supports all command codes. An implementation MAY add arbitrary non-mandatory AVPs to any command defined in an application.1. 2. such as Network Access Servers (NASes) and Mobility Agents MUST support IP Security [SECARCH]. such as using pre-shared keys between a local AAA proxy.1. Diameter Application Compliance and in NAS a to traffic details Application Identifiers are advertised during the capabilities exchange phase (see Section 5. The transport connection MUST be closed using a RESET call (send a TCP RST bit) or an SCTP ABORT message (graceful closure is compromised). Please refer to Section 11. described in the specification. See Sections 13. For interoperability: All Diameter nodes MUST be prepared to receive Diameter messages on any SCTP stream in the association.1. and MAY support TLS [TLS]. The Diameter protocol MUST NOT be used without any security mechanism (TLS or IPsec). Securing Diameter Messages Diameter clients. et al. It is also suggested that inter-domain would primarily use TLS.1 for details. Calhoun.2 for more on IPsec and TLS usage.RFC 3588 Diameter Based Protocol September 2003 If Diameter receives data up from TCP that cannot be parsed or identified as a Diameter error made by the peer. including vendor-specific AVPs. 2. It is suggested that IPsec can be used primarily at the edges intra-domain traffic.
The base protocol does not require an Application Identifier since its support is mandatory. Diameter nodes inform their peers of locally supported applications. Connections vs. which is used in the message forwarding process. Sessions This section attempts to provide the reader with an understanding of the difference between connection and session. If none can be found.RFC 3588 Diameter Based Protocol September 2003 2. while all other Diameter nodes MUST advertise locally supported applications. The following Application Identifier values are defined: Diameter Common Messages NASREQ Mobile-IP Diameter Base Accounting Relay 0 1 [NASREQ] 2 [DIAMMIP] 3 0xffffffff Relay and redirect agents MUST advertise the Relay Application Identifier. which are terms used extensively throughout this document. During the capabilities exchange. et al. 2. an error message is returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. all Diameter messages contain an Application Identifier. The receiver of a Capabilities Exchange message advertising Relay service MUST assume that the sender supports all current and future applications.4.5. A connection is a transport level connection between two peers. Diameter relay and proxy agents are responsible for finding an upstream server that supports the application of a particular message. Standards Track [Page 22] . Application Identifiers Each Diameter application MUST have an IANA assigned Application Identifier (see Section 11. and is identified via the Session-Id AVP Calhoun. A session is a logical concept at the application layer. and is shared between an access device and a server.3). used to send and receive Diameter messages. Furthermore.]
which is communicated by Diameter servers via the Session-Timeout AVP. RADIUS <-> Diameter) Limiting resources authorized to a particular user Per user or transaction auditing A Diameter agent MAY act in a stateful manner for some requests and be stateless for others. with the guarantee that the same state will be present in the answer. such as: Protocol translation (e. The Diameter protocol requires that agents maintain transaction state. However. and as another type of agent for others. which is used for failover purposes. Standards Track [Page 26] . the field is replaced with a locally unique identifier. et al. A stateless agent is one that only maintains transaction state. A complex network will have multiple authentication sources. The request’s state is released upon receipt of the answer. This is known as the Realm Routing Table.RFC 3588 Diameter Based Protocol September 2003 - They can be used for load balancing. Destination-Realm). its Hop-by-Hop identifier is saved.1. by keeping track of all authorized active sessions. Relay Agents Relay Agents are Diameter agents that accept requests and route messages to other Diameter nodes based on information found in the messages (e.8. This routing decision is performed using a list of supported realms. they can sort requests and forward towards the correct target.g. which is restored to its original value when the corresponding answer is received. The Proxy-Info AVP allows stateless agents to add local state to a Diameter request. as is defined further in Section 2..7. the protocol’s failover procedures require that agents maintain a copy of pending requests. Each authorized session has an expiration.. A stateful agent is one that maintains session state information.g. Calhoun. and its state is considered active either until it is notified otherwise. and known peers. Transaction state implies that upon forwarding a request. Each authorized session is bound to a particular service. 2. A Diameter implementation MAY act as one type of agent for some requests. Maintaining session state MAY be useful in certain applications. or by expiration.
. Request 4. Calhoun.com" as the key.8. provide admission control. which is a Diameter Relay. However. which is routed back to NAS using saved transaction state.com Figure 2: Relaying of Diameter messages The example provided in Figure 2 depicts a request issued from NAS. Standards Track [Page 27] . +------+ | | | NAS | | | +------+ example. Answer <--------+------+ | | | DRL | | | +------+ example. which is an access device. they differ since they modify messages to implement policy enforcement. and relays the message to HMS. Prior to issuing the request. and determines that the message is to be relayed to DRL.g. Proxy Agents Similarly to relays. which is example. Answer <--------+------+ | | | HMS | | | +------+ example. DRL performs the same route lookup as NAS. they provide relaying services for all Diameter applications. and therefore MUST advertise the Relay Application Identifier. NAS performs a Diameter route lookup. The use of Relays is advantageous since it eliminates the need for NASes to be configured with the necessary security information they would otherwise require to communicate with Diameter servers in other realms. 2. this reduces the configuration load on Diameter servers that would otherwise be necessary when NASes are added. Relays SHOULD NOT maintain session state but MUST maintain transaction state. and replies with an answer. Likewise. et al.RFC 3588 Diameter Based Protocol September 2003 Relays MAY be used to aggregate requests from multiple Network Access Servers (NASes) within a common geographical area (POP). and provisioning. proxy agents route Diameter messages using the Diameter Routing Table. This requires that proxies maintain the state of their downstream peers (e. HMS identifies that the request can be locally supported (via the realm). Request 3. but do not modify any other portion of a message. changed or deleted.com’s Home Diameter Server.com. for the user bob@example.net ---------> 1. access devices) to enforce resource usage.2. Relays modify Diameter messages by inserting and removing routing information.net ---------> 2. processes the authentication and/or authorization request. Since Relays do not perform any application level processing. using "example.
NAS. they cannot maintain session state. they do not modify messages. Upon receipt of the redirect notification. Proxies MUST only advertise the Diameter applications they support. Standards Track [Page 28] .com. 2. they can monitor the number and types of ports in use. which does not have a routing entry in its Diameter Routing Table for example. The example provided in Figure 3 depicts a request issued from the access device. Proxies that wish to limit resources MUST maintain session state. which is a redirect agent that returns a redirect notification to DRL.com. Since redirect agents do not relay messages. Redirect Agents Redirect agents are useful in scenarios where the Diameter routing configuration needs to be centralized.. and make allocation and admission decisions according to their configuration. they are not required to maintain transaction state. since modifying messages breaks authentication. Since redirect agents do not receive answer messages. as well as HMS’ contact information. Calhoun. since redirect agents never relay requests. for the user bob@example. et al. DRL has a default route configured to DRD.8. DRL establishes a transport connection with HMS. and forwards the request to it.3. Further. if one doesn’t already exist. they do not allow access devices to use end-toend security. Proxies MAY be used in call control centers or access ISPs that provide outsourced connections. All proxies MUST maintain transaction state. Since enforcing policies requires an understanding of the service being provided. and only return an answer with the information necessary for Diameter agents to communicate directly. DRL. The message is forwarded by the NAS to its relay. An example is a redirect agent that provides services to all members of a consortium.
Translation of messages can only occur if the agent recognizes the application of a particular request. Redirection | | Notification | v ---------> +------+ ---------> 1. Given that the Diameter protocol introduces the concept of long-lived authorized sessions. Standards Track [Page 29] . they provide relaying services for all Diameter applications.net +------+ ---------> +------+ | | Diameter Request | | | TLA | | HMS | | | Diameter Answer | | +------+ <--------+------+ example.net example. Translation Agents A translation agent is a device that provides translation between two protocols (e.g.8.net +------+ | | | HMS | | | +------+ example. Answer <--------+------+ <--------example. 2.4. Request | DRL | 6. et al. Answer | | 5..com Figure 4: Translation of RADIUS to Diameter Calhoun. and therefore translation agents MUST only advertise their locally supported applications. Request | | 3. translation agents MUST be session stateful and MUST maintain transaction state. Translation agents are likely to be used as aggregation servers to communicate with a Diameter infrastructure. RADIUS<->Diameter. Request | | 4.net +------+ | | | DRD | | | +------+ ^ | 2. TACACS+<->Diameter). while allowing for the embedded systems to be migrated at a slower pace.RFC 3588 Diameter Based Protocol September 2003 +------+ | | | NAS | | | +------+ example. +------+ ---------> | | RADIUS Request | NAS | | | RADIUS Answer +------+ <--------example. and therefore MUST advertise the Relay Application Identifier.com Figure 3: Redirecting a Diameter Message Since redirect agents do not perform any application level processing.
Always use end-to-end security. These services are provided by supporting AVP integrity and confidentiality between two peers. 2. Any AVP for which the P bit may be set or which may be encrypted may be considered sensitive.10.2. each connection is authenticated. Accounting AVPs may be considered sensitive. a Diameter peer may be authentic. each connection as well as the entire session MUST also be authorized. where TLS or IPsec transmissionlevel security is sufficient. Use end-to-end security on messages containing sensitive AVPs. may be applied by next hop Diameter peer or by destination realm. - It is strongly RECOMMENDED that all Diameter implementations support end-to-end security. there may be no need for end-to-end security. replay and integrity protected and confidential on a per-packet basis. The circumstances requiring the use of end-to-end security are determined by policy on each of the peers. described in [AAACMS]. a Diameter Peer MUST check that its peers are authorized to act in their roles. Security policies.RFC 3588 Diameter Based Protocol September 2003 2. Which AVPs are sensitive is determined by service provider policy. communicating through agents. but that does not mean that it is authorized to act as a Diameter Server advertising a set of Diameter applications. which are not the subject of standardization.9. End-to-End Security Framework End-to-end security services include confidentiality and message origin authentication. Standards Track [Page 30] . For example. AVPs containing keys and passwords should be considered sensitive. Before initiating a connection. Therefore. et al. End-to-end security policies include: Never use end-to-end security. For example. Calhoun. End-to-end security is provided via the End-to-End security extension. Diameter requires transmission level security to be used on each connection (TLS or IPsec). Diameter Path Authorization As noted in Section 2. In addition to authenticating each connection.
If the service cannot be provided by the local realm.1. Diameter sessions MUST be routed only through authorized nodes that have advertised support for the Diameter application required by the session.8. A DIAMETER_AUTHORIZATION_REJECTED error message (see Section 7. the home Diameter server is implicitly indicating its willingness to engage in the business transaction as specified by the contractual relationship between the server and the previous hop. A local realm may wish to limit this exposure. the local Diameter agent. and then send accounting requests for the alternate service instead. for example. MUST check the Route-Record AVPs to make sure that the route traversed by the response is acceptable. prior to authorizing a session. Diameter capabilities negotiation (CER/CEA) also MUST be carried out. Calhoun. By issuing an accounting request corresponding to the authorization response. Similarly. authorization checks are performed at each connection along the path. a Diameter client receiving an authorization response for a service that it cannot perform MUST NOT substitute an alternate service. et al. MUST check the Route-Record AVPs to make sure that the route traversed by the request is acceptable. forwarding of an authorization response is considered evidence of a willingness to take on financial risk relative to the session. Standards Track [Page 31] . The home Diameter server. At each step. then a DIAMETER_UNABLE_TO_COMPLY error message MUST be sent within the accounting request. the local realm implicitly indicates its agreement to provide the service indicated in the authorization response. A home realm may also wish to check that each accounting request message corresponds to a Diameter response authorizing the session. in order to determine what Diameter applications are supported by each peer. By authorizing a request.1. administrators within the home realm may not wish to honor requests that have been routed through an untrusted realm.RFC 3588 Diameter Based Protocol September 2003 Prior to bringing up a connection. Accounting requests without corresponding authorization responses SHOULD be subjected to further scrutiny. as should accounting requests indicating a difference between the requested and provided service. on receiving a Diameter response authorizing a session. by establishing credit limits for intermediate realms and refusing to accept responses which would violate those limits. For example. As noted in Section 6.5) is sent if the route traversed by the request is unacceptable. a relay or proxy agent MUST append a Route-Record AVP to all requests forwarded. The AVP contains the identity of the peer the request was received from.
. +-+-+-+-+-+-+-+-+-+-+-+-+Version This Version field MUST be set to 1 to indicate Diameter Version 1. are transmitted in network byte order. the message MAY be proxied. P(roxiable) . Standards Track [Page 32] . Message Length The Message Length field is three octets and indicates the length of the Diameter message including the header fields. the message is an answer. and the message will not conform to the ABNF described for this command. message MUST be locally processed. If cleared.If set. assigned: 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ |R P E T r r r r| +-+-+-+-+-+-+-+-+ R(equest) . Messages with the ’E’ The following bits are Calhoun. the message is a request.If set.. et al. E(rror) . the message contains a protocol error.RFC 3588 Diameter Based Protocol September 2003 3. Diameter Header A summary of the Diameter header format is shown below. Command Flags The Command Flags field is eight bits. If cleared. relayed or redirected.If set.
Diameter agents that receive a request with the T flag set. otherwise the sender MUST set this flag. See Section 7.777. as an indication of a possible duplicate due to a link failure. This bit MUST NOT be set in request messages. This bit MUST be cleared when sending a request for the first time.these flag bits are reserved for future use. Command-Code values 16.1). to aid the removal of duplicate requests.3 for the possible values that the application-id may use.2. and is used in order to communicate the command associated with the message. MUST keep the T flag set in the forwarded request.RFC 3588 Diameter Based Protocol September 2003 bit set are commonly referred to as error messages. a protocol error) has been received for the earlier message.3). See Section 11. Standards Track [Page 33] . retransmissions by other entities need not be tracked. T(Potentially re-transmitted message) . It can be set only in cases where no answer has been received from the server for a request and the request is sent again. The application-id in the header MUST be the same as what is contained in any relevant AVPs contained in the message. Application-ID Application-ID is four octets and is used to identify to which application the message is applicable for.This flag is set after a link failover procedure. This flag MUST NOT be set in answer messages. and ignored by the receiver.777. The application can be an authentication application. et al. This flag MUST NOT be set if an error answer message (e.2.214 and 16.215 (hexadecimal values FFFFFE -FFFFFF) are reserved for experimental use (See Section 11.g. Diameter agents only need to be concerned about the number of requests they send based on a single received request. It is set when resending requests not yet acknowledged. an accounting application or a vendor specific application. The 24-bit address space is managed by IANA (see Section 11. Command-Code The Command-Code field is three octets. r(eserved) . and MUST be set to zero. Calhoun..
2) SHOULD be silently discarded. The combination of the Origin-Host (see Section 6. End-to-End Identifier The End-to-End Identifier is an unsigned 32-bit integer field (in network byte order) and is used to detect duplicate messages. et al. and MUST NOT affect any state that was set when the original request was processed. Calhoun. Standards Track [Page 34] . The identifier MUST remain locally unique for a period of at least 4 minutes. The End-to-End Identifier MUST NOT be modified by Diameter agents of any kind. The originator of an Answer message MUST ensure that the End-to-End Identifier field contains the same value that was found in the corresponding request. Duplicate requests SHOULD cause the same answer to be transmitted (modulo the hop-by-hop Identifier field and any routing AVPs that may be present). even across reboots. The sender MUST ensure that the Hop-by-Hop identifier in a request is unique on a given connection at any given time. and MAY attempt to ensure that the number is unique across reboots. The Hop-by-Hop identifier is normally a monotonically increasing number.RFC 3588 Diameter Based Protocol September 2003 Hop-by-Hop Identifier The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in network byte order) and aids in matching requests and replies. Duplicate answer messages that are to be locally consumed (see Section 6. Senders of request messages MUST insert a unique identifier on each message. and the low order 20 bits to a random value.3) and this field is used to detect duplicates. AVPs AVPs are a method of encapsulating information relevant to the Diameter message. See Section 4 for more information on AVPs. whose start value was randomly generated. The sender of an Answer message MUST ensure that the Hop-by-Hop Identifier field contains the same value that was found in the corresponding request. An answer message that is received with an unknown Hop-by-Hop Identifier MUST be discarded. Upon reboot implementations MAY set the high order 12 bits to contain the low order 12 bits of current time.
RFC 3588 Diameter Based Protocol September 2003 3.2 Session-TerminationSTR 275 8.2 Capabilities-ExchangeCER 257 5.1 Request Capabilities-ExchangeCEA 257 5. et al.2 Answer Device-Watchdog-Request DWR 280 5.4.1 Re-Auth-Answer RAA 258 8.e. and the sub-type (i. Command Codes Each command Request/Answer pair is assigned a command code.3.2 Accounting-Request ACR 271 9.3.1 Abort-Session-Answer ASA 274 8.2 Disconnect-Peer-Request DPR 282 5. Every Diameter message MUST contain a command code in its header’s Command-Code field.2 Answer Calhoun. which is used to determine the action that is to be taken for a particular message.1 Device-Watchdog-Answer DWA 280 5.3. Code Reference -------------------------------------------------------Abort-Session-Request ASR 274 8.4.5.5.4.2 Re-Auth-Request RAR 258 8.7.5. Standards Track [Page 35] .3.5. The following Command Codes are defined in the Diameter base protocol: Command-Name Abbrev.1 Accounting-Answer ACA 271 9.1 Request Session-TerminationSTA 275 8.1 Disconnect-Peer-Answer DPA 282 5. request or answer) is identified via the ’R’ bit in the Command Flags field of the Diameter header.1..4.7.
= ". = [qual] "<" avp-spec ">" . message contains a Result-Code AVP in . the ’E’ bit in the Command . Command Code ABNF specification Every Command Code defined MUST include a corresponding ABNF specification. If present. indicating that the answer .2. Flags is set. Flags is set. Defines the fixed position of an AVP = [qual] "{" avp-spec "}" . If present. the "protocol error" class. application-id command-id r-bit p-bit e-bit fixed required Calhoun. ERR" . Flags is set. is a request. anywhere in the message. which is used to define the AVPs that MUST or MAY be present. The Command Code assigned to the" = 1*DIGIT = 1*DIGIT . = ".
. See ABNF conventions. The AVP can . = [min] "*" [max] . = avp-spec / "AVP" . evaluate to any AVP Name which is included . required. If an optional rule has no . These braces cannot be used to express . . rule. present. = 1*DIGIT . AVP Name. et al. specifications. appear anywhere in the message. = 1*DIGIT . then 0 or 1 such AVP may be . The minimum number of times the element may . value of zero implies the AVP MUST NOT be . defined . The avp-spec has to be an AVP Name. RFC 2234 Section 6. The default value is zero. = diameter-name . in the base or extended Diameter . optional fixed rules (such as an optional . be present. the convention . Standards Track [Page 37] . qualifier. The string "AVP" stands for *any* arbitrary . or optional . If a fixed or required rule has no . . . be present. qual min max A avp-spec avp-name Calhoun. The avp-name in the ’optional’ rule cannot . be present. in a fixed or required rule. The absence of any qualifiers depends on whether . ICV at the end). is ’0*1fixed’. above). The maximum number of times the element may . qualifier. The default value is infinity. . than in ABNF (see the optional rule.RFC 3588 Diameter Based Protocol September 2003 optional = [qual] "[" avp-name "]" . NOTE: "[" and "]" have a different meaning . To do this. present.6. then exactly one such AVP MUST . which does not conflict with the . required or fixed position AVPs defined in . the command code definition. it precedes a fixed.
RFC 3588 Diameter Based Protocol September 2003 The following is a definition of a fictitious command code: Example-Request ::= < { * { * [ 3. to ask that a particular action be performed. encoded within AVPs. 4. such as authorizing a user or terminating a session. Standards Track [Page 38] . authorization. Both the request and the answer for a given command share the same command code. "Diameter-Header: 9999999. The request is identified by the R(equest) bit in the Diameter header set to one (1). Some AVPs MAY be listed more than once. REQ. known as redirect. while the acronyms are STR and STA. PXY > User-Name } Origin-Host } AVP Diameter Command Naming Conventions Diameter command names typically includes one or more English words followed by the verb Request or Answer. et al. The receiver could not process the request. which includes a result code that communicates one of the following: The request was successful The request failed An additional request must be sent to provide information the peer requires prior to returning a successful or failed answer. accounting. The effect of such an AVP is specific. MAY also be included in answer messages. An example is a message set used to terminate a session.3. A three-letter acronym for both the request and answer is also normally provided. Calhoun. The command name is Session-Terminate-Request and Session-Terminate-Answer. Once the receiver has completed the request it issues the corresponding answer. but provides information about a Diameter peer that is able to satisfy the request. Diameter AVPs Diameter AVPs carry specific authentication. respectively. and is specified in each case by the AVP description. - Additional information. routing and security information as well as configuration details for the request and reply. Each English word is delimited by a hyphen.
et al.1). known as the Mandatory bit. The ’M’ Bit. without setting the Vendor-Id field. proxy. AVP Flags The AVP Flags field informs the receiver how each attribute must be handled. identifies the attribute uniquely. Note that subsequent Diameter applications MAY define additional bits within the AVP Header. and an unrecognized bit SHOULD be considered an error. The ’P’ bit indicates the need for encryption for end-to-end security. indicates whether support of the AVP is required. The ’r’ (reserved) bits are unused and SHOULD be set to 0.. Standards Track [Page 39] .. AVP numbers 1 through 255 are reserved for backward compatibility with RADIUS.1. Calhoun. which are allocated by IANA (see Section 11. A number of zerovalued bytes are added to the end of the AVP Data field till a word boundary is reached. while other AVP types align naturally. 4.RFC 3588 Diameter Based Protocol September 2003 Each AVP of type OctetString MUST be padded to align on a 32-bit boundary. AVP numbers 256 and above are used for Diameter. server. the message MUST be rejected. If an AVP with the ’M’ bit set is received by a Diameter client. combined with the Vendor-Id field. The length of the padding is not reflected in the AVP Length field. AVP Header The The fields in the AVP header MUST be sent in network byte order. or translation agent and either the AVP or its value is unrecognized. +-+-+-+-+-+-+-+-+ AVP Code The AVP Code. Diameter Relay and redirect agents MUST NOT reject messages with unrecognized .
In order to preserve interoperability. the message SHOULD be rejected. a Diameter implementation MUST be able to exclude from a Diameter message any Mandatory AVP which is neither defined in the base Diameter protocol nor in any of the Diameter Application specifications governing the message in which it appears. The ’V’ bit. per peer.. Vendor-ID field (if present) and the AVP data. and indicates the number of octets in this AVP including the AVP Code. The ’V’ bit MUST NOT be set. Unless otherwise noted. If a message is received with an invalid attribute length. or whose value is not supported. AVP Length.RFC 3588 Diameter Based Protocol September 2003 The ’M’ bit MUST be set according to the rules defined for the AVP containing it. Thus an administrator could change the configuration to avoid interoperability problems. or per realm basis that would allow/prevent particular Mandatory AVPs to be sent. AVPs with the ’M’ bit cleared are informational only and a receiver that receives a message with such an AVP that is not supported. When set the AVP Code belongs to the specific vendor code address space. AVPs will have the following default AVP Flags field settings: The ’M’ bit MUST be set. possibly inserting additional standard AVPs instead. AVP Flags. indicates whether the optional Vendor-ID field is present in the AVP header. Calhoun. 2) A configuration option may be provided on a system wide. Diameter implementations are required to support all Mandatory AVPs which are allowed by the message’s formal syntax and defined either in the base Diameter standard or in one of the Diameter Application specifications governing the message. MAY simply ignore the AVP. Standards Track [Page 40] . AVP Length The AVP Length field is three octets. et al. known as the Vendor-Specific bit.
encoded in network byte order. This field is only present if the respective bit-flag is enabled. in network byte order. a new version of this RFC must be created. et al. Optional Header Elements The AVP Header contains one optional field.1. Basic AVP Data Formats The Data field is zero or more octets and contains information specific to the Attribute. Any vendor wishing to implement a vendor-specific Diameter AVP MUST use their own Vendor-ID along with their privately managed AVP address space.1.RFC 3588 Diameter Based Protocol September 2003 4. as managed by the IANA. The AVP Length field MUST be set to 12 (16 if the ’V’ bit is enabled). Calhoun. nor with future IETF applications. The format of the Data field MUST be one of the following base data types or a data type derived from the base data types. The optional four-octet Vendor-ID field contains the IANA assigned "SMI Network Management Private Enterprise Codes" [ASSIGNNO] value. Integer64 64 bit signed value. 4. the AVP Length field MUST be set to at least 8 (12 if the ’V’ bit is enabled). Since the absence of the vendor ID field implies that the AVP in question is not vendor specific. implementations MUST NOT use the zero (0) vendor ID. OctetString The data contains arbitrary data of variable length. Vendor-ID The Vendor-ID field is present if the ’V’ bit is set in the AVP Flags field. Unless otherwise noted. The format and length of the Data field is determined by the AVP Code and AVP Length fields. Integer32 32 bit signed value. In the event that a new Basic AVP Data Format is needed. Standards Track [Page 41] . in network byte order. AVP Values of this type that are not a multiple of four-octets in length is followed by the necessary padding so that the next AVP (if any) will start on a 32-bit boundary. A vendor ID value of zero (0) corresponds to the IETF adopted AVP values. The AVP Length field MUST be set to 16 (20 if the ’V’ bit is enabled). guaranteeing that they will not collide with any other vendor’s vendor-specific AVP(s).2.
RFC 3588 Diameter Based Protocol September 2003 Unsigned32 32 bit unsigned value. The below AVP Derived Data Formats are commonly used by applications. including their headers and padding. Standards Track [Page 42] . The 32-bit value is transmitted in network byte order. Float32 This represents floating point values of single precision as described by [FLOATPOINT]. Float64 This represents floating point values of double precision as described by [FLOATPOINT]. The AVP Length field MUST be set to 16 (20 if the ’V’ bit is enabled). Thus the AVP length field of an AVP of type Grouped is always a multiple of 4. The AVP Length field MUST be set to 12 (16 if the ’V’ bit is enabled). most significant octet first. Address The Address format is derived from the OctetString AVP Base Format. for example a 32-bit (IPv4) [IPV4] or 128-bit (IPv6) [IPV6] address. in network byte order. The first two octets of the Address Calhoun. The 64-bit value is transmitted in network byte order. Grouped The Data field is specified as a sequence of AVPs. representing. using the same format as the definitions below. 4. The AVP Length field is set to 8 (12 if the ’V’ bit is enabled) plus the total length of all included AVPs. The AVP Length field MUST be set to 16 (20 if the ’V’ bit is enabled).3. in network byte order. Each of these AVPs follows . et al. Derived AVP Data Formats In addition to using the Basic AVP Data Formats. The AVP Length field MUST be set to 12 (16 if the ’V’ bit is enabled). An application that defines new AVP Derived Data Formats MUST include them in a section entitled "AVP Derived Data Formats". Each new definition must be either defined or listed with a reference to the RFC that defines the format. It is a discriminated union.in the order in which they are specified including their headers and padding. Unsigned64 64 bit unsigned value. applications may define data formats derived from the Basic AVP Data Formats.
The string MUST contain four octets. On 6h 28m 16s UTC. Time The Time format is derived from the OctetString AVP Base Format. Calhoun. SNTP [SNTP] describes a procedure to extend the time to 2104. When it is necessary to represent a new line. The AddressType is used to discriminate the content and format of the remaining octets. the control code sequence CR LF SHOULD be used.RFC 3588 Diameter Based Protocol September 2003 AVP represents the AddressType. not characters. implementations MUST be prepared to encounter any code point from 0x00000001 to 0x7fffffff. thus the length of an UTF8String in octets may be different from the number of characters encoded. Note that the AVP Length field of an UTF8String is measured in octets. such as hexadecimal. This procedure MUST be supported by all DIAMETER nodes. MAY be provided. an alternative means of entry and display. which contains an Address Family defined in [IANAADFAM]. The NTP Timestamp format is defined in chapter 3 of [SNTP]. This is a human readable string represented using the ISO/IEC IS 10646-1 character set. in the same format as the first four bytes are in the NTP timestamp format. For code points not directly supported by user interface hardware or software. encoded as an OctetString using the UTF-8 [UFT8] transformation format described in RFC 2279. The use of leading or trailing white space SHOULD be avoided. Since additional code points are added by amendments to the 10646 standard from time to time. Byte sequences that do not correspond to the valid encoding of a code point into UTF-8 charset or are outside this range are prohibited. The use of control codes SHOULD be avoided. For information encoded in 7-bit US-ASCII. 7 February 2036 the time value will overflow. et al. This represents the number of seconds since 0h on 1 January 1900 with respect to the Coordinated Universal Time (UTC). UTF-8 may require multiple bytes to represent a single character / code point. Standards Track [Page 43] . the UTF-8 charset is identical to the US-ASCII charset. UTF8String The UTF8String format is derived from the OctetString AVP Base Format.
and used as the only DiameterIdentity for that node. No transport security "aaas://" FQDN [ port ] [ transport ] [ protocol ] . the default Diameter port (3868) is assumed.RFC 3588 Diameter Based Protocol September 2003 DiameterIdentity The DiameterIdentity format is derived from the OctetString AVP Base Format. whatever the connection it is sent on. . If absent. DiameterIdentity = FQDN DiameterIdentity value is used to uniquely identify a Diameter node for purposes of duplicate connection and routing loop detection. . each Diameter node MUST be assigned a unique DiameterIdentity. . . . If absent. transport . et al. Transport security used FQDN port . . Calhoun.transport=" transport-protocol One of the transports used to listen for incoming connections. If a Diameter node can be identified by several FQDNs. UDP MUST NOT be used when the aaa-protocol field is set to diameter. . the default SCTP [SCTP] protocol is assumed. . a single FQDN should be picked at startup. The contents of the string MUST be the FQDN of the Diameter node. . If multiple Diameter nodes run on the same host. DiameterURI The DiameterURI MUST follow the Uniform Resource Identifiers (URI) syntax [URI] rules specified below: "aaa://" FQDN [ port ] [ transport ] [ protocol ] . Standards Track [Page 44] . = ". = Fully Qualified Host Name = ":" 1*DIGIT One of the ports used to listen for incoming connections.
com. is diameter. et al.com:1813.example. with matched rule terminating the evaluation. the packet is dropped if the evaluated was a permit. Standards Track [Page 45] . It uses the ASCII charset.example.example.transport=tcp aaa://host. IPFilterRule The IPFilterRule format is derived from the OctetString AVP Base Format. aaa-protocol = ( "diameter" / "radius" / "tacacs+" ) The following are examples of valid Diameter host identities: aaa://host.transport=tcp.com.transport=tcp aaa://host. If absent.com:6666. and passed if the last rule was Calhoun. The definition contains a list of valid values and their interpretation and is described in the Diameter application introducing the AVP.example.protocol=diameter aaa://host.protocol=" aaa-protocol .RFC 3588 Diameter Based Protocol September 2003 transport-protocol = ( "tcp" / "sctp" / "udp" ) protocol = ". Each packet is once. If no rule matches.transport=udp.com:6666.com:6666.example. Packets may be filtered based on the following information that is associated with it: Direction Source and destination IP address Protocol Source and destination port TCP flags IP fragment flag IP options ICMP types Rules for the first evaluated last rule a deny. (in or out) (possibly masked) (lists or ranges) the appropriate direction are evaluated in order.example. the default AAA protocol .protocol=diameter aaa://host.protocol=radius Enumerated Enumerated is derived from the Integer32 AVP Base Format.protocol=diameter aaa://host.
"in" is from the terminal. For IPv4.0. causing all other addresses to be matched instead.3. The bit width MUST be valid for the IP version and the IP number MUST NOT have bits set beyond the mask.0/0 or the IPv6 equivalent. The keyword "assigned" is the address or set of addresses assigned to the terminal. The "ip" keyword means any protocol will match.255 will match. <address/mask> [ports] The <address/mask> may be specified as: ipno An IPv4 or IPv6 number in dottedquad or canonical IPv6 form.3. "out" is to the terminal. In this case.2. a typical first rule is often "deny in ip! assigned" The sense of the match can be inverted by preceding an address with the not modifier (!). Only this exact IP number will match the rule.Drop packets that match the rule. the same IP version must be present in the packet that was used in describing the IP address.3. To test for a particular IP version.Allow packets that match the rule.2. deny . et al. all IP numbers from 1.RFC 3588 Diameter Based Protocol September 2003 IPFilterRule filters MUST follow the format: action dir proto from src to dst [options] action permit . For a match to occur. dir proto src and dst Calhoun. The keyword "any" is 0. This does not affect the selection of port numbers. Standards Track [Page 46] . the bits part can be set to zero. ipno/bits An IP number as above with a mask width of the form 1.2.0 to 1. An IP protocol specified by number.4/24.0.
sack (selective ack). tcpoptions spec Match if the TCP header contains the comma separated list of options specified in spec.. Standards Track [Page 47] . options: frag Match if the packet is a fragment and this is not the first fragment of the datagram. lsrr (loose source route). frag may not be used in conjunction with either tcpflags or TCP/UDP port specifications. The absence of a particular option may be denoted with a ’!’.RFC 3588 Diameter Based Protocol September 2003 With the TCP.. The absence of a particular option may be denoted with a ’!’. UDP and SCTP protocols. rr (record packet route) and ts (timestamp). Match packets that have the SYN bit set but no ACK bit. not the first fragment) will never match a rule that has one or more port specifications. supported TCP options are: The mss (maximum segment size).. setup Match packets that have the RST TCP packets only. or ACK bits set.. ipoptions spec Match if the IP header contains the comma separated list of options specified in spec.ports[. supported IP options are: The ssrr (strict source route).]] The ’-’ notation specifies a range of ports (including boundaries). optional ports may be specified as: {port/port-port}[. Fragmented packets that have a non-zero offset (i. established TCP packets only. et al. Calhoun.e. See the frag option for details on matching fragmented packets. ts (rfc1323 timestamp) and cc (rfc1644 t/tcp connection count). window (tcp window advertisement).
destination unreachable (3). The supported TCP flags are: fin. Match if the TCP header contains the comma separated list of flags specified in spec. icmptypes types ICMP packets only. There is one kind of packet that the access device MUST always discard. rst. information reply (16). redirect (5). router solicitation (10). The supported ICMP types are: echo reply (0).c code may provide a useful base for implementations.RFC 3588 Diameter Based Protocol September 2003 tcpflags spec TCP packets only. Standards Track [Page 48] . Calhoun. router advertisement (9). that is an IP fragment with a fragment offset of one. The absence of a particular flag may be denoted with a ’!’. echo request (8). The list may be specified as any combination of ranges or individual types separated by commas. ack and urg. See the frag option for details on matching fragmented packets. information request (15). and the ipfw. Match if the ICMP type is in the list types. psh. syn. for example to protect the access device owner’s infrastructure. et al. Both the numeric values and the symbolic values listed below can be used. IP header bad (12). A rule that contains a tcpflags specification can never match a fragmented packet that has a non-zero offset. timestamp request (13). to try to circumvent firewalls. An access device MAY apply deny rules of its own before the supplied rules. An access device that is unable to interpret or apply a deny rule MUST terminate the session. address mask request (17) and address mask reply (18). This is a valid packet. but it only has one use. timestamp reply (14). An access device that is unable to interpret or apply a permit rule MAY apply a more restrictive rule. time-to-live exceeded (11). The rule syntax is a modified subset of ipfw(8) from FreeBSD. source quench (4).
Mark packet with a specific DSCP [DIFFSERV]. the packet is treated as best effort. Each packet is evaluated once. 4. that is. to nest them.4. Standards Track [Page 49] . with the first matched rule terminating the evaluation.Meter traffic. as defined in Section 4. Calhoun.’ This implies that the Data field is actually a sequence of AVPs. proto The format is as described under IPFilterRule. Grouped AVP Values The Diameter protocol allows AVP values of type ’Grouped. It is possible to include an AVP with a Grouped type within a Grouped type. meter dir. . src and dst The format is as described under IPFilterRule. AVPs within an AVP of type Grouped have the same padding requirements as non-Grouped AVPs. QoSFilterRule filters MUST follow the format: action dir proto from src to dst [options] tag . The DSCP option MUST be included. An access device that is unable to interpret or apply a QoS rule SHOULD NOT terminate the session. It uses the ASCII charset. If no rule matches. et al.RFC 3588 Diameter Based Protocol September 2003 QoSFilterRule The QosFilterRule format is derived from the OctetString AVP Base Format.
In this case: Calhoun. the default value of zero is . et al. specifications. grouped-avp-def name-fmt name = name "::=" avp = ALPHA *(ALPHA / DIGIT / "-") = name-fmt . The Vendor-ID assigned to the Grouped AVP. The name has to be the name of an AVP. . Example AVP with a Grouped Data type The Example-AVP (AVP Code 999999) is of type Grouped and is used to clarify how Grouped AVP values work. Every Grouped AVP defined MUST include a corresponding grammar.1. The Grouped Data field has the following ABNF grammar: Example-AVP ::= < { 1*{ *[ AVP Header: 999999 > Origin-Host } Session-Id } AVP ] An Example-AVP with Grouped Data follows. Standards Track [Page 50] . defined in the base or extended Diameter . .com". avp header avpcode vendor 4. The Origin-Host AVP is required (Section 6. if any of the AVPs encapsulated within a Grouped AVP has the ’M’ (mandatory) bit set. If absent.4. the Grouped AVP itself MUST also include the ’M’ bit set. used." = 1*DIGIT .3).RFC 3588 Diameter Based Protocol September 2003 The AVP Code numbering space of all AVPs included in a Grouped AVP is the same as for non-grouped AVPs. using ABNF [ABNF] (with modifications). as defined below.
com:33041.example. Calhoun.23432.23561. Here there are two: Session-Id = "grump. et al.893.com:33054.RFC 3588 Diameter Based Protocol September 2003 One or more Session-Ids must follow. The encoding example illustrates how padding is used and how length fields are calculated. nor (likely) at the time when the example instance of this AVP is interpreted . Standards Track [Page 51] .2358.example. Also note that AVPs may be present in the Grouped AVP value which the receiver cannot interpret (here.except by Diameter implementations which support the same set of AV Recover-Policy and Futuristic-Acct-Record AVPs).0AF3B81" Session-Id = "grump.
+-------+-------+-------+-------+-------+-------+-------+-------+ | 0x41 |Padding|Padding|Padding| +-------+-------+-------+-------+ 0 8 16 24 32 64 72 80 104 112 120 320 328 336 464 Calhoun.RFC 3588 Diameter Based Protocol September 2003 This AVP would be encoded as follows: 0 1 2 3 4 5 6 7 +-------+-------+-------+-------+-------+-------+-------+-------+ | Example AVP Header (AVP Code = 999999). Length = 51 | +-------+-------+-------+-------+-------+-------+-------+-------+ | ’g’ | ’r’ | ’u’ | ’m’ | ’p’ | ’. . Length = 468 | +-------+-------+-------+-------+-------+-------+-------+-------+ | Origin-Host AVP Header (AVP Code = 264). +-------+-------+-------+-------+-------+-------+-------+-------+ | ’A’ | ’F’ | ’3’ | ’B’ | ’8’ | ’1’ |Padding|Padding| +-------+-------+-------+-------+-------+-------+-------+-------+ | Session-Id AVP Header (AVP Code = 263). . +-------+-------+-------+-------+-------+-------+-------+-------+ | ’0’ | ’A’ | ’F’ | ’3’ | ’B’ | ’8’ | ’2’ |Padding| +-------+-------+-------+-------+-------+-------+-------+-------+ | Recovery-Policy Header (AVP Code = 8341). Length = 137| +-------+-------+-------+-------+-------+-------+-------+-------+ | 0xfe | 0x19 | 0xda | 0x58 | 0x02 | 0xac | 0xd9 | 0x8b | +-------+-------+-------+-------+-------+-------+-------+-------+ .’ | ’e’ | ’x’ | +-------+-------+-------+-------+-------+-------+-------+-------+ . Length = 19 | +-------+-------+-------+-------+-------+-------+-------+-------+ | ’e’ | ’x’ | ’a’ | ’m’ | ’p’ | ’l’ | ’e’ | ’. Length = 223 | +-------+-------+-------+-------+-------+-------+-------+-------+ | 0x21 | 0x63 | 0xbc | 0x1d | 0x0a | 0xd8 | 0x23 | 0x71 | +-------+-------+-------+-------+-------+-------+-------+-------+ . Standards Track [Page 52] . . . Length = 50 | ’g’ | ’r’ | ’u’ | ’m’ | +-------+-------+-------+-------+-------+-------+-------+-------+ . et al. . +-------+-------+-------+-------+-------+-------+-------+-------+ | 0x2f | 0xd7 | 0x96 | 0x6b | 0x8c | 0x7f | 0x92 |Padding| +-------+-------+-------+-------+-------+-------+-------+-------+ | Futuristic-Acct-Record Header (AVP Code = 15930). . .’ | +-------+-------+-------+-------+-------+-------+-------+-------+ | ’c’ | ’o’ | ’m’ |Padding| Session-Id AVP Header | +-------+-------+-------+-------+-------+-------+-------+-------+ | (AVP Code = 263). .
Standards Track [Page 53] . the short form DiamIdent is used to represent DiameterIdentity. possible flag values and whether the AVP MAY be encrypted. Similarly. Diameter Base Protocol AVPs The following table describes the Diameter AVPs defined in the base protocol. For the originator of a Diameter message. et al. redirect or relay) then the message MUST NOT be sent unless there is end-to-end security between the originator and the recipient or the originator has locally trusted configuration that indicates that end-to-end security is not needed. "Encr" (Encryption) means that if a message containing that AVP is to be sent via a Diameter agent (proxy.5. Calhoun.RFC 3588 Diameter Based Protocol September 2003 4. Due to space constraints.. for the originator of a Diameter message. a "P" in the "MAY" column means that if a message containing that AVP is to be sent via a Diameter agent (proxy. types. their AVP Code values.
M | N | Host | | | | | | Event-Timestamp 55 8.6 Grouped | M | P | | V | N | Result | | | | | | -----------------------------------------|----+-----+----+-----|----| Calhoun.4 DiamIdent | | P | | V.7 Enumerated | M | P | | V | N | Type | | | | | | Authorization291 8.8.7 Enumerated | M | P | | V | Y | Realtime-Required | | | | | | Acct50 9. Standards Track [Page 54] .15 Grouped | M | P | | V | Y | Error-Message 281 7.10 Unsigned32 | M | P | | V | N | Period | | | | | | Auth-Session277 8.1 Enumerated | M | P | | V | Y | Record-Type | | | | | | Accounting44 9.3 UTF8String | | P | | V.6 DiamIdent | M | P | | V | N | Realm | | | | | | Disconnect-Cause 273 5.12 Enumerated | M | P | | V | N | Type | | | | | | Class 25 8.8 Unsigned32 | M | P | | V | N | Application-Id | | | | | | Auth-Request274 8.RFC 3588 Diameter Based Protocol September 2003 +---------------------+ | AVP Flag rules | |----+-----+----+-----|----+ AVP Section | | |SHLD| MUST| | Attribute Name Code Defined Data Type |MUST| MAY | NOT| NOT|Encr| -----------------------------------------|----+-----+----+-----|----| Acct85 9.8.6 Unsigned64 | M | P | | V | Y | Sub-Session-Id | | | | | | Acct259 6.11 Enumerated | M | P | | V | N | State | | | | | | Re-Auth-Request.21 Time | M | P | | V | N | Experimental297 7.3 Unsigned32 | M | P | | V | Y | Record-Number | | | | | | Accounting480 9.5 DiamIdent | M | P | | V | N | Destination283 6.4 OctetString| M | P | | V | Y | Session-Id | | | | | | Accounting287 9.8.20 OctetString| M | P | | V | Y | Destination-Host 293 6.285 8.M | N | Error-Reporting. et al.3 Enumerated | M | P | | V | N | E2E-Sequence AVP 300 6.8.8.2 Unsigned32 | M | P | | V | Y | Interim-Interval | | | | | | Accounting483 9.294 7.9 Unsigned32 | M | P | | V | N | Lifetime | | | | | | Auth-Grace276 8.8.4.5 UTF8String | M | P | | V | Y | Multi-Session-Id | | | | | | Accounting485 9.8.9 Unsigned32 | M | P | | V | N | Application-Id | | | | | | Auth258 6.
10 Unsigned32 | | | | | | Multi-Round272 8.8 UTF8String | M | P | | V | Y | Session-Timeout 27 8.15 Enumerated | M | P | | V | N | Cause | | | | | | User-Name 1 8.19 Unsigned32 | M | P | | V | Y | Time-Out | | | | | | Origin-Host 264 6.3 DiamIdent | M | P | | V | N | Origin-Realm 296 6.271 8.7.3.3.17 Unsigned32 | M | P | | V | Y | Session-Server.3.14 UTF8String | M | P | | V | Y | Vendor-Id 266 5.5 Grouped | M | P | | V | N | Firmware267 5.1 Unsigned32 | M | P | | V | N | Route-Record 282 6.7.12 DiamURI | M | P | | V | N | Redirect-Host261 6.3.7.7 Unsigned32 | M | P | | V | N | Result-Code | | | | | | Failed-AVP 279 7.V | N | Proxy-Info 284 6.4 OctetString| M | | | P.V.13 Unsigned32 | M | P | | V | N | Session-Binding 270 8.11 Grouped | M | P | | V | N | Application-Id | | | | | | -----------------------------------------|----+-----+----+-----|----| Calhoun.14 Unsigned32 | M | P | | V | N | Cache-Time | | | | | | Result-Code 268 7.M| N | Revision | | | | | | Host-IP-Address 257 5.18 Enumerated | M | P | | V | Y | Failover | | | | | | Supported265 5.7 UTF8String | | | |P.6 Unsigned32 | M | P | | V | N | Vendor-Id | | | | | | Termination295 8.M| N | Proxy-Host 280 6.7.3 Unsigned32 | M | P | | V | N | Vendor-Specific.4 DiamIdent | M | P | | V | N | Origin-State-Id 278 8.4 Unsigned32 | | | |P.V | N | Proxy-State 33 6.V | N | Redirect-Host 292 6.3 DiamIdent | M | | | P.16 Unsigned32 | M | P | | V | N | Product-Name 269 5.3.RFC 3588 Diameter Based Protocol September 2003 +---------------------+ | AVP Flag rules | |----+-----+----+-----|----+ AVP Section | | |SHLD| MUST|MAY | Attribute Name Code Defined Data Type |MUST| MAY | NOT| NOT|Encr| -----------------------------------------|----+-----+----+-----|----| Experimental298 7. et al.1 DiamIdent | M | | | P.V. Standards Track [Page 55] .260 6.V | N | Session-Id 263 8.13 Enumerated | M | P | | V | N | Usage | | | | | | Redirect-Max262 6.5 Address | M | P | | V | N | Inband-Security | M | P | | V | N | -Id 299 6.2 Grouped | M | | | P.
Note that a given peer MAY act as a primary for a given realm. The peer is moved to the closed state. There are two ways that a peer is removed from the suspect peer list: 1. a node MAY have additional connections. Typically. et al. it may not be economical to have an established connection to all of them. 5. Three watchdog messages are exchanged with accepted round trip times. Diameter Peers This section describes how Diameter nodes establish connections and communicate with peers. known as the primary and secondary peers.2. but in the event that failover procedures are invoked. These are based Calhoun. the following mechanisms are described. In the event the peer being removed is either the primary or secondary.RFC 3588 Diameter Based Protocol September 2003 5. causing the transport connection to be shutdown. 2. including not receiving a DWA within an allotted timeframe. Of course.1. and assume the role of either primary or secondary. 5. Diameter Peer Discovery Allowing for dynamic Diameter agent discovery will make it possible for simpler and more robust deployment of Diameter services. Peer Connections Although a Diameter node may have many possible peers that it is able to communicate with. However. no new requests should be forwarded to the peer. When a peer is deemed suspect. but failover procedures are invoked. if it is deemed necessary. which could occur for various reasons. an alternate peer SHOULD replace the deleted peer. a Diameter node SHOULD have an established connection with two peers per realm. any pending requests are sent to the secondary peer. In order to promote interoperable implementations of Diameter peer discovery. implementations are free to load balance requests between a set of peers. The peer is no longer reachable. all messages for a realm are sent to the primary peer. At a minimum. When an active peer is moved to this mode. additional connections SHOULD be established to ensure that the necessary number of active connections exists. Standards Track [Page 56] . while acting as a secondary for another realm. and the connection to the peer is considered stabilized.
There are two cases where Diameter peer discovery may be performed. As per RFC 2915 [NAPTR].for further handling of a Diameter operation. the client Calhoun. The Diameter implementation performs a NAPTR query for a server in a particular realm. This is discussed further in Appendix A. for example. The first option (manual configuration) MUST be supported by all DIAMETER nodes. where x is a letter that corresponds to a transport protocol supported by the domain. The Diameter implementation consults its list of static (manually) configured Diameter agent locations. We also establish an IANA registry for NAPTR service name to transport protocol mappings. Standards Track [Page 57] . This could be deduced. It is recommended that SLPv2 security be deployed (this requires distributing keys to SLPv2 agents). These will be used if they exist and respond.RFC 3588 Diameter Based Protocol September 2003 on existing IETF standards. The first is when a Diameter client needs to discover a first-hop Diameter agent. The Diameter implementation uses SLPv2 [SLP] to discover Diameter services. In both cases. If the server supports multiple transport protocols.1 The services relevant for the task of transport protocol selection are those with NAPTR service fields with values "AAA+D2x". The resource record will contain an empty regular expression and a replacement value. et al. The second case is when a Diameter agent needs to discover another agent . The Diameter service template [TEMPLATE] is included in Appendix A. the following ’search order’ is recommended: 1. each with a different service value. which is the SRV record for that particular transport protocol. This specification defines D2T for TCP and D2S for SCTP. 3. These NAPTR records provide a mapping from a domain. to the SRV record for contacting a server with the specific transport protocol in the NAPTR services field. there will be multiple NAPTR records. SLPv2 security SHOULD be used (requiring distribution of keys to SLPv2 agents) in order to ensure that discovered peers are authorized for their roles. while the latter two options (SRVLOC and DNS) MAY be supported. 3. SLPv2 is discussed further in Appendix A. 2. from the ’realm’ in a NAI that a Diameter implementation needed to perform a Diameter operation on. The Diameter implementation has to know in advance which realm to look for a Diameter agent in.
for values of X that indicate transport protocols supported by the client. A dynamically discovered peer causes an entry in the Peer Table (see Section 2. but this does not imply that it is authorized to act as a Diameter Server. an attacker could modify the DNS records to contain replacement values in a different domain._tcp’. If no NAPTR records are found.2 A client MUST discard any service fields that identify a resolution service whose value is not "D2X". The NAPTR processing as described in RFC 2915 will result in discovery of the most preferred transport protocol of the server that is supported by the client. For the purposes of this specification.realm. and secured RRs may be included in the DNS.RFC 3588 Diameter Based Protocol September 2003 discards any records whose services fields are not applicable. as well as an SRV record for the server. chosen according to the requestor’s network protocol capabilities. 3. Address records include A RR’s. and the client could not validate that this was the desired behavior. by configuration of a Diameter Server CA. Otherwise. the Diameter Peer MUST check to make sure that the discovered peers are authorized to act in its role. Similarly. Note that entries created via DNS MUST expire (or be refreshed) within the DNS TTL. the domain name in the query and the domain name in the replacement field MUST both be valid based on the site certificate handed out by the server in the TLS or IKE exchange. If the DNS server returns no address records. the requestor gives up. or validation of DNS RRs via DNSSEC is not sufficient to conclude this. Standards Track [Page 58] . Alternatively this can be achieved by definition of OIDs within TLS or IKE certificates so as to signify Diameter Server authorization. The domain suffixes in the NAPTR replacement field SHOULD match the domain of the original query. ’_diameter. et al. the domain name in the SRV query and the domain name in the target in the SRV record MUST both be valid based on the same site certificate._sctp’.realm or ’_diameter.6) to be created. For example. or the result of an attack Also. AAAA RR’s or other similar records. a web server may have obtained a valid TLS certificate. the requester queries for those address records for the destination address. Authentication via IKE or TLS. If the server is using a site certificate. several rules are defined. Authorization can be achieved for example. 4. If a peer is discovered Calhoun.
security mechanisms. and SHOULD disconnect the transport layer connection. they MUST exchange the Capabilities Exchange messages. If the local policy permits receiving CERs from unknown hosts.6). the ’E’ bit is set in the answer Calhoun. In case of a transport failure. the transport connection is closed. a receiver of a Capabilities-Exchange-Req (CER) message that does not have any security mechanisms in common with the sender MUST return a Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. and SHOULD disconnect the transport layer connection. etc. et al. This message allows the discovery of a peer’s identity and its capabilities (protocol version number.) The receiver only issues support for the Diameter Diameter node MUST cache ensure that unrecognized sent to a peer. If a CER from an unknown peer is answered with a successful CEA.3. the lifetime of the peer entry is equal to the lifetime of the transport connection. it is still possible that an upstream agent receives a message for which it has no available peers to handle the application that corresponds to the Command-Code. Capabilities Exchange When two Diameter peers establish a transport connection.RFC 3588 Diameter Based Protocol September 2003 outside of the local realm.4) MUST be interpreted as having common applications with the peer. redirected or relayed. commands to its peers that have advertised application that defines the command. The CER and CEA messages MUST NOT be proxied. In both cases. Since the CER/CEA messages cannot be proxied. all the pending transactions destined to the unknown peer can be discarded. as specified in the peer state machine (see Section 5. The routing table entry’s expiration MUST match the peer’s expiration value. Similarly.7) for the peer’s realm is created. 5. supported Diameter applications. a routing table entry (see Section 2. Note that receiving a CER or CEA from a peer advertising itself as a Relay (see Section 2. Standards Track [Page 59] . CERs received from unknown peers MAY be silently discarded. or a CEA MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. In such instances..
3. indicated by the CommandCode set to 257 and the Command Flags’ ’R’ bit set. re-routing request to an alternate peer). indicated by the Command-Code set to 257 and the Command Flags’ ’R’ bit cleared. REQ > Origin-Host } Origin-Realm } Host-IP-Address } Vendor-Id } Product-Name } Origin-State-Id ] Supported-Vendor-Id ] Auth-Application-Id ] Inband-Security-Id ] Acct-Application-Id ] Vendor-Specific-Application-Id ] Firmware-Revision ] AVP ] Capabilities-Exchange-Answer The Capabilities-Exchange-Answer (CEA). Calhoun.) with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action (e. the Capabilities-Exchange-Request message MUST contain one Host-IPAddress AVP for each potential IP address that MAY be locally used when transmitting Diameter messages. Message Format <CER> ::= < { { 1* { { { [ * [ * [ * [ * [ * [ [ * [ 5. With the exception of the Capabilities-Exchange-Request message. a message of type Request that includes the Auth-Application-Id or Acct-Application-Id AVPs. is sent in response to a CER message.RFC 3588 Diameter Based Protocol September 2003 message (see Section 7. Diameter Header: 257. MAY only be forwarded to a host that has explicitly advertised support for the application (or has advertised the Relay Application Identifier).3..g. Capabilities-Exchange-Request The Capabilities-Exchange-Request (CER). Upon detection of a transport failure. et al. which allows for connections to span multiple interfaces and multiple IP addresses. 5. Standards Track [Page 60] . is sent to exchange local capabilities. or a message with an application-specific command code. When Diameter is run over SCTP [SCTP]. this message MUST NOT be sent to an alternate peer.1.2.
5.4.3. hence.3. In combination with the Supported-Vendor-Id AVP (Section 5. It is also envisioned that the combination of the Vendor-Id. which allows connections to span multiple interfaces. Firmware-Revision AVP The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is used to inform a Diameter peer of the firmware revision of the issuing device..4) AVPs MAY provide very useful debugging information. the Capabilities-Exchange-Answer message MUST contain one Host-IP-Address AVP for each potential IP address that MAY be locally used when transmitting Diameter messages.3.3.3. Calhoun. et al. Standards Track [Page 61] . Message Format <CEA> ::= < { { { 1* { { { [ [ * [ * [ * [ * [ * [ * [ [ * [ 5. this MAY be used in order to know which vendor specific attributes may be sent to the peer. Product-Name (Section 5. A Vendor-Id value of zero in the CER or CEA messages is reserved and indicates that this field is ignored.7) and the Firmware-Revision (Section 5.6).RFC 3588 Diameter Based Protocol September 2003 When Diameter is run over SCTP [SCTP]. multiple IP addresses.
In these cases.. 5. 5. Upon receipt of the message. for instance).RFC 3588 Diameter Based Protocol September 2003 For devices that do not have a firmware revision (general purpose computers running Diameter software modules.g.3.7. the Calhoun. In the event that the disconnect was a result of either a shortage of internal resources. or that the peer has rebooted. The Disconnect-Peer-Request message is used by a Diameter node to inform its peer of its intent to disconnect the transport layer. The Disconnection-Reason AVP contains the reason the Diameter node issued the Disconnect-Peer-Request message. message to be forwarded).3.6. the peer may periodically attempt to reconnect. et al. 5. a periodic connection request would not be welcomed. The Product-Name AVP SHOULD remain constant across firmware revisions for the same product.5. or simply that the node in question has no intentions of forwarding any Diameter messages to the peer in the foreseeable future. as stated in Section 2.. and that the peer shouldn’t reconnect unless it has a valid reason to do so (e. and contains the vendor assigned name for the product. Disconnecting Peer connections When a Diameter node disconnects one of its transport connections. the revision of the Diameter software module may be reported instead. its peer cannot know the reason for the disconnect. Host-IP-Address AVP The Host-IP-Address AVP (AVP Code 257) is of type Address and is used to inform a Diameter peer of the sender’s IP address.1. and will most likely assume that a connectivity problem occurred.3. 5.4. This AVP MUST ONLY be used in the CER and CEA messages. Product-Name AVP The Product-Name AVP (AVP Code 269) is of type UTF8String. Standards Track [Page 62] . All source addresses that a Diameter node expects to use with SCTP [SCTP] MUST be advertised in the CER and CEA messages by including a Host-IPAddress AVP for each address.
Disconnect-Peer-Answer The Disconnect-Peer-Answer (DPA). 5. Disconnect-Cause AVP The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. Message Format <DPR> ::= < { { { Diameter Header: 282. Standards Track [Page 63] . Disconnect-Peer-Request The Disconnect-Peer-Request (DPR).4. the transport connection is shutdown. Message Format <DPA> ::= < { { { [ * [ Diameter Header: 282 > Result-Code } Origin-Host } Origin-Realm } Error-Message ] Failed-AVP ] 5. A Diameter node MUST include this AVP in the Disconnect-Peer-Request message to inform the peer of the reason for its intention to shutdown the transport connection.2.RFC 3588 Diameter Based Protocol September 2003 Disconnect-Peer-Answer is returned.3. is sent as a response to the Disconnect-Peer-Request message. Upon detection of a transport failure. this message MUST NOT be sent to an alternate peer.4. et al. indicated by the Command-Code set to 282 and the Command Flags’ ’R’ bit cleared. which SHOULD contain an error if messages have recently been forwarded. is sent to a peer to inform its intentions to shutdown the transport connection. Upon receipt of this message.4. The following values are supported: Calhoun. REQ > Origin-Host } Origin-Realm } Disconnect-Cause } 5. which would otherwise cause a race condition. indicated by the Command-Code set to 282 and the Command Flags’ ’R’ bit set. The receiver of the Disconnect-Peer-Answer initiates the transport disconnect.1. and are likely in flight.
5. Device-Watchdog-Request The Device-Watchdog-Request (DWR). since it does not expect any messages to be exchanged in the near future. et al.5.5.2. defined in this section.1. this message MUST NOT be sent to an alternate peer. DO_NOT_WANT_TO_TALK_TO_YOU 2 The peer has determined that it does not see a need for the transport connection to exist. Upon detection of a transport failure.3). indicated by the Command-Code set to 280 and the Command Flags’ ’R’ bit cleared. 5.RFC 3588 Diameter Based Protocol September 2003 REBOOTING 0 A scheduled reboot is imminent. REQ > Origin-Host } Origin-Realm } Origin-State-Id ] 5. is sent as a response to the Device-Watchdog-Request message.5. Device-Watchdog-Answer The Device-Watchdog-Answer (DWA). and it has determined that the transport connection needs to be closed. is sent to a peer when no traffic has been exchanged between two peers (see Section 5. are used to proactively detect transport failures. Message Format <DWR> ::= < { { [ Diameter Header: 280. Standards Track [Page 64] . Detecting such failures will minimize the occurrence of messages sent to unavailable agents. it is recommended that transport failures be detected as soon as possible. indicated by the Command-Code set to 280 and the Command Flags’ ’R’ bit set.5. resulting in unnecessary delays. and will provide better failover performance. The Device-Watchdog-Request and DeviceWatchdog-Answer messages. BUSY 1 The peer’s internal resources are constrained. Transport Failure Detection Given the nature of the Diameter protocol. Calhoun.
if possible. Such an error requires that the agent return an answer message with the ’E’ bit set and the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. the corresponding request is removed from the queue. it is necessary for all pending request messages to be forwarded to an alternate agent.4. It is important to note that multiple identical requests or answers MAY be received as a result of a failover. All Diameter implementations MUST support the algorithm defined in the specification in order to be compliant to the Diameter base protocol. In order for a Diameter node to perform failover procedures. An example of a case where it is not possible to forward the message to an alternate server is when the message has a fixed destination. The End-to-End Identifier field in the Diameter header along with the Origin-Host AVP MUST be used to identify duplicate messages. it is necessary for the node to maintain a pending message queue for a given peer. When a transport failure is detected. Standards Track [Page 65] . On booting a Diameter client or agent.5. This is commonly referred to as failover. et al. The Hop-by-Hop Identifier field is used to match the answer with the queued request. if possible all messages in the queue are sent to an alternate agent with the T flag set.5. Calhoun. When an answer message is received. Transport Failure Algorithm The transport failure algorithm is defined in [AAATRANS].RFC 3588 Diameter Based Protocol September 2003 Message Format <DWA> ::= < { { { [ * [ [ Diameter Header: 280 > Result-Code } Origin-Host } Origin-Realm } Error-Message ] Failed-AVP ] Original-State-Id ] 5. 5. Failover and Failback Procedures In the event that a transport failure is detected with a peer. and the unavailable peer is the message’s final destination (see Destination-Host AVP). the T flag is also set on any records still remaining to be transmitted in non-volatile storage.3.
as space requires. I-Open and R-Open. DWR and DWA messages are to be used. failover. In the case of an election. Note that the results of an election on one peer are guaranteed to be the inverse of the results on the other. This state machine is closely coupled with the state machine described in [AAATRANS]. a TLS handshake will begin when both ends are in the open state. the initiator connection will survive if the peer’s Origin-Host is higher. Once a connection has been successfully established. state and next state may also span multiple lines. Multiple actions are separated by commas. Calhoun. Standards Track [Page 66] . If the handshake fails. while the R. Note in particular that [AAATRANS] requires the use of watchdog messages to probe connections. All subsequent messages are sent on the surviving connection. a connection request should be periodically attempted with the failed peer in order to re-establish the transport connection. Similarly. If the TLS handshake is successful. all further messages will be sent via TLS. For TLS usage. Each Diameter node MUST follow the state machine described below when communicating with each peer.RFC 3588 Diameter Based Protocol September 2003 As described in Section 2. all other states are intermediate. A CER message is always sent on the initiating connection immediately after the connection request is successfully completed. Peer State Machine This section contains a finite state machine that MUST be observed by all Diameter implementations. This is commonly referred to as failback. probe. and reopen transport connections.6.1. messages can once again be forwarded to the peer.is used to represent the initiator (connecting) connection. The state machine constrains only the behavior of a Diameter implementation as seen by Diameter peers through events on the wire. The stable states that a state machine may be in are Closed. and may continue on succeeding lines. close. Note that I-Open and R-Open are equivalent except for whether the initiator or responder transport connection is used for communication. et al. The responder connection will survive if the Origin-Host of the local Diameter entity is higher than that of the peer. which is used to open. For Diameter. I. one of the two connections will shut down. The lack of a prefix indicates that the event or action is the same regardless of the connection on which the event occurred. both ends move to the closed state.is used to represent the responder (listening) connection. 5. as space requires.
Elect I-Disc Error Error I-Snd-CER. Standards Track [Page 67] . R-Snd-CEA Wait-Conn-Ack I-Rcv-Conn-Ack I-Rcv-Conn-Nack R-Conn-CER Timeout Wait-I-CEA I-Rcv-CEA R-Conn-CER I-Snd-CER Cleanup R-Accept. R-Snd-DWA Process-DWA R-Reject R-Snd-DPR R-Snd-DPA. Process-CER Error Process-CEA R-Accept. R-Snd-CEA R-Disc R-Disc R-Reject Error R-Snd-Message Process Process-DWR. et al. state event action next state ----------------------------------------------------------------Closed Start I-Snd-Conn-Req Wait-Conn-Ack R-Conn-CER R-Accept.Elect R-Snd-CEA R-Disc R-Reject Error I-Disc. R-Open Process-CER.RFC 3588 Diameter Based Protocol September 2003 Any implementation that produces equivalent results is considered compliant.R-Snd-CEA I-Disc. Process-CER..
This is because host and port determine the identity of a Diameter peer. in the general case. For this reason. it is described separately in this section rather than in the state machine above. the Origin-Host that identifies the peer is used to locate the state machine associated with that peer. Because handling of incoming connections up to and including receipt of CER requires logic. possible to know the identity of that peer until a CER is received from it. and the source port of an incoming connection is arbitrary. it is not. I-Disc I-Disc I-Snd-CEA Process-CEA I-Disc R-Disc Error I-Disc R-Disc Closed R-Open R-Open I-Open I-Open I-Open I-Open I-Open Closing Closed Closed I-Open I-Open Closed Closed Closed Closed Closed 5. or if an implementation-defined timeout occurs prior to receipt of CER. I-Snd-DWA Process-DWA R-Reject I-Snd-DPR I-Snd-DPA. et al. the identity of the connecting peer can be uniquely determined from Origin-Host. and await CER. The logic that handles incoming connections SHOULD close and discard the connection if any message other than CER arrives. accept them. Standards Track [Page 68] . Incoming connections When a connection request is received from a Diameter peer. separate from that of any individual state machine associated with a particular peer. Once CER arrives on a new connection. and the new connection and CER are passed to the state machine as an R-Conn-CER event.6. a Diameter peer must employ logic separate from the state machine to receive connection requests. Upon receipt of CER. Calhoun.1.
and the associated CER has arrived. but would occur on one of two possible connections. DPR. we will ignore the -I and -R prefix. In this section. A DPR message from the peer was received. An acknowledgement is received stating that the transport connection has been established. A message other than CER. and the local node was the winner. A message is to be sent.g.RFC 3588 Diameter Based Protocol September 2003 5. A message other than CEA from the peer was received. on system shutdown). DWR or DWA was received. Start The Diameter application has signaled that a connection should be initiated with the peer. et al. An election was held. A positive acknowledgement is received confirming that the transport connection is established. DPA.2. A DPA message from the peer was received. R-Conn-CER Rcv-Conn-Ack Rcv-Conn-Nack Timeout Rcv-CER Rcv-CEA Rcv-Non-CEA Peer-Disc Rcv-DPR Rcv-DPA Win-Election Send-Message Rcv-Message Stop Calhoun.6. Standards Track [Page 69] . A disconnection indication from the peer was received. A CER message from the peer was received. A CEA message from the peer was received. A negative acknowledgement was received stating that the transport connection was not established. Events Transitions and actions in the automaton are caused by events. The Diameter application has signaled that a connection should be terminated (e. since the actual event would be identical. CEA.. An application-defined timer has expired while waiting for some event.
et al. A DWR message is sent. The DWR message is serviced. either politely or abortively. A message is sent. in response to an error condition.6. In this section we will ignore the I. A DPR message is sent to the peer. and any local resources are freed. but would occur on one of two possible connections. A received CEA is processed. An election occurs (see Section 5. Reject Process-CER Snd-CER Snd-CEA Cleanup Error Process-CEA Snd-DPR Snd-DPA Disc Elect Snd-Message Snd-DWR Snd-DWA Process-DWR Calhoun.and R-prefix. the connection is shutdown.6.RFC 3588 Diameter Based Protocol September 2003 5. A DPA message is sent to the peer.4 for more information).3. The CER associated with the R-Conn-CER is processed. A CER message is sent to the peer. and local resources are freed. The transport layer connection is disconnected. since the actual action would be identical. The incoming connection associated with the R-Conn-CER is accepted as the responder connection. A DWA message is sent. Actions Actions in the automaton are caused by events and typically indicate the transmission of packets and/or an action to be taken on the connection. The transport layer connection is disconnected. If necessary. Standards Track [Page 70] . A CEA message is sent to the peer. Snd-Conn-Req Accept A transport connection is initiated with the peer. Local resources are freed. The incoming connection associated with the R-Conn-CER is disconnected.
et al. then performing an octet-by-octet unsigned comparison with the first octet being most significant. Any remaining octets are assumed to have value 0x80. 6. The responder compares the Origin-Host received in the CER sent by its peer with its own Origin-Host. Diameter message processing This section describes how Diameter requests and answers are created and processed.1. MUST contain a DestinationRealm AVP. otherwise. a request that needs to be sent to a home server serving a specific realm. in one of these three combinations: a request that is not able to be proxied (such as CER) MUST NOT contain either Destination-Realm or Destination-Host AVPs. a Win-Election event is issued locally.RFC 3588 Diameter Based Protocol September 2003 Process-DWA Process 5.4. The comparison proceeds by considering the shorter OctetString to be padded with zeros so that it length is the same as the length of the longer. The DWA message is serviced. a request that needs to be sent to a specific home server among those serving a given realm. A message is serviced. Calhoun. If the local Diameter entity’s Origin-Host is higher than the peer’s. The Election Process The election is performed on the responder. Diameter Request Routing Overview A request is sent towards its final destination using a combination of the Destination-Realm and Destination-Host AVPs. but not to a specific server (such as the first request of a series of round-trips). 6. - - The Destination-Host AVP is used as described above when the destination of the request is fixed.6. which includes: Authentication requests that span multiple round trips A Diameter message that uses a security mechanism that makes use of a pre-established session key shared between the source and the final destination of the message. Standards Track [Page 71] . MUST contain both the Destination-Realm and Destination-Host AVPs. but MUST NOT contain a Destination-Host AVP.
an answer is returned with the Result-Code set to DIAMETER_UNABLE_TO_DELIVER. the message is processed in the following order: 1. This is known as Request Forwarding. Request messages that may be forwarded by Diameter agents (proxies. See Section 7 for more detail on error handling.4 are followed. with the E-bit set.6 are followed.1. such as the Abort-SessionRequest message. et al. 3.6).7). If the message is intended for a Diameter peer with whom the local host is able to directly communicate. The procedures listed in Section 6. and still comply with the protocol specification. Standards Track [Page 72] . redirects or relays) MUST not include the Destination-Realm in its ABNF. the procedures listed in Section 6. Calhoun..5 are followed. A message that MUST NOT be forwarded by Diameter agents (proxies. all Diameter nodes within the realm MUST be peers. access device). Certain implementations MAY use different methods than the ones described here. When a message is received.1.g. the procedures listed in Section 6. If the message is destined for the local host. If none of the above is successful. which is used to request that a particular user’s session be terminated. Otherwise. an Auth-Application-Id AVP or a Vendor-SpecificApplication-Id AVP.1. For routing of Diameter messages to work within an administrative domain. the request is routed based on the Destination-Realm only (see Sections 6. 4. The Destination-Realm AVP MUST be present if the message is proxiable.1. Note that an agent can forward a request to a host described in the Destination-Host AVP only if the host in question is included in its peer table (see Section 2. which is known as Request Routing. redirects or relays) MUST also contain an AcctApplication-Id AVP. The value of the Destination-Realm AVP MAY be extracted from the User-Name AVP.RFC 3588 Diameter Based Protocol September 2003 - Server initiated messages that MUST be received by a specific Diameter client (e. 2. or other applicationspecific methods. Note the processing rules contained in this section are intended to be used as general guidelines to Diameter developers.
1. Receiving Requests A relay or proxy agent MUST check for forwarding loops when receiving requests. Standards Track [Page 73] . the following procedures MUST be followed: the Hop-by-Hop Identifier should be set to a locally unique value The message should be saved in the list of pending requests. Processing Local Requests A request is known to be for local consumption when one of the following conditions occur: The Destination-Host AVP contains the local host’s identity.3. When such an event occurs. originated either locally.RFC 3588 Diameter Based Protocol September 2003 6. the following procedures MUST be followed: the Command-Code is set to the appropriate value the ’R’ bit is set the End-to-End Identifier is set to a locally unique value the Origin-Host and Origin-Realm AVPs MUST be set to the appropriate values.4.1. in addition to any other procedures described in the application definition for that specific request. or as the result of a forwarding or routing operation. an Acct-Application-Id AVP. et al. used to identify the source of the message the Destination-Host and Destination-Realm AVPs MUST be set to the appropriate values as described in Section 6.1. the agent MUST answer with the Result-Code AVP set to DIAMETER_LOOP_DETECTED. Originating a Request When creating a request. When sending a request. Other actions to perform on the message based on the particular role the agent is playing are described in the following sections. 6. Sending a Request - - 6.1.1. Calhoun.2. 6. an Auth-Application-Id or a VendorSpecific-Application-Id AVP must be included if the request is proxiable.1. A loop is detected if the server finds its own identity in a Route-Record AVP.
the message SHOULD be forwarded to the peer. or Both the Destination-Host and the Destination-Realm are not present.1. redirects or relays) MUST include the target realm in the Destination-Realm AVP and one of the application identification AVPs Auth-Application-Id. The realm portion of the NAI is inserted in the Destination-Realm AVP. Each of the servers associated with the routing entry are added in separate Redirect-Host AVP. Calhoun. and include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Redirecting requests When a redirect agent receives a request whose routing entry is set to REDIRECT. Request Routing Diameter request message routing is done via realms and applications. the Destination-Realm AVP contains a realm the server is configured to process locally. Diameter agents MAY have a list of locally supported realms and applications. 6. and the host encoded in the DestinationHost AVP is one that is present in the peer table. it MUST reply with an answer message with the ’E’ bit set. the message is routed to the peer configured in the Realm Routing Table (see Section 2. When a request is received. - When a request is locally processed. Request Forwarding Request forwarding is done using the Diameter Peer Table. and the Diameter application is locally supported.7). 6. Standards Track [Page 74] .2 should be used to generate the corresponding answer.1. The realm MAY be retrieved from the User-Name AVP. and MAY have a list of externally supported realms and applications. Acct-Application-Id or Vendor-SpecificApplication-Id.6. A Diameter message that may be forwarded by Diameter agents (proxies.5. while maintaining the Hop-by-Hop Identifier in the header. et al.1. which is in the form of a Network Access Identifier (NAI).RFC 3588 Diameter Based Protocol September 2003 - The Destination-Host AVP is not present.7. 6. the rules in Section 6. The Diameter peer table contains all of the peers that the local node is able to directly communicate with. When a request is received that includes a realm and/or application that is not locally supported.
The source of the request is also saved. one is created. Standards Track [Page 75] . which includes the IP address. it MAY simply use local storage to store state information.net | | Relay | | Diameter | | Agent |<-------------| Server | +-------------+ 4. Alternatively.1. port and protocol. command + ’E’ bit 1. and replaced with a locally unique value. Request | | Result-Code = joe@example.8. and the Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-byhop field in the Diameter header to identify the request in the pending message queue (see Section 5. The AVP contains the identity of the peer the request was received from. If no transport connection exists with the new agent.3) that is to be redirected. Relaying and Proxying Requests A relay or proxy agent MUST append a Route-Record AVP to all requests forwarded.RFC 3588 Diameter Based Protocol September 2003 +------------------+ | Diameter | | Redirect Agent | +------------------+ ^ | 2.com | | DIAMETER_REDIRECT_INDICATION + | | Redirect-Host AVP(s) | v +-------------+ 3. et al. Proxy-Info AVP has certain security implications and SHOULD contain an embedded HMAC with a node-local key. A relay or proxy agent MAY include the Proxy-Info AVP in requests if it requires access to any local state information when the corresponding response is received. as identified in the Realm Routing Table. Request +-------------+ | example. Multiple Redirect-Host AVPs are allowed. 6.com |------------->| example. and the request is sent directly to it. The receiver of the answer message with the ’E’ bit set selects exactly one of these hosts as the destination of the redirected message. The message is then forwarded to the next hop. Answer +-------------+ Figure 5: Diameter Redirect Agent The receiver of the answer message with the ’E’ bit set. The Hop-by-Hop identifier in the request is saved. Calhoun.
example.RFC 3588 Diameter Based Protocol September 2003 Figure 6 provides an example of message routing using the procedures listed in these sections.com) (Origin-Realm=example.2. - - - - - Calhoun.net) (Destination-Realm=example.net) (Origin-Realm=mno.mno. (Origin-Host=nas.example. The ’P’ bit is set to the same value as the one in the request. et al.com) Figure 6: Routing of Diameter messages 6. in addition to any additional procedures that MAY be discussed in the Diameter application defining the command: The same Hop-by-Hop identifier in the request is used in the answer. The local host’s identity is encoded in the Origin-Host AVP. Standards Track [Page 76] .net) (Origin-Realm=mno. it MUST be included in the answer. The same End-to-End identifier in the request is used in the answer. the following procedures MUST be applied to create the associated answer.net) (Origin-Host=nas.com) (Origin-Host=hms.net (Answer) example.net (Answer) example.net) +------+ ------> +------+ ------> +------+ | | (Request) | | (Request) | | | NAS +-------------------+ DRL +-------------------+ HMS | | | | | | | +------+ <-----+------+ <-----+------+ example. The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. The Result-Code AVP is added with its value indicating success or failure.com) (Origin-Realm=example. If the Session-Id is present in the request. Any Proxy-Info AVPs in the request MUST be added to the answer message.com (Origin-Host=hms.mno. in the same order they were present in the request.com) (Route-Record=nas.example.com) (DestinationRealm=example. Diameter Answer Processing When a request is locally processed.
6. Relaying and Proxying Answers If the answer is for a request which was proxied or relayed.2. it MUST NOT modify the contents of the AVP. It SHOULD ignore answers received that do not match a known Hop-by-Hop Identifier. If the last Proxy-Info AVP in the message is targeted to the local Diameter server.3. Processing received Answers A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an answer received against the list of pending requests. Relay agents MUST NOT modify this AVP. et al. The corresponding message should be removed from the list of pending requests. The agent MUST then send the answer to the host that it received the original request from.2. 6. Note that the Origin-Host AVP may resolve to more than one address as the Diameter peer may support more than one address. and MUST be present in all Diameter messages. the AVP MUST be removed before the answer is forwarded.1. but not reflected in the Result-Code AVP. and it wishes to modify the AVP to indicate an error.3) are also subjected to the above processing rules. Any additional local errors detected SHOULD be logged.RFC 3588 Diameter Based Protocol September 2003 Note that the error messages (see Section 7. If a relay or proxy agent receives an answer with a Result-Code AVP indicating a failure. Calhoun. 6. the agent MUST restore the original value of the Diameter header’s Hopby-Hop Identifier field. Origin-Host AVP The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity. If the agent receives an answer message with a Result-Code AVP indicating success. Standards Track [Page 77] . This AVP identifies the endpoint that originated the Diameter message. The value of the Origin-Host AVP is guaranteed to be unique within a single host.2. it MUST modify the Result-Code AVP to contain the appropriate error in the message destined towards the access device as well as include the Error-Reporting-Host AVP and it MUST issue an STR on behalf of the access device.
6. Routing AVPs The AVPs defined in this section are Diameter AVPs used for routing purposes. Origin-Realm AVP The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity.5. Destination-Realm AVP The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity. Diameter servers initiating a request message use the value of the Origin-Realm AVP from a previous message received from the intended target host (unless it is known a priori). This AVP contains the Realm of the originator of any Diameter message and MUST be present in all messages. 6.4. These AVPs change as Diameter messages are processed by agents. This AVP MUST be present in all unsolicited agent initiated messages. This AVP SHOULD be placed as close to the Diameter header as possible. MAY be present in request messages. Calhoun. et al. This AVP SHOULD be placed as close to the Diameter header as possible.RFC 3588 Diameter Based Protocol September 2003 This AVP SHOULD be placed as close to the Diameter header as possible.10 6. When present. Destination-Host AVP The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. Diameter Clients insert the realm portion of the User-Name AVP. and contains the realm the message is to be routed to.7. and therefore MUST NOT be protected by end-to-end security. and MUST NOT be present in Answer messages. This AVP SHOULD be placed as close to the Diameter header as possible. The absence of the Destination-Host AVP will cause a message to be sent to any Diameter server supporting the application within the realm specified in Destination-Realm AVP. 6. Standards Track [Page 78] .6. 6. the Destination-Realm AVP is used to perform message routing decisions. Request messages whose ABNF does not list the Destination-Realm AVP as a mandatory AVP are inherently non-routable messages. The Destination-Realm AVP MUST NOT be present in Answer messages.
6.4). Proxy-State AVP The Proxy-State AVP (AVP Code 33) is of type OctetString.10. et al. The identity added in this AVP MUST be the same as the one received in the Origin-Host of the Capabilities Exchange message. The Acct-Application-Id MUST also be present in all Accounting messages.7. 6.7. The Auth-Application-Id MUST also be present in all Authentication and/or Authorization messages that are defined in a separate Diameter specification and have an Application ID assigned. Auth-Application-Id AVP The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and is used in order to advertise support of the Authentication and Authorization portion of an application (see Section 2.8.7.1. This AVP contains the identity of the host that added the Proxy-Info AVP.3. Standards Track [Page 79] .7. and MUST be treated as opaque data. Acct-Application-Id AVP The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and is used in order to advertise support of the Accounting portion of an application (see Section 2. 6. and contains state local information. Data field has the following ABNF grammar: Proxy-Info ::= < { { * [ 6.9. Calhoun. Route-Record AVP The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. 6. Proxy-Host AVP AVP Header: 284 > Proxy-Host } Proxy-State } AVP ] The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. 6. Proxy-Info AVP The Grouped The Proxy-Info AVP (AVP Code 284) is of type Grouped. Exactly one of the AuthApplication-Id and Acct-Application-Id AVPs MAY be present.2.4).4.RFC 3588 Diameter Based Protocol September 2003 6. Inband-Security-Id AVP The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and is used in order to advertise support of the Security portion of the application.
Standards Track [Page 80] . AVP Format <Vendor-Specific-Application-Id> ::= < 1* [ 0*1{ 0*1{ 6..12. This AVP MAY be present in answer messages whose ’E’ bit is set and the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. Upon receiving the above.11. but there is ample room to add new security Ids. Calhoun. Exactly one of the Auth-Application-Id and Acct-Application-Id AVPs MAY be present. The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type Grouped and is used to advertise support of a vendor-specific Diameter Application. if the AVP is omitted. This AVP MUST also be present as the first AVP in all experimental commands defined in the vendor-specific application. NO_INBAND_SECURITY 0 This peer does not support TLS.13. the following values are supported. the receiving Diameter node SHOULD forward the request directly to one of the hosts identified in these AVPs. TLS 1 This node supports TLS security.RFC 3588 Diameter Based Protocol September 2003 Currently. This AVP SHOULD be placed as close to the Diameter header as possible. This is the default value. as defined by [TLS]. The server contained in the selected Redirect-Host AVP SHOULD be used for all messages pertaining to this session. Vendor-Specific-Application-Id AVP 6. 6. et al.
ALL_APPLICATION 4 All messages for the application requested MAY be sent to the host specified in the Redirect-Host AVP.14. ALL_USER 6 All messages for the user requested MAY be sent to the host specified in the Redirect-Host AVP. created as a result of the Redirect-Host. The following values are supported: DONT_CACHE 0 The host specified in the Redirect-Host AVP should not be cached. This AVP MUST be present in answer messages whose ’E’ bit is set. ALL_SESSION 1 All messages within the same session. REALM_AND_APPLICATION 3 All messages for the application requested to the realm specified MAY be sent to the host specified in the Redirect-Host AVP. This AVP contains the maximum number of seconds the peer and route table entries. ALL_HOST 5 All messages that would be sent to the host that generated the Redirect-Host MAY be sent to the host specified in the RedirectHost AVP. Standards Track [Page 81] . Note that once a host created due to a redirect indication is no longer reachable. the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the Redirect-Host-Usage AVP set to a non-zero value. This is the default value.RFC 3588 Diameter Based Protocol September 2003 When present. any associated peer and routing table entries MUST be deleted. et al. this AVP dictates how the routing entry resulting from the Redirect-Host is to be used. will be cached. 6. as defined by the same value of the Session-ID AVP MAY be sent to the host specified in the Redirect-Host AVP. Redirect-Max-Cache-Time AVP The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. Calhoun. ALL_REALM 2 All messages destined for the realm requested MAY be sent to the host specified in the Redirect-Host AVP.
Application errors. As the answer is sent back towards the originator of the request. answer + ’E’ set | Relay 2 | +--------+ |Diameter |<-+ (Unable to Forward) +---------+ |Diameter| | | | Home | | Relay 1 |--+ +---------+ | Server | +---------+ | 3. E2E-Sequence AVP The E2E-Sequence AVP (AVP Code 300) provides anti-replay protection for end to end messages and is of type grouped. This AVP MUST be included in all messages which use end-to-end protection (e. Given that this error falls Calhoun... user authentication. 1. an answer message is returned with the ’E’ bit set. message routing error). and it detects that it cannot forward the request to the home server. A protocol error is one that occurs at the base protocol level. When the message is received by Relay 2.15. Request +---------+ Link Broken +-------------------------->|Diameter |----///----+ | +---------------------| | v +------+--+ | 2. Request |Diameter | +--------+ +-------------------->| | ^ | Relay 3 |-----------+ +---------+ Figure 7: Example of Protocol Error causing answer message Figure 7 provides an example of a message forwarded upstream by a Diameter relay.. When a request message is received that causes a protocol error. Result-Code AVP values that are used to report protocol errors MUST only be present in answer messages whose ’E’ bit is set. 7. et al.g. and MAY require per hop attention (e. CMS signing or encryption). It contains a random value (an OctetString with a nonce) and counter (an Integer). protocol and application errors. each proxy or relay agent MAY take action on the message. an answer message is returned with the ’E’ bit set and the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. Missing AVP).g. Standards Track [Page 82] . and the Result-Code AVP is set to the appropriate protocol error value. generally occur due to a problem with a function specified in a Diameter application (e. For each end-to-end peer with which a node communicates (or remembers communicating) a different nonce value MUST be used and the counter is initiated at zero and increases by one each time this AVP is emitted to that peer. on the other hand.g.RFC 3588 Diameter Based Protocol September 2003 6. Error Handling There are two different types of errors in Diameter.
the Diameter node that sets the Result-Code AVP to indicate the error MUST add the AVPs. Answer +---------+ 3. A command is received with an AVP that is omitted. Relay 1 would take special action. When application errors occur. An AVP that is received with an unrecognized value causes an answer to be returned with the Result-Code AVP set to DIAMETER_INVALID_AVP_VALUE. In these cases. In case there are multiple errors. the Diameter entity reporting the error clears the ’R’ bit in the Command Flags. and the Failed-AVP AVP containing the offending AVP. - - The Result-Code AVP describes the error that the Diameter node encountered in its processing. and creates an AVP with the AVP Code and other fields set as expected in the missing AVP. and given the error. +---------+ 1. attempt to route the message through its alternate Relay 3. The created AVP is then added to the FailedAVP AVP. and adds the Result-Code AVP with the proper value. the Diameter node MUST report only the first error it encountered Calhoun. Request +---------+ | Access |------------>|Diameter |------------>|Diameter | | | | | | Home | | Device |<------------| Relay |<------------| Server | +---------+ 4. et al. The receiver issues an answer with the Result-Code set to DIAMETER_MISSING_AVP. Answer +---------+ (Missing AVP) (Missing AVP) Figure 8: Example of Application Error Answer message Figure 8 provides an example of a Diameter message that caused an application error. with the Failed-AVP AVP containing the AVP causing the error. Examples are: An unrecognized AVP is received with the ’M’ bit (Mandatory bit) set. Request +---------+ 2. Standards Track [Page 83] . Application errors do not require any proxy or relay agent involvement. yet is mandatory according to the command’s ABNF. There are certain Result-Code AVP application errors that require additional AVPs to be present in the answer.RFC 3588 Diameter Based Protocol September 2003 within the protocol error category. and therefore the message would be forwarded back to the originator of the request. causes an answer to be sent with the Result-Code AVP set to DIAMETER_AVP_UNSUPPORTED.
all identified by the thousands digit in the decimal notation: 1xxx 2xxx 3xxx 4xxx 5xxx (Informational) (Success) (Protocol Errors) (Transient Failures) (Permanent Failure) A non-recognized class (one whose first digit is not defined in this section) MUST be handled as a permanent failure.1. The specific errors that can be described by this AVP are described in the following section. DIAMETER_MULTI_ROUND_AUTH 1001 This informational error is returned by a Diameter server to inform the access device that the authentication mechanism being used requires multiple round trips.RFC 3588 Diameter Based Protocol September 2003 (detected possibly in some implementation dependent order).4). 7. 7.2. and a subsequent request needs to be issued in order for access to be granted. Calhoun. Standards Track [Page 84] . The Result-Code data field contains an IANA-managed 32-bit address space representing errors (see Section 11.1. Result-Code AVP The Result-Code AVP (AVP Code 268) is of type Unsigned32 and indicates whether a particular request was completed successfully or whether an error occurred. and additional action is required on its part before access is granted. Success Errors that fall within the Success category are used to inform a peer that a request has been successfully completed. All Diameter answer messages defined in IETF applications MUST include one Result-Code AVP.1. DIAMETER_SUCCESS 2001 The Request was successfully completed. Diameter provides the following classes of errors. A non-successful Result-Code AVP (one containing a non 2xxx value other than DIAMETER_REDIRECT_INDICATION) MUST include the Error-Reporting-Host AVP if the host setting the Result-Code AVP is different from the identity encoded in the Origin-Host AVP.1. 7. Informational Errors that fall within this category are used to inform the requester that a request could not be satisfied. et al.
either because no host within the realm supporting the required application was available to process the request. This error MUST only be used when a specific server is requested. if it is possible. This MUST be used when a Diameter node receives an experimental command that it does not understand. DIAMETER_REALM_NOT_SERVED 3003 The intended realm of the request is not recognized. and it cannot provide the requested service.3.1. Protocol Errors Errors that fall within the Protocol Error category SHOULD be treated on a per-hop basis.RFC 3588 Diameter Based Protocol September 2003 DIAMETER_LIMITED_SUCCESS 2002 When returned. but additional processing is required by the application in order to provide service to the user. if one is available. Calhoun. DIAMETER_COMMAND_UNSUPPORTED 3001 The Request contained a Command-Code that the receiver did not recognize or support. DIAMETER_UNABLE_TO_DELIVER 3002 This error is given when Diameter can not deliver the message to the destination. Standards Track [Page 85] . the request was successfully completed. DIAMETER_REDIRECT_INDICATION 3006 A redirect agent has determined that the request could not be satisfied locally and the initiator of the request should direct the request directly to the server. The message MAY be sent to an alternate peer. 7. the Redirect-Host AVP MUST be present. DIAMETER_LOOP_DETECTED 3005 An agent detected a loop while trying to get the message to the intended recipient. DIAMETER_APPLICATION_UNSUPPORTED 3007 A request was sent for an application that is not supported. et al. whose contact information has been added to the response. a Diameter node SHOULD attempt to send the message to an alternate peer. or because Destination-Host AVP was given without the associated Destination-Realm AVP. but the peer reporting the error has identified a configuration problem. When set. Note that these and only these errors MUST only be used in answer messages whose ’E’ bit is set. DIAMETER_TOO_BUSY 3004 When returned. and Diameter proxies MAY attempt to correct the error.
DIAMETER_OUT_OF_SPACE 4002 A Diameter node received the accounting request but was unable to commit it to stable storage due to a temporary lack of space. DIAMETER_AUTHENTICATION_REJECTED 4001 The authentication process for the user failed. DIAMETER_UNKNOWN_PEER 3010 A CER was received from an unknown peer.1.4.1.. or that is inconsistent with the AVP’s definition. but MAY be able to satisfy the request in the future. Further attempts MUST only be tried after prompting the user for a new password. DIAMETER_AVP_UNSUPPORTED 5001 The peer received a message that contained an AVP that is not recognized or supported and was marked with the Mandatory bit. and should not be attempted again. Standards Track [Page 86] . Transient Failures Errors that fall within the transient failures category are used to inform a peer that the request could not be satisfied at the time it was received.5. DIAMETER_UNKNOWN_SESSION_ID 5002 The request contained an unknown Session-Id. DIAMETER_INVALID_AVP_BITS 3009 A request was received that included an AVP whose flag bits are set to an unrecognized value. A Diameter message with this error MUST contain one or more FailedAVP AVP containing the AVPs that caused the failure. most likely due to an invalid password used by the user. Calhoun. Permanent Failures Errors that fall within the permanent failures category are used to inform the peer that the request failed. et al. or to a value that is inconsistent with the command code’s definition. 7. 7.]
All Diameter answer messages defined in vendor-specific applications MUST include either one Result-Code AVP or one Experimental-Result AVP.RFC 3588 Diameter Based Protocol September 2003 A Diameter message MAY contain one Failed-AVP AVP. Standards Track [Page 90] .6. and a zero filled payload of the minimum required length for the omitted AVP will be added.3. the missing vendor id. and indicates whether a particular vendor-specific request was completed successfully or whether an error occurred. an AVP with the missing AVP code. and can optionally make use of accounting. 8. Its Data field has the following ABNF grammar: AVP Format Experimental-Result ::= < AVP Header: 297 > { Vendor-Id } { Experimental-Result-Code } The Vendor-Id AVP (see Section 5. The first involves authentication and authorization. containing the entire AVP that could not be processed successfully. 7. Diameter User Sessions Diameter can provide two different types of services to applications. If the failure reason is omission of a required AVP. AVP Format <Failed-AVP> ::= < AVP Header: 279 > 1* {AVP} 7.3) in this grouped AVP identifies the vendor responsible for the assignment of the result code which follows. Experimental-Result AVP The Experimental-Result AVP (AVP Code 297) is of type Grouped. Calhoun. The second only makes use of accounting. It is recommended that vendor-specific result codes follow the same conventions given for the Result-Code AVP regarding the different types of result codes and the handling of errors (for non 2xxx values). et al. Experimental-Result-Code AVP The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 and contains a vendor-assigned value representing the result of processing the request.7.
Standards Track [Page 91] .g. The base protocol does not include any authorization request messages.g. implies the maximum length of the session the home realm is willing to be fiscally responsible for. Note that if payment for services is expected by the serving realm from the user’s home realm. However. The Session-Id AVP is a means for the client and servers to correlate a Diameter message with a user session. and a user requests access to the network. the access device MUST follow the server’s directives.. These are used to allow servers that maintain state information to free resources. Calhoun.RFC 3588 Diameter Based Protocol September 2003 When a service makes use of the authentication and/or authorization portion of an application. combined with the Auth-Grace-Period AVP. since these are largely application-specific and are defined in a Diameter application document. which is used in subsequent messages (e. etc) relating to the user’s session. subsequent authorization. after which the server will release all state information related to the user’s session. When a Diameter server authorizes a user to use network resources for a finite amount of time. accounting. et al. Of course. the Diameter client issues an auth request to its local server. The Authorization-Lifetime AVP defines the maximum number of seconds a user MAY make use of the resources before another authorization request is expected by the server. the Authorization-Lifetime AVP. The auth request is defined in a service specific Diameter application (e. it cannot maintain state for the session. the actual cost of services rendered is clearly outside the scope of the protocol. The Auth-Grace-Period AVP contains the number of seconds following the expiration of the Authorization-Lifetime. Services provided past the expiration of the Authorization-Lifetime and Auth-Grace-Period AVPs are the responsibility of the access device. An access device that does not expect to send a re-authorization or a session termination request to the server MAY include the AuthSession-State AVP with the value set to NO_STATE_MAINTAINED as a hint to the server. Note that the value NO_STATE_MAINTAINED MUST NOT be set in subsequent reauthorization requests and answers. NASREQ). If the answer message from the server contains a different value in the Auth-Session-State AVP (or the default value if the AVP is absent). The request contains a Session-Id AVP. If the server accepts the hint.. it agrees that since no session termination message will be received once service to the user is terminated. and it is willing to extend the authorization via a future request. the base protocol does define a set of messages that is used to terminate user sessions. it MUST add the AuthorizationLifetime AVP to the answer message.
When a session is moved to the Idle state.RFC 3588 Diameter Based Protocol September 2003 When a service only makes use of the Accounting portion of the Diameter protocol. or due to the peer sending back a transient failure or temporary protocol error notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the Result-Code AVP of the corresponding Answer command. even in combination with an application. indicated by the value of the Auth-Session-State AVP (or its absence). However. There are four different authorization session state machines supported in the Diameter base protocol. the Session-Id is still used to identify user sessions. One describes the session from a client perspective. Here again. and which MUST be observed by all Diameter implementations that make use of the authentication and/or authorization portion of a Diameter application.1. NASREQ). if applicable. The second two state machines are used when the server does not maintain session state. Authorization Session State Machine This section contains a set of finite state machines. et al. 8. and an answer. representing the life cycle of Diameter sessions. the other from a server perspective. since a session is signaled as being terminated by issuing an accounting stop message. This could be due to the peer being down. Calhoun. the event ’Failure to send X’ means that the Diameter agent is unable to send command X to the desired destination. Any event not listed in the state machines MUST be considered as an error condition. The first two describe a session in which the server is maintaining session state. In the state table. The event ’X successfully sent’ is the complement of ’Failure to send X’. any resources that were allocated for the particular session must be released. the other from a server perspective. one describes the session from a client perspective. The term Service-Specific below refers to a message defined in a Diameter application (e. Standards Track [Page 92] .g. MUST be returned to the originator of the message.. Mobile IPv4. the session termination messages are not used.
et al. Session-Timeout Expires on Access Device Open Open Discon.RFC 3588 Diameter Based Protocol September 2003 The following state machine is observed by a client when state is maintained on the server: CLIENT. Standards Track [Page 93] ..
Cleanup Home server wants to terminate the service Send ASR Discon Open Open Open Calhoun. et al. client will comply with request to end the session Send ASA Discon with Result-Code = SUCCESS. client will not comply with request to end the session Open Authorization-Lifetime + Auth-Grace-Period expires on access device ASR Received STA Received Discon Discon Send ASA Discon Discon. STATEFUL State Event Action New State ------------------------------------------------------------Idle Service-specific authorization Send Open request received. is not authorized specific answer. and successful user is authorized serv. user is not authorized specific answer Service-specific authorization Send Open request received. and user failed serv.RFC 3588 Diameter Based Protocol September 2003 Open ASR Received. and user successful is authorized serv. Idle user/device The following state machine is observed by a server when it is maintaining state for the session: SERVER. Send STR. specific answer Idle Service-specific authorization Send Idle request received. Standards Track [Page 94] . and failed serv. specific answer Service-specific authorization Send Idle request received. Send ASA Open with Result-Code != SUCCESS Send STR Discon Open ASR Received.
Idle The following state machine is observed by a client when state is not maintained on the server: CLIENT. STR Received Send STA. Cleanup. Session-Timeout expires on home server Failure to send ASR Cleanup Idle Open Cleanup Idle Discon Wait. Standards Track [Page 95] .RFC 3588 Diameter Based Protocol September 2003 Open Authorization-Lifetime (and Auth-Grace-Period) expires on home server. Idle user/device Open Calhoun. et al. Idle user/device Discon.. Discon resend ASR Cleanup Idle Discon ASR successfully sent and ASA Received with Result-Code ASA Received Not Discon Any None No Change.
and so on. fraud detection. ordering. correlation. Otherwise. Implementations of Diameter MAY perform checking. the use of this state machine is recommended only in applications where the value of the Accounting-Realtime-Required AVP is DELIVER_AND_GRANT. Note that such tracking is incompatible with the ability to sustain long duration connectivity problems.2. The server side in the accounting state machine depends in some cases on the particular application. and specific successfully processed answer 8. et al. However. The default server side state machine requires the reception of accounting records in any order and at any time. Therefore. Accounting Session State Machine The following state machines MUST be supported for applications that have an accounting portion or that require only accounting services. The tasks can happen either immediately after record reception or in a post-processing phase. The Diameter base protocol defines a default state machine that MUST be followed by all applications that have not specified other state machines. and does not place any standards requirement on the processing of these records. and other tasks based on these records. However. Applications MAY define requirements on when to accept accounting records based on the used value of Accounting-Realtime-Required AVP. Both base Diameter AVPs as well as application specific AVPs MAY be inspected as a part of these tasks. as these tasks are typically application or even policy dependent. credit limits checks. records produced by the client Calhoun. Idle request received.RFC 3588 Diameter Based Protocol September 2003 The following state machine is observed by a server when it is not maintaining state for the session: SERVER. they are not standardized by the Diameter specifications. and hence accounting connectivity problems are required to cause the serviced user to be disconnected. The first state machine is to be observed by clients. the Diameter base protocol defines one optional server side state machine that MAY be followed by applications that require keeping track of the session state at the accounting server. Standards Track [Page 96] .8 for Accounting AVPs. This is the second state machine in this section described below.7 for Accounting Command Codes and Section 9. STATELESS State Event Action New State ------------------------------------------------------------Idle Service-specific authorization Send serv. See Section 9.
The event ’Failed answer’ means that the Diameter client received a non-transient failure notification in the Accounting Answer command. Note that the action ’Disconnect user/dev’ MUST have an effect also to the authorization session state table. cause the STR message to be sent. PendingI.. Ts MAY be set to two times the value of the Acct_Interim_Interval so as to avoid the accounting session in the Diameter server to change to Idle state in case of short transient network failure. or due to the peer sending back a transient failure or temporary protocol error notification DIAMETER_OUT_OF_SPACE. Interim. which the value should be reasonably higher than the Acct_Interim_Interval value. respectively. or DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting Answer command. the event ’Failure to send’ means that the Diameter client is unable to communicate with the desired destination.g. if the given application has both authentication/authorization and accounting portions. The state machine is supervised by a supervision session timer Ts.RFC 3588 Diameter Based Protocol September 2003 may be lost by the server which no longer accepts them after the connectivity is re-established. Stop. and a corresponding answer. This could be due to the peer being down. Standards Track [Page 97] . CLIENT. MUST be returned to the originator of the message. PendingL. et al. In the state table. PendingE and PendingB stand for pending states to wait for an answer to an accounting request related to a Start. ACCOUNTING State Event Action New State ------------------------------------------------------------Idle Client or device requests Send PendingS access accounting start req. The states PendingS. This state machine is the third state machine in this section. DIAMETER_TOO_BUSY. Idle Client or device requests a one-time service Send PendingE accounting event req Send record PendingB Idle Records in storage Calhoun. Any event not listed in the state machines MUST be considered as an error condition. e. if applicable. Event or buffered record.. Standards Track [Page 98] .. Standards Track [Page 99] .
Send Open accounting start answer. STATEFUL ACCOUNTING State Event Action New State ------------------------------------------------------------Idle Accounting start request received. Standards Track [Page 100] . et al. Idle Accounting stop request received. Idle Interim record received. and successfully processed. STATELESS ACCOUNTING State Event Action New State ------------------------------------------------------------Idle Accounting start request received. and successfully processed. and successfully processed. and successfully processed Accounting request received. and successfully processed. and successfully processed. Calhoun. Start Ts Send Idle accounting event answer Idle Accounting event request received.RFC 3588 Diameter Based Protocol September 2003 SERVER. Result-Code = OUT_OF_ SPACE Idle Accounting event request received. Send Idle accounting start answer Send Idle accounting event answer Send Idle accounting interim answer Send Idle accounting stop answer Send Idle accounting answer. no space left to store records Idle SERVER.
Result-Code = OUT_OF_ SPACE Send Open accounting interim answer. Stop Ts Send Idle accounting answer. Result-Code = OUT_OF_ SPACE. and successfully processed Open Accounting request received. no space left to store records Send Idle accounting answer. for pre-paid services. Server-Initiated Re-Auth A Diameter server may initiate a re-authentication and/or reauthorization service for a particular session by issuing a Re-AuthRequest (RAR). Each Diameter application MUST state whether service-initiated re-auth is supported.RFC 3588 Diameter Based Protocol September 2003 Idle Accounting request received. Restart Ts Send Idle accounting stop answer. no space left to store records Open Session supervision timer Ts expired 8. and successfully processed. An access device that receives a RAR message with Session-Id equal to a currently active session MUST initiate a re-auth towards the user. Open Accounting stop request received. the Diameter server that originally authorized a session may need some confirmation that the user is still using the services. Standards Track [Page 101] . if the service supports this particular feature. For example.3. since some applications do not allow access devices to prompt the user for re-auth. et al. Calhoun. Stop Ts Stop Ts Idle Open Interim record received.
3. et al. Message Format <RAR> ::= < < { { { { { { [ [ * [ * [ * [ Diameter Header: 258. Re-Auth-Request The Re-Auth-Request (RAR). PXY > Session-Id > Origin-Host } Origin-Realm } Destination-Realm } Destination-Host } Auth-Application-Id } Re-Auth-Request-Type } User-Name ] Origin-State-Id ] Proxy-Info ] Route-Record ] AVP ] 8. to request that the user be re-authenticated and/or re-authorized. Standards Track [Page 102] .3.2. is sent in response to the RAR. The and The the Re-Auth-Answer Re-Auth-Answer (RAA). indicated by the Command-Code set to 258 and the message flags’ ’R’ bit set. may be sent by any server to the access device that is providing session service.RFC 3588 Diameter Based Protocol September 2003 8. and indicates the disposition of request. A successful RAA message MUST be followed by an application-specific authentication and/or authorization message. indicated by the Command-Code set to 258 the message flags’ ’R’ bit clear. REQ.1. Result-Code AVP MUST be present. Calhoun.
to notify it that the session is no longer active. An STR MUST be issued when a user session terminates for any reason. For sessions whose state is not being maintained. etc. a proxy may modify an authorization answer. PXY > Session-Id > Result-Code } Origin-Host } Origin-Realm } User-Name ] Origin-State-Id ] Error-Message ] Error-Reporting-Host ] Failed-AVP ] Redirect-Host ] Redirect-Host-Usage ] Redirect-Host-Cache-Time ] Proxy-Info ] AVP ] 8. orderly shutdown of the access device. for which it is maintaining state. for example. due to a sudden resource shortage in the access device. termination upon receipt of an Abort-SessionRequest (see below). et al.4. expiration of Session-Timeout. prior to forwarding the message to the access device. or because the access device does not support a mandatory AVP returned in the authorization. Standards Track [Page 103] . both for tracking purposes as well as to allow stateful agents to release any resources that they may have provided for the user’s session. including user logoff. this section is not used. converting the result from success to failure. For example. the access device that provided the service MUST issue a SessionTermination-Request (STR) message to the Diameter server that authorized the service. etc. Session Termination It is necessary for a Diameter server that authorized a session. When a user session that required Diameter authorization terminates. or because the access device is unwilling to provide the type of service requested in the authorization. This could occur. It is also possible that a session that was authorized is never actually started due to action of a proxy. If the answer did not contain an Auth-Session-State AVP with the value Calhoun.RFC 3588 Diameter Based Protocol September 2003 Message Format <RAA> ::= < < { { { [ [ [ [ * [ * [ [ [ * [ * [ Diameter Header: 258. The access device also MUST issue an STR for a session that was authorized but never actually started. to be notified when that session is no longer active. administrative action.
REQ. expiration of either of these timers implies that the access device may have unexpectedly shut down. and return a Session-Termination-Answer.RFC 3588 Diameter Based Protocol September 2003 NO_STATE_MAINTAINED.g.1. is sent by the access device to inform the Diameter Server that an authenticated and/or authorized session is being terminated. et al.4. Standards Track [Page 104] . or when the Authorization-Lifetime and the AuthGrace-Period AVPs expires without receipt of a re-authorization request.. Message Format <STR> ::= < < { { { { { [ [ * [ [ * [ * [ * [ Diameter Header: 275. A Diameter server that receives an STR message MUST clean up resources (e. a proxy that causes an authorized session not to be started MUST issue an STR to the Diameter server that authorized the session. since the access device has no way of knowing that the session had been authorized. indicated by the Command-Code set to 275 and the Command Flags’ ’R’ bit set. session state) associated with the Session-Id specified in the STR. PXY > Session-Id > Origin-Host } Origin-Realm } Destination-Realm } Auth-Application-Id } Termination-Cause } User-Name ] Destination-Host ] Class ] Origin-State-Id ] Proxy-Info ] Route-Record ] AVP ] Calhoun. regardless of whether an STR for that session is received. The access device is not expected to provide service beyond the expiration of these timers. Session-Termination-Request The Session-Termination-Request (STR). thus. 8. A Diameter server also MUST clean up resources when the SessionTimeout expires.
an operator may maintain a management server for the purpose of issuing ASRs to administratively remove users from the network.2.RFC 3588 Diameter Based Protocol September 2003 8. Session-Termination-Answer The Session-Termination-Answer (STA). Any intermediate server in the Proxy-Chain MAY also release any resources. indicated by the Command-Code set to 275 and the message flags’ ’R’ bit clear. On the other hand. PXY > Session-Id > Result-Code } Origin-Host } Origin-Realm } User-Name ] Class ] Error-Message ] Error-Reporting-Host ] Failed-AVP ] Origin-State-Id ] Redirect-Host ] Redirect-Host-Usage ] ^ [ Redirect-Max-Cache-Time ] * [ Proxy-Info ] * [ AVP ] 8. For example. Standards Track [Page 105] . Aborting a Session A Diameter server may request that the access device stop providing service for a particular session by issuing an Abort-Session-Request (ASR). is sent by the Diameter Server to acknowledge the notification that the session has been terminated. the Diameter server that originally authorized the session may be required to cause that session to be stopped for credit or other reasons that were not anticipated when the session was first authorized. An access device that receives an ASR with Session-ID equal to a currently active session MAY stop the session. and MAY contain an indication that an error occurred while servicing the STR. Whether the access Calhoun. Message Format <STA> ::= < < { { { [ * [ [ [ * [ [ * [ [ Diameter Header: 275. if necessary. The Result-Code AVP MUST be present. Upon sending or receipt of the STA. the Diameter Server MUST release all resources for the session indicated by the Session-Id AVP.5. et al.4.
REQ. Result-Code is set to DIAMETER_UNABLE_TO_COMPLY. Note that if the access device does stop the session upon receipt of an ASR. In any case. may be sent by any server to access device that is providing session service.5. If the access device does not stop the session for any other reason. an access device may honor ASRs from certain agents only.RFC 3588 Diameter Based Protocol September 2003 device stops the session or not is implementation. and indicates the disposition of the request. For example. is sent in response to the ASR. indicated by the Command-Code set to 274 and the message flags’ ’R’ bit clear. PXY > Session-Id > Origin-Host } Origin-Realm } Destination-Realm } Destination-Host } Auth-Application-Id } User-Name ] Origin-State-Id ] Proxy-Info ] Route-Record ] AVP ] 8. to request that session identified by the Session-Id be stopped. The Result-Code AVP MUST be present. If the session identified by Session-Id in the ASR was successfully terminated. indicated by the Command-Code set to and the message flags’ ’R’ bit set.and/or configuration-dependent. including a Result-Code AVP to indicate what action it took. Result-Code is set to DIAMETER_UNKNOWN_SESSION_ID. Calhoun.2. The 274 the the Abort-Session-Request Abort-Session-Request (ASR). the access device MUST respond with an Abort-Session-Answer. Result-Code is set to DIAMETER_SUCCESS. it issues an STR to the authorizing server (which may or may not be the agent issuing the ASR) just as it would if the session were terminated for any other reason.5. et al. Standards Track [Page 106] .1. 8. Abort-Session-Answer The Abort-Session-Answer (ASA). Message Format <ASR> ::= < < { { { { { [ [ * [ * [ * [ Diameter Header: 274. If the session is not currently active.
Calhoun. but useful nonetheless. to allow session state to be cleaned up globally. an access device also allows a server with which it communicates via proxy to make such a determination. However. The Diameter server MAY clean up all session state associated with such lost sessions. Standards Track [Page 107] . When a Diameter server receives an Origin-State-Id that is greater than the Origin-State-Id previously received from the same issuer. By including Origin-State-Id in CER/CEA messages. et al. and MAY also issues STRs for all such lost sessions that were authorized on upstream servers. an access device allows a next-hop server to determine immediately upon connection whether the device has lost its sessions since the last connection. due to unanticipated shutdown of an access device. a server that is not directly connected with the access device will not discover that the access device has been restarted unless and until it receives a new request from the access device. use of this mechanism across proxies is opportunistic rather than reliable.6. Inferring Session Termination from Origin-State-Id Origin-State-Id is used to allow rapid detection of terminated sessions for which no STR would have been issued. By including Origin-State-Id in request messages. it may assume that the issuer has lost state since the previous message and that all sessions that were active under the lower Origin-StateId have been terminated. Thus.
The Session-Id MUST begin with the sender’s identity encoded in the DiameterIdentity type (see Section 4.RFC 3588 Diameter Based Protocol September 2003 8. Auth-Request-Type AVP The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is included in application-specific auth requests to inform the peers whether a user is to be authenticated only. Note any value other than both MAY cause RADIUS interoperability issues. and MUST contain the relevant application specific authentication AVPs that are needed by the Diameter server to authenticate the user." character. When present. The Session-Id includes a mandatory portion and an implementation-defined portion. The request MUST include both the relevant application specific authentication information.4). The following values are defined: AUTHENTICATE_ONLY 1 The request being sent is for authentication only. AUTHORIZE_AUTHENTICATE 3 The request contains a request for both authentication and authorization. and authorization information necessary to identify the service being requested/offered. a recommended format for the implementation-defined portion is outlined below. and MAY be any sequence that the client can guarantee to be eternally unique. (square brackets [] indicate an optional element): Calhoun. All messages pertaining to a specific session MUST include only one Session-Id AVP and the same value MUST be used throughout the life of a session. however. Session-Id AVP The Session-Id AVP (AVP Code 263) is of type UTF8String and is used to identify a specific session (see Section 8).7. and may be needed to correlate historical authentication information with accounting information. AUTHORIZE_ONLY 2 The request being sent is for authorization only. The remainder of the Session-Id is delimited by a ". et al. the following format is recommended.8. The Session-Id MUST be globally and eternally unique. and MUST contain the application specific authorization AVPs that are necessary to identify the service being requested/offered. authorized only or both. the Session-Id SHOULD appear immediately following the Diameter Header (see Section 3). as it is meant to uniquely identify a user session without reference to any other information. 8. Standards Track [Page 108] .
or a value of all ones (meaning all bits in the 32 bit field are set to one) means no re-auth is expected. A value of zero (0) means that immediate re-auth is necessary by the access device.<low 32 bits>[. in which there is no optional value: accesspoint7. <optional value> is implementation specific but may include a modem’s device Id.88 The Session-Id is created by the Diameter application initiating the session.1876543210. and a successful auth response with this AVP set to zero is used to signal that the next authentication method is to be immediately initiated. in which there is an optional value: accesspoint7. value could create significant Diameter traffic. et al.1. The 64-bit value is rendered in two part to simplify formatting by 32-bit processors. 8.523 Example. non-zero. This is typically used in cases where multiple authentication methods are used. The absence of this AVP. Note that a Session-Id MAY be used for both the authorization and accounting commands of a given application. which could congest both the network and the agents. This will for practical purposes eliminate the possibility of overlapping Session-Ids after a reboot. Example. and the low 32 bits MAY be initialized to zero. Great care should be taken when the AuthorizationLifetime value is determined.1.mobile@200.<high 32 bits>. Standards Track [Page 109] .com. assuming the reboot process takes longer than a second. etc. since a low. which in most cases is done by the client.<optional value>] <high 32 bits> and <low 32 bits> are decimal representations of the high and low 32 bits of a monotonically increasing 64-bit value.1876543210.acme. At startup. an implementation MAY keep track of the increasing value in non-volatile memory. If both this AVP and the Session-Timeout AVP are present in a message. Alternatively.9. the high 32 bits of the 64-bit value MAY be initialized to the time.523. timestamp.RFC 3588 Diameter Based Protocol September 2003 <DiameterIdentity>. Calhoun. Authorization-Lifetime AVP The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 and contains the maximum number of seconds of service to be provided to the user before the user is to be re-authenticated and/or reauthorized. the value of the latter MUST NOT be smaller than the Authorization-Lifetime AVP.acme.com. a layer 2 address.
the server MAY return a value that is equal to. However. and the access device MUST issue a session termination message when service to the user is terminated. The following values are defined: Calhoun. NO_STATE_MAINTAINED 1 This value is used to specify that no session termination messages will be sent by the access device upon expiration of the Authorization-Lifetime. 8. This is the default value.11.RFC 3588 Diameter Based Protocol September 2003 An Authorization-Lifetime AVP MAY be present in re-authorization messages. This AVP MAY be provided by the client as a hint of the maximum lifetime that it is willing to accept. 8. but the value in the server’s answer message is binding. the Re-Auth-Request-Type AVP MUST be present in an answer message. Standards Track [Page 110] . Auth-Grace-Period AVP The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and contains the number of seconds the Diameter server will wait following the expiration of the Authorization-Lifetime AVP before cleaning up resources for the session. Auth-Session-State AVP The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and specifies whether state is maintained for a particular session. and contains the number of seconds the user is authorized to receive service from the time the re-auth answer message is received by the access device. than the one provided by the client. The following values are supported: STATE_MAINTAINED 0 This value is used to specify that session state is being maintained. or smaller. The client MAY include this AVP in requests as a hint to the server. et al. If the answer message contains an Authorization-Lifetime AVP with a positive value.10. Re-Auth-Request-Type AVP The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and is included in application-specific auth answers to inform the client of the action expected upon expiration of the Authorization-Lifetime. 8.12.
15. A session that terminates on an access device due to the expiration of the Session-Timeout MUST cause an STR to be issued. Standards Track [Page 111] .RFC 3588 Diameter Based Protocol September 2003 AUTHORIZE_ONLY 0 An authorization only re-auth is expected upon expiration of the Authorization-Lifetime. in a format consistent with the NAI specification [NAI]. A Session-Timeout AVP MAY be present in a re-authorization answer message. and contains the remaining number of seconds from the beginning of the re-auth. 8.14. Session-Timeout AVP The Session-Timeout AVP (AVP Code 27) [RADIUS] is of type Unsigned32 and contains the maximum number of seconds of service to be provided to the user before termination of the session. which contains the User-Name. A value of zero. means that this session has an unlimited number of seconds before termination.9). the former MUST be equal to or greater than the value of the latter. User-Name AVP The User-Name AVP (AVP Code 1) [RADIUS] is of type UTF8String. the server MAY return a value that is equal to. et al.13. or the absence of this AVP. AUTHORIZE_AUTHENTICATE 1 An authentication and authorization re-auth is expected upon expiration of the Authorization-Lifetime. This AVP MAY be provided by the client as a hint of the maximum timeout that it is willing to accept. The following values are defined: Calhoun. 8. and is used to indicate the reason why a session was terminated on the access device. than the one provided by the client. When both the Session-Timeout and the Authorization-Lifetime AVPs are present in an answer message. However. unless both the access device and the home server had previously agreed that no session termination messages would be sent (see Section 8. This is the default value if the AVP is not present in answer messages that include the AuthorizationLifetime. 8. Termination-Cause AVP The Termination-Cause AVP (AVP Code 295) is of type Enumerated. or smaller.
Calhoun. DIAMETER_BAD_ANSWER 3 This value indicates that the authorization answer received by the access device was not processed successfully. The Origin-State-Id. Standards Track [Page 112] . counter retained in non-volatile memory create a higher value for A Diameter entity MAY set or it MAY use an incrementing across restarts. for example upon reboot. such as the receipt of a Abort-SessionRequest message. DIAMETER_LINK_BROKEN 5 The communication to the user was abruptly disconnected. and service has been terminated. DIAMETER_AUTH_EXPIRED 6 The user’s access was terminated since its authorized session time has expired. DIAMETER_ADMINISTRATIVE 4 The user was not granted access. DIAMETER_USER_MOVED 7 The user is receiving services from another access device. is a monotonically increasing value that is advanced whenever a Diameter entity restarts with loss of previous state.16. Origin-State-Id AVP The Origin-State-Id AVP (AVP Code 278). Origin-State-Id to the time of startup. MUST reflect the state of the entity indicated by Origin-Host. Origin-State-Id MAY be included in any Diameter message. If a proxy modifies Origin-Host. of type Unsigned32. or was disconnected. due to administrative reasons. including CER. DIAMETER_SESSION_TIMEOUT 8 The user’s session has timed out. if present. et al. it MUST either remove Origin-State-Id or modify it appropriately as well. 8.
the Destination-Host AVP. future re-auth messages for this session MUST NOT include the Destination-Host AVP.RFC 3588 Diameter Based Protocol September 2003 Typically. the Destination-Host AVP MUST be present in the STR message for this session. When cleared. and MAY be present in application-specific authorization answer messages that either do not include the Session-Binding AVP or include the Session-Binding AVP with any of the bits set to a zero value. all accounting messages for this session MUST NOT include the Destination-Host AVP. This field is a bit mask. that is. Standards Track [Page 113] . Origin-State-Id is used by an access device that always starts up with no active sessions. When cleared. STR 2 When set. If present. and MAY be present in application-specific authorization answer messages. and the following bits have been defined: RE_AUTH 1 When set. This AVP MAY also specify that a Session-Termination-Request message for this session MUST be sent to the same authorizing server. this AVP MAY inform the Diameter client that if a Calhoun. the default value. the STR message for this session MUST NOT include the Destination-Host AVP. the Destination-Host AVP MUST be present in all re-auth messages for this session.18. et al. the default value. 8. it MUST either not include Origin-State-Id in any message. 8. By including Origin-State-Id in a message. the default value. if known. ACCOUNTING 4 When set. any session active prior to restart will have been lost. Session-Binding AVP The Session-Binding AVP (AVP Code 270) is of type Unsigned32.17. this AVP MAY inform the Diameter client that all future application-specific re-auth messages for this session MUST be sent to the same authorization server. or set its value to 0. If an access device does not intend for such inferences to be made. it allows other Diameter entities to infer that sessions associated with a lower Origin-State-Id are no longer active. When cleared. If present. MUST be present in all accounting messages for this session. Session-Server-Failover AVP The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated.
Standards Track [Page 114] .20. Class AVPs found in a re-authorization answer message override the ones found in any previous authorization answer message. session termination and accounting messages.19. terminate the session. When absent. TRY_AGAIN 1 If either the re-auth or the STR message delivery fails. assume that re-authorization succeeded. When one or more Class AVPs are present in application-specific authorization answer messages.RFC 3588 Diameter Based Protocol September 2003 re-auth or STR message fails due to a delivery problem. This AVP contains the maximum number of seconds that the access device MUST provide the user in responding to an authentication request. TRY_AGAIN_ALLOW_SERVICE 3 If either the re-auth or the STR message delivery fails. terminate the session. A Diameter client that receives Class AVPs whose size exceeds local available storage MUST terminate the session. Calhoun. resend the failed message without the Destination-Host AVP present. Class AVP The Class AVP (AVP Code 25) is of type OctetString and is used to by Diameter servers to return state information to the access device. The following values are supported: REFUSE_SERVICE 0 If either the re-auth or the STR message delivery fails. ALLOW_SERVICE 2 If re-auth message delivery fails. the Diameter client SHOULD issue a subsequent message without the Destination-Host AVP. resend the failed message without the Destination-Host AVP present. et al. 8. assume re-authorization succeeded. 8. they MUST be present in subsequent re-authorization. If the second delivery fails for re-auth. If the second delivery fails for STR. Multi-Round-Time-Out AVP The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32. and do not attempt any subsequent attempts. the default value is REFUSE_SERVICE. and SHOULD be present in application-specific authorization answer messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. If STR message delivery fails. terminate service with the user. Diameter server implementations SHOULD NOT return Class AVPs that require more than 4096 bytes of storage on the Diameter client.
and is therefore not supported by Diameter. This may be sufficient for many applications. Several fault resilience methods [ACCMGMT] have been built in to the protocol in order minimize loss of accounting data in various fault situations and under different assumptions about the capabilities of the used devices. The Acct-Interim-Interval AVP. a new Diameter application will need to be created. Should batched accounting be required in the future. when present. Calhoun. 1900 00:00 UTC. 9. such as the need to perform credit limit checks and fraud detection. Note that batch accounting is not a requirement.21. Accounting-Realtime-Required AVP is used to control the behavior of the client when the transfer of accounting records from the Diameter client is delayed or unsuccessful. Accounting This accounting protocol is based on a server directed model with capabilities for real-time delivery of accounting information. 9. real-time transfer of accounting records is a requirement. Server Directed Model The server directed model means that the device generating the accounting data gets information from either the authorization server (if contacted) or the accounting server regarding the way accounting data shall be forwarded. transport protocols used under Diameter typically batch several requests in the same packet under heavy traffic conditions. or it could be handled using another protocol.1. in seconds since January 1. and MAY be included in an Accounting-Request and Accounting-Answer messages to record the time that the reported event occurred. however. that even if at the Diameter layer accounting requests are processed one by one. The server (or agents) uses the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to control the operation of the Diameter peer operating as a client. The authorization server (chain) directs the selection of proper transfer strategy. Note. based on its knowledge of the user and relationships of roaming partnerships. et al. Standards Track [Page 115] . As discussed in [ACCMGMT]. Event-Timestamp AVP The Event-Timestamp (AVP Code 55) is of type Time. This information includes accounting record timeliness requirements.RFC 3588 Diameter Based Protocol September 2003 8. instructs the Diameter node acting as a client to produce accounting records continuously even during a session.
The Accounting-Request message is used to transmit the accounting information to the Home AAA server. the latest value received SHOULD be used in further accounting activities for the same session. 9.4. MUST define their Service-Specific AVPs that MUST be present in the Accounting-Request message in a section entitled "Accounting AVPs". Each Diameter Accounting protocol message MAY be compressed.g. in order to reduce network bandwidth usage. Diameter peers acting as clients MUST implement the use of failover to guard against server failures and certain network failures. 9. The Accounting-Answer message includes the Result-Code AVP.. When one of these AVPs is present. then IP compression [IPComp] MAY be used and IKE [IKE] MAY be used to negotiate the compression parameters. If IPsec and IKE are used to secure the Diameter session. Application document requirements Each Diameter application (e. A rejected Accounting-Request message MAY cause the user’s session to be terminated. NASREQ. If TLS is used to secure the Diameter session. The application MUST assume that the AVPs described in this document will be present in all Accounting messages.RFC 3588 Diameter Based Protocol September 2003 The Diameter accounting server MAY override the interim interval or the realtime requirements by including the Acct-Interim-Interval or Accounting-Realtime-Required AVP in the Accounting-Answer message. MobileIP). Protocol Messages A Diameter node that receives a successful authentication and/or authorization messages from the Home AAA server MUST collect accounting information for the session. which MUST reply with the Accounting-Answer message to confirm reception. depending on the value of the Accounting-Realtime-Required AVP received earlier for the session in question.3. 9. which MAY indicate that an error was present in the accounting message. et al. so only their respective service-specific AVPs need to be defined in this section. Diameter peers acting as agents or related off-line processing systems MUST detect duplicate accounting records caused by the sending of same record to several servers and duplication of messages Calhoun. Fault Resilience Diameter Base protocol mechanisms are used to overcome small message loss and network faults of temporary nature. then TLS compression [TLS] MAY be used.2. Standards Track [Page 116] .
Accounting Records In all accounting records. Appendix C discusses duplicate detection needs and implementation issues. If such memory is available. the client SHOULD store new accounting records there as soon as the records are created and until a positive acknowledgement of their reception from the Diameter Server has been received. Diameter clients MAY have non-volatile memory for the safe storage of accounting records over reboots or extended network failures. STOP_RECORD. INTERIM_RECORD. If the accounted service is a one-time event. This detection MUST be based on the inspection of the Session-Id and Accounting-Record-Number AVP pairs. the User-Name AVP MUST be present if it is available to the Diameter client. meaning that the start and stop of the event are simultaneous. The client MAY remove oldest. and server failures. the Session-Id AVP MUST be present. and possibly. The client SHOULD NOT remove the accounting data from any of its memory areas before the correct Accounting-Answer has been received.RFC 3588 Diameter Based Protocol September 2003 in transit. When the initial Calhoun. session length. two accounting records MUST be generated for each service of type session. If strong authentication across agents is required. If the authorization server has not directed interim accounting to be enabled for the session. Standards Track [Page 117] . Different types of accounting records are sent depending on the actual type of accounted service and the authorization server’s directions for interim accounting.5. A further application of this protocol may include AVPs to control how many accounting records may at most be stored in the Diameter client without committing them to the non-volatile memory or transferring them to the Diameter server. then the AVP MUST use the values START_RECORD. If the accounted service is of a measurable length. network partitions. the client MUST starting sending the records in the non-volatile memory to the accounting server with appropriate modifications in termination cause. It is an implementation dependent matter for the client to accept new sessions under this condition. and other relevant information in the records. end-toend security may be used for authentication purposes. 9. undelivered or yet unacknowledged accounting data if it runs out of resources such as memory. then the Accounting-Record-Type AVP MUST be present and set to the value EVENT_RECORD. Upon a reboot. et al.
a server that Calhoun. there are certain applications that require multiple accounting sub-sessions. which is globally unique (see Section 8. followed by zero or more INTERIM_RECORD and a single STOP_RECORD. The production of these records is directed by Acct-Interim-Interval as well as any re-authentication or re-authorization of the session. et al. Standards Track [Page 118] . The one sequence that is sent MUST be either one record with Accounting-Record-Type AVP set to the value EVENT_RECORD. the AccountingRecord-Type AVP MUST be set to the value START_RECORD. correlation is performed using the Session-Id. The Diameter client MUST overwrite any previous interim accounting records that are locally stored for delivery. Mobile IPv4). Services that do not require any authorization still use the Session-Id AVP to identify sessions. A particular Diameter application specification MUST define the type of sequences that MUST be used.g. During authorization. In these cases. 9. except for the purposes of retransmission. A particular value of Accounting-Sub-Session-Id MUST appear only in one sequence of accounting records from a DIAMETER client. each with their own unique Session-Id. the Acct-Multi-SessionId AVP is used for correlation. In such cases. but a different Accounting-Sub-Session-Id AVP. Accounting messages MAY use a different Session-Id from that sent in authorization messages. If the authorization server has directed interim accounting to be enabled. It is important to note that receiving a STOP_RECORD with no Accounting-Sub-Session-Id AVP when sub-sessions were originally used in the START_RECORD messages implies that all sub-sessions are terminated. When the last Accounting-Request is sent. However.6. there are certain applications where a user receives service from different access devices (e.8). Furthermore. the Diameter client MUST produce additional records between the START_RECORD and STOP_RECORD.RFC 3588 Diameter Based Protocol September 2003 Accounting-Request for a given session is sent. This ensures that only one pending interim record can exist on an access device for any given session. the value MUST be STOP_RECORD. Specific applications MAY require different a Session-ID for accounting messages. Such applications would send messages with a constant Session-Id AVP. or several records starting with one having the value START_RECORD. is used during the authorization phase to identify a particular session.. marked INTERIM_RECORD. if a new record is being generated for the same session. Correlation of Accounting Records The Diameter protocol’s Session-Id AVP.]
Further. The selection of whether to use INTERIM_RECORD records is done by the Acct-Interim-Interval AVP. 2. as appropriate for the service. additional interim record triggers MAY be defined by application-specific Diameter applications. The Value field of this AVP is the nominal interval between these records in seconds. Standards Track [Page 122] . The client uses information in this AVP to decide how and when to produce accounting records. Calhoun. The omission of the Acct-Interim-Interval AVP or its inclusion with Value field set to 0 means that EVENT_RECORD. and so on until the session ends and a STOP_RECORD record is produced. two. based on the needs of the home-organization. et al. The client MUST ensure that the interim record production times are randomized so that large accounting message storms are not created either among records or around a common service start time. and STOP_RECORD are produced. 9. The following accounting record production behavior is directed by the inclusion of this AVP: 1. the next one again as the interval has elapsed once more. Acct-Interim-Interval The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and is sent from the Diameter home authorization server to the Diameter client. The inclusion of the AVP with Value field set to a non-zero value means that INTERIM_RECORD records MUST be produced between the START_RECORD and STOP_RECORD records. Interim Accounting Records SHOULD be sent every time a re-authentication or re-authorization occurs. With different values in this AVP.2.8.RFC 3588 Diameter Based Protocol September 2003 INTERIM_RECORD 3 An Interim Accounting Record contains cumulative accounting information for an existing accounting session. service sessions can result in one. The Diameter node that originates the accounting information. STOP_RECORD 4 An Accounting Stop Record is sent to terminate an accounting session and contains cumulative accounting information relevant to the existing session. MUST produce the first INTERIM_RECORD record roughly at the time when this nominal interval has elapsed from the START_RECORD. known as the client. or two+N accounting records. START_RECORD.
9. 2 for the second.8. The Acct-MultiSession-Id AVP is used to link together multiple related accounting sessions. Standards Track [Page 123] . and can be used in matching accounting records with confirmations. Accounting-Sub-Session-Id AVP The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type Unsigned64 and contains the accounting sub-session identifier.8. and set the value to 1 for the first INTERIM_RECORD. where each session would have a unique Session-Id.3. following the format specified in Section 8. Accounting-Realtime-Required AVP The Accounting-Realtime-Required AVP (AVP Code 483) is of type Enumerated and is sent from the Diameter home authorization server to the Diameter client or in the Accounting-Answer from the accounting server. An easy way to produce unique numbers is to set the value to 0 for records of type EVENT_RECORD and START_RECORD.8. This AVP contains the contents of the RADIUS Acct-Session-Id attribute.RFC 3588 Diameter Based Protocol September 2003 9. a network problem. The combination of the Session-Id and this AVP MUST be unique per subsession. the combination of Session-Id and AccountingRecord-Number AVPs is also globally unique. The client uses information in this AVP to decide what to do if the sending of accounting records to the accounting server has been temporarily prevented due to. with the exception of an Accounting-Request whose Accounting-Record-Type is set to STOP_RECORD. and so on until the value for STOP_RECORD is one more than for the last INTERIM_RECORD.6.8. As Session-Id AVPs are globally unique. 9. but the same Acct-Multi-Session-Id AVP. Acct-Session-Id AVP The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only used when RADIUS/Diameter translation occurs.7. Calhoun. Accounting-Record-Number AVP The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 and identifies this record within one session.5. and the value of this AVP MUST be monotonically increased by one for all new sub-sessions. et al. 9. Acct-Multi-Session-Id AVP The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String. for instance.8. A STOP_RECORD message with no Accounting-Sub-Session-Id AVP present will signal the termination of all sub-sessions for a given Session-Id.4. 9. The absence of this AVP implies no sub-sessions are in use. This AVP MAY be returned by the Diameter server in an authorization answer. and MUST be used in all accounting messages for the given session.8.
Base Protocol Command AVP Table 1 1+ 10. One instance of the AVP MUST be present in the message.RFC 3588 Diameter Based Protocol September 2003 DELIVER_AND_GRANT 1 The AVP with Value field set to DELIVER_AND_GRANT means that the service MUST only be granted as long as there is a connection to an accounting server. At least one instance of the AVP MUST be present in the message. Calhoun. GRANT_AND_LOSE 3 The AVP with Value field set to GRANT_AND_LOSE means that service SHOULD be granted even if the records can not be delivered or stored. Zero or one instance of the AVP MAY be present in the message. Note that AVPs that can only be present within a Grouped AVP are not represented in this table. GRANT_AND_STORE 2 The AVP with Value field set to GRANT_AND_STORE means that service SHOULD be granted if there is a connection. Note that the set of alternative accounting servers are treated as one server in this sense. It is considered an error if there are more than one instance of the AVP. et al.1. The table in this section is limited to the non-accounting Command Codes defined in this specification. This is the default behavior if the AVP isn’t included in the reply from the authorization server. Having to move the accounting record stream to a backup server is not a reason to discontinue the service to the user.4. and specifies in which Diameter messages they MAY. AVP Occurrence Table The following tables presents the AVPs defined in this document. or MAY NOT be present. or as long as records can still be stored as described in Section 9. The table uses the following symbols: 0 0+ 0-1 The AVP MUST NOT be present in the message. Standards Track [Page 124] . 10. Zero or more instances of the AVP MAY be present in the message..
which may be expanded.2. Standards Track [Page 126] . and/or overridden by application-specific requirements in the Diameter applications documents. These AVP occurrence requirements are guidelines. et al.
Diameter is not intended as a general purpose protocol. "IETF Consensus". the AVP Code. the Designated Expert will either approve or deny the registration request and publish a notice of the decision to the AAA WG mailing list or its successor. "Standards Action". the AVP header contains three fields that requires IANA namespace management. The absence of a Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA controlled AVP Codes namespace. in the cases where it is possible. IANA Considerations This section provides guidance to the Internet Assigned Numbers Authority (IANA) regarding registration of values related to the Diameter protocol. a successor designated by the Area Director) for comment and review. "Expert Review". concrete suggestions on how the request can be modified so as to become acceptable. AVP Codes The AVP Code namespace is used to identify attributes.1. For registration requests where a Designated Expert should be consulted. and allocations SHOULD NOT be made for purposes unrelated to authentication. For Designated Expert with Specification Required. the responsible IESG area director should appoint the Designated Expert.1. AVP Header As defined in Section 4. et al. authorization or accounting.RFC 3588 Diameter Based Protocol September 2003 11. This section explains the criteria to be used by the IANA for assignment of numbers within namespaces defined within this document. 11. "Specification Required". Standards Track [Page 127] . The AVP Codes and sometimes also possible values in an AVP are controlled and maintained by IANA. in accordance with BCP 26 [IANA]. Before a period of 30 days has passed. Vendors can have their own AVP Codes namespace which will be identified by their Vendor-ID (also known as Enterprise-Number) and they control the assignments of their vendorspecific AVP codes within their own namespace. "First Come First Served". Vendor-ID and Flags field. 11. if it has been disbanded. Calhoun. The following policies are used here with the meanings defined in BCP 26: "Private Use". There are multiple namespaces. the request is posted to the AAA WG mailing list (or.1. A denial notice must be justified by an explanation and. and MUST include a pointer to a public specification.
5 for the assignment of the namespace in this specification. This document defines the AVP Codes 257-274.777. the Diameter header contains two fields that require IANA namespace management. The values 0-255 are reserved for RADIUS backward compatibility. See Section 4. There are 8 bits in the AVP Flags field Section 4.RFC 3588 Diameter Based Protocol September 2003 AVP Code 0 is not used. AVPs may be allocated following Designated Expert with Specification Required [IANA]. 276-285. 483 and 485-486.215 (hexadecimal values 0xfffffe 0xffffff) are reserved for experimental commands. 480. allocated by IETF Consensus [IANA]. 287. The values 16.777. 280 and 282. where no interoperability is deemed useful. Command Codes The Command Code namespace is used to identify Diameter commands. This document assigns bit 0 (’M’andatory) and bit 2 (’P’rotected). bit 1 The remaining bits should [IANA]. Diameter Header As defined in Section 3.1 for the assignment of the namespace in this specification.2. standard commands. Where a Vendor-Specific AVP is implemented by more than one vendor. et al. Command Code and Command Flags. Note that Diameter defines a mechanism for Vendor-Specific AVPs. 291-300.213 are for permanent. where the Vendor-Id field in the AVP header is set to a non-zero value. no guarantee is made for interoperability between Diameter peers using experimental commands. See Section 3.214 and 16. 271. This document defines the Command Codes 257. 274-275. Standards Track [Page 128] . allocation of global AVPs should be encouraged instead. 11. Release of blocks of AVPs (more than 3 at a time for a given purpose) should require IETF Consensus.1. 11.1. only be assigned via a Standards Action 11. for functions specific only to one vendor’s implementation of Diameter. as outlined in [IANA-EXP]. As these codes are only for experimental and testing purposes.2. Values 25616. Vendor-Specific AVPs codes are for Private Use and should be encouraged instead of allocation of global attribute types. AVP Codes 1-255 are managed separately as RADIUS Attribute Types [RADTYPE]. 258.777. AVP Flags of the AVP header.2. Calhoun. and are defined as "RADIUS Packet Type Codes" in [RADTYPE]. defined in (’V’endor Specific).
Vendor-Specific Application Identifiers are assigned on a First Come.4. For attributes other than those specified in this section. Diameter Common Messages NASREQ Mobile-IP Diameter Base Accounting Relay 0 1 [NASREQ] 2 [DIAMMIP] 3 0xffffffff Assignment of standards-track application IDs are by Designated Expert with Specification Required [IANA].4. 11.2. 3001-3010. First Served basis by IANA. Calhoun. Vendor-Specific Application Identifiers. AVP Values Certain AVPs in Diameter define a list of values with various meanings.3. 11. Standards Track [Page 129] . Result-Code AVP Values As defined in Section 7.2. All remaining values are available for assignment via IETF Consensus [IANA]. First Served basis by IANA. the Application Identifier is used to identify a specific Diameter Application. first-served basis. Command Flags There are eight bits in the Command Flags field of the Diameter header.1. 4001-4002 and 5001-5017. There are standards-track application ids and vendor specific application ids. et al.1.4.RFC 3588 Diameter Based Protocol September 2003 11. This document assigns bit 0 (’R’equest). The following values are allocated. Both Application-Id and Acct-Application-Id AVPs use the same Application Identifier space. 11. Application Identifiers As defined in Section 2. and 0x01000000 . the Result-Code AVP (AVP Code 268) defines the values 1001. bit 2 (’E’rror) and bit 3 (’T’). are for Private Use. bit 1 (’P’roxy). IANA [IANA] has assigned the range 0x00000001 to 0x00ffffff for standards-track applications.0xfffffffe for vendor specific applications. Bits 4 through 7 MUST only be assigned via a Standards Action [IANA]. on a first-come. adding additional values to the list can be done on a First Come. 2001-2002.
1.7.8. Auth-Session-State AVP Values As defined in Section 8.9. 11.13. the Accounting-Record-Type AVP (AVP Code 480) defines the values 1-4. 11. Standards Track [Page 130] . All remaining bits are available for assignment via IETF Consensus [IANA].4.8. the Redirect-Host-Usage AVP (AVP Code 261) defines the values 0-5. All remaining values are available for assignment via IETF Consensus [IANA].17. All remaining values are available for assignment via IETF Consensus [IANA]. All remaining values are available for assignment via IETF Consensus [IANA].4. All remaining values are available for assignment via IETF Consensus [IANA]. 11. 11. Redirect-Host-Usage AVP Values As defined in Section 6. the Disconnect-Cause AVP (AVP Code 273) defines the values 0-2. All remaining values are available for assignment via IETF Consensus [IANA].3. the Session-Binding AVP (AVP Code 270) defines the bits 1-4. Auth-Request-Type AVP Values As defined in Section 8.7.5. 11. Calhoun. the Session-Server-Failover AVP (AVP Code 271) defines the values 0-3. the Auth-Request-Type AVP (AVP Code 274) defines the values 1-3. Disconnect-Cause AVP Values As defined in Section 5. the Termination-Cause AVP (AVP Code 295) defines the values 1-8.4. et al. All remaining values are available for assignment via IETF Consensus [IANA]. Termination-Cause AVP Values As defined in Section 8.3.4.2.4. the Auth-Session-State AVP (AVP Code 277) defines the values 0-1. 11.15. Accounting-Record-Type AVP Values As defined in Section 9. Session-Server-Failover AVP Values As defined in Section 8. 11.11.6. Session-Binding AVP Values As defined in Section 8.4.4.4.RFC 3588 Diameter Based Protocol September 2003 11. All remaining values are available for assignment via IETF Consensus [IANA].4.4.18.
All remaining values are available for assignment via IETF Consensus [IANA].6. Standards Track [Page 131] .4.8. Name and Contact Information: The name. et al."New Connectionless Transport Protocol (NCTP). 11. Inband-Security-Id AVP (code 299) As defined in Section 6. the Inband-Security-Id AVP (AVP Code 299) defines the values 0-1.RFC 3588 Diameter Based Protocol September 2003 11. Accounting-Realtime-Required AVP Values As defined in Section 9. For example . This MUST include the name and acronym for the protocol. 11.7. The following values have been placed into the registry: Services Field AAA+D2T AAA+D2S 12. Protocol TCP SCTP Diameter protocol related configurable parameters This section contains the configurable parameters that are found throughout this document: Calhoun. email address and telephone number for the person performing the registration. address. An example for a new fictitious transport protocol called NCTP might be "AAA+D2N".10. RFC 5766". the Re-Auth-Request-Type AVP (AVP Code 285) defines the values 0-1.12. along with reference to a document that describes the transport protocol.11. All remaining values are available for assignment via IETF Consensus [IANA]. Protocol: The specific transport protocol associated with that service field.4. Diameter TCP/SCTP Port Numbers The IANA has assigned TCP and SCTP port number 3868 to Diameter. 11.5. 11.10. the Accounting-Realtime-Required AVP (AVP Code 483) defines the values 1-3. All remaining values are available for assignment via IETF Consensus [IANA].4. Re-Auth-Request-Type AVP Values As defined in Section 8. NAPTR Service Fields The registration in the RFC MUST include the following information: Service Field: The service field being registered.12.
If the TLS handshake is successful. Realm Routing Table A Diameter proxy server routes messages based on the realm portion of a Network Access Identifier (NAI). end-to-end security is needed. then the CER/CEA exchange MUST include an Inband-Security-ID AVP with a value of TLS. which would then be used to resolve through DNS. TLS is recommended. The server MUST have a table of Realm Names. If the handshake fails.RFC 3588 Diameter Based Protocol September 2003 Diameter Peer A Diameter entity MAY communicate with peers that are statically configured. If a Diameter connection is not protected by IPsec. such as Network Access Servers (NASes) and Mobility Agents MUST support IP Security [SECARCH] and MAY support TLS [TLS]. This security mechanism is acceptable in environments where there is no untrusted third party agent. For protection of inter-domain exchanges. both ends move to the closed state. which is typically used for all messages that cannot be locally processed. a TLS handshake will begin when both ends are in the open state. The recommended value is 30 seconds. Diameter implementations MUST use transmission-level security of some kind (IPsec or TLS) on each connection. A statically configured Diameter peer would require that either the IP address or the fully qualified domain name (FQDN) be supplied. The routing table MAY also include a "default route". et al.2 for more details on IPsec and TLS usage. See Sections 13. For TLS usage. It is suggested that IPsec be used primarily at the edges for intradomain exchanges. preshared keys can be used between the NAS and a local AAA proxy. after completion of the CER/CEA exchange. Security Considerations The Diameter base protocol assumes that messages are secured by using either IPSec or TLS.1 and 13. Calhoun. Standards Track [Page 132] . all further messages will be sent via TLS. Tc timer The Tc timer controls the frequency that transport connection attempts are done to a peer with whom no active transport connection exists. 13. and the address of the peer to which the message must be forwarded to. For NAS devices without certificate support. In other situations. Diameter clients. Diameter servers MUST support TLS and IPsec.
using the IPsec DOI [IPSECDOI]. each ID Payload MUST carry a single IP address and a single non-zero port number. either IKE Main Mode or IKE Aggressive Mode MAY be used. and MUST NOT use the IP Subnet or IP Address Range formats. Standards Track [Page 133] . When digital signatures are used for authentication. IKE negotiators SHOULD use pertinent certificate revocation checks before accepting a PKI certificate for use in IKE’s authentication procedures. negotiation of security associations. Rather. Diameter implementations MUST support peer authentication using a pre-shared key. Peer authentication using the public key encryption methods outlined in IKE’s Sections 5. and key management.3 [IKE] SHOULD NOT be used. it is preferable to leave the connection up. This avoids the potential for continually bringing connections up and down.1. This allows the Phase 2 security association to correspond to specific TCP and SCTP connections. as a means of keeping the number of active Phase 2 SAs to a minimum. and IKE Main Mode SHOULD NOT be used. and MAY support certificatebased peer authentication using digital signatures. and if additional traffic is sent on it. However. when used in conformant implementations. The Phase 2 Quick Mode exchanges used to negotiate protection for Diameter connections MUST explicitly carry the Identity Payload fields (IDci and IDcr). Since IPsec acceleration hardware may only be able to handle a limited number of active IKE Phase 2 SAs. Phase 2 delete messages may be sent for idle SAs. et al. integrity protection and confidentiality. and MUST support the replay protection mechanisms of IPsec.RFC 3588 Diameter Based Protocol September 2003 13. When pre-shared keys are used for authentication. IPsec Usage All Diameter implementations MUST support IPsec ESP [IPsec] in transport mode with non-null encryption and authentication algorithms to provide per-packet authentication.2 and 5. to bring up another IKE Phase 2 SA to protect it. When digital signatures are used to achieve authentication. IKE Aggressive Mode SHOULD be used. an IKE negotiator SHOULD use IKE Certificate Request Payload(s) to specify the certificate authority (or authorities) that are trusted in accordance with its local policy. The DOI provides for several types of identification data. Conformant implementations MUST support both IKE Main Mode and Aggressive Mode. Calhoun. The receipt of an IKE Phase 2 delete message SHOULD NOT be interpreted as a reason for tearing down a Diameter connection. Diameter implementations MUST support IKE for peer authentication.
As a result. When certificates are used. Standards Track [Page 134] . These root CAs are likely to be unique to Diameter usage and distinct from the root CAs that might be trusted for other purposes such as Web browsing. and the Diameter node acting as TLS client MUST be prepared to supply a certificate on request. This implies. 13. Diameter nodes implementing TLS for security MUST mutually authenticate as part of TLS session establishment. In general. that a root CA trusted for use with Diameter must also be Calhoun. Peer-to-Peer Considerations As with any peer-to-peer protocol. When certificate authentication Diameter peers may not be known beforehand.3. it is necessary to configure the root certificate authorities trusted by the Diameter peer. and therefore peer discovery may be required. et al. within IPsec it is not possible to uniquely configure trusted root CAs for each application individually. and a Diameter node that accepts a connection acts as a TLS server. Since use of Port identifiers is prohibited within IKE Phase 1. the same policy must be used for all applications. the Diameter node acting as TLS server must request a certificate from the Diameter node acting as TLS client. Note that IPsec is considerably less flexible than TLS when it comes to configuring root CAs.RFC 3588 Diameter Based Protocol September 2003 13. it is expected that those root CAs will be configured so as to reflect the business relationships between the organization hosting the Diameter peer and other organizations. a Diameter peer will typically not be configured to allow connectivity with any arbitrary peer.. proper configuration of the trust model within a Diameter peer is essential to security. for example.2. In order to ensure mutual authentication. TLS Usage A Diameter node that initiates a connection to another Diameter node acts as a TLS client according to [TLS].
When pre-shared key authentication is used with IPsec to protect Diameter. Since TLS supports application-level granularity in certificate policy. a typical security policy for outbound traffic is "Initiate IPsec. from me to any. for inbound traffic. One implication of the recommended policy is that if a node is using both TLS and IPsec. and both IPsec and TLS will be used to protect the Diameter connection. but not both. Therefore. When IPsec is used with Diameter. IPsec is most appropriate for intra-domain usage when pre-shared keys are used as a security mechanism. who are identified by their IP address (Main Mode). the policy would be "Require IPsec.g. since it does not require policy to be set for each peer or dynamically modified each time a new Diameter connection is created. there is not a convenient way in which to use either TLS or IPsec. destination port Diameter". a TLS-protected connection will match the IPsec policy. This policy is attractive. potential security vulnerabilities. and IPsec policy functionality is implementation dependent. The following is intended to provide some guidance on the issue. Standards Track [Page 135] . where the recommended IPsec policy is put in place. unique pre-shared keys are configured with Diameter peers. it is necessary for the set of Diameter peers to be known beforehand. use of a simple static policy is the often the simplest route to IPsec-enabling a Diameter implementation. destination port Diameter". et al. an IPsec SA is automatically created based on a simple static policy.. Inconsistent use of security mechanisms can result in redundant security mechanisms being used (e. Since Diameter uses the same port for TLS and non-TLS usage.RFC 3588 Diameter Based Protocol September 2003 trusted to protect SNMP. TLS SHOULD be used to protect Diameter connections between administrative domains. from any to me. This policy causes IPsec to be used whenever a Diameter peer initiates a connection to another Diameter peer. As a result. it would be necessary to plumb peer-specific policies either statically or dynamically. TLS over IPsec) or worse. peer discovery is typically not necessary. It is recommended that a Diameter peer implement the same security mechanism (IPsec or TLS) across all its peer-to-peer connections. and to be required whenever an inbound Diameter connection occurs. without reserving an additional port for TLS usage. Calhoun. To avoid this. Since IPsec extensions are typically not available to the sockets API on most platforms. or possibly their FQDN (Aggressive Mode). These restrictions can be awkward at best.
Institute of Electrical and Electronics Engineers. Vollbrecht. "IEEE Standard for Binary Floating-Point Arithmetic". A. 14. RFC 3539. Esibov. and D.. B. August 1985. "A DNS RR for specifying the location of services (DNS SRV)".. June 1999. March 1998. and to initiate IPsec protection for outbound connections. et al. Baker. ANSI/IEEE Standard 754-1985.1.. December 1998. RFC 2597. February 2000. Authorization and Accounting (AAA) Transport Profile". Davie. RFC 2434.. and L.. and J. F. "PPP Extensible Authentication Protocol (EAP)".. F. Nichols. A. January 2002. K. L. S. "Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers".. IPsec policy SHOULD be set so as to require IPsec protection for inbound connections. "Augmented BNF for Syntax Specifications: ABNF". Narten. S. RFC 2234. Bennet. "Assigned Numbers: RFC 1700 is Replaced by an On-line Database". W. Gulbrandsen. RFC 2782. October 1998. V. "Guidelines for Writing an IANA Considerations Section in RFCs". Standards Track [Page 136] . Overell. and P. Davari. B. and J.. Black. Reynolds. Courtney. Crocker. Blunk. Weiss. J. This can be accomplished via use of inbound and outbound filter policy.. T. March 2002.. Le Boudec. November 1997. Baker.. and H. J. References Normative References Aboba. RFC 2474. Blake. and J. "Authentication.. Benson. Vixie. P. "Assured Forwarding PHB Group". June 2003. and D. D. Alvestrand. RFC 3232. "An Expedited Forwarding PHB". RFC 2284. J. 14. Stiliadis. Heinanen. Firoiu. [AAATRANS] [ABNF] [ASSIGNNO] [DIFFSERV] [DIFFSERVAF] [DIFFSERVEF] [DNSSRV] [EAP] [FLOATPOINT] [IANA] Calhoun. J. W. Wood.. RFC 3246. K.RFC 3588 Diameter Based Protocol September 2003 If IPsec is used to secure Diameter peer-to-peer connections. Wroclawski. BCP 26. Charny.
. Xie. September 2001. September 2000. K. Rytina. J.. B. Daniel. Monsour. Schwarzbauer. Taylor. March 1997. Beadles. "IP Version 6 Addressing Architecture". "Number assignment".org Harkins. and R. and M. Mealling.iana. BCP 14.iana. RFC 2165.. "The Internet Key Exchange (IKE)". C. October 1996. Deering. J. Perkins. Carrel. IPv6 and OSI".. Pereira. Kalla. [IANAWEB] [IKE] [IPComp] [IPSECDOI] [IPV4] [IPV6] [KEYWORDS] [NAI] [NAPTR] [RADTYPE] [SCTP] [SLP] [SNTP] Calhoun. and D. M. S. RFC 2486.. RFC 791. D. Aboba. and M... June 1999. Version 2". and S. RFC 2030." RFC 2915. Veizades. Postel... Standards Track [Page 137] .. Morneault. November 1998. "Internet Protocol". July 1998. A. and M. Mills. "The naming authority pointer (NAPTR) DNS resource record. Paxson.. September 1981. "The Network Access Identifier". T... IANA. Guttman. et al. Sharp. "Address Family Numbers". E. STD 5. "RADIUS Types". RFC 2407. RFC 2119. Zhang. Piper. RFC 2960. Q. R. Day. "IP Payload Compression Protocol (IPComp)". Thomas.. M. D. "Stream Control Transmission Protocol".iana.... "Service Location Protocol. RFC 3173. RFC 2409. January 1999. "Simple Network Time Protocol (SNTP) Version 4 for IPv4. RFC 2373.org/assignments/radius-types Stewart.. L. October 2000.org/assignments/address-family-numbers IANA. November 1998. Hinden. H. and V. Bradner. C. R. "The Internet IP Security Domain of Interpretation for ISAKMP". R. Shacham. I.RFC 3588 Diameter Based Protocol September 2003 [IANAADFAM] IANA. "Key words for use in RFCs to Indicate Requirement Levels". D.. R.
Baba.... M. Lim. Munson. Calhoun. and C.. D. T..... January 1981. E.. B. S. M. and L. a transformation format of ISO 10646". E... RFC 2989. Arkko. November 2000. S... and E.. and A. "CDMA2000 Wireless Data Requirements for AAA". Y. P. Munson. Shiino. S... "Criteria for Evaluating AAA Protocols for Network Access". Chen.. Rescorla. Hirschman. A. S.. October 2000. Walsh. Hiller. August 1998. Work in Progress.. E.. Bulley. June 2001. [TEMPLATE] [TLS] [TLSSCTP] [URI] [UTF8] 14. H. Lim. Work in Progress. E. Hsu.. W.. T. C. RFC 2609. S.. "Service Templates and Service: Schemes". Calhoun. B. Calhoun. J. T. Standards Track [Page 138] . Chen. B. December 2002. Manning. Glass. Beadles. Berners-Lee. G. X.. S. B. Hirschman. Walsh. T.. Aboba. RFC 3141. Perkins. Dommety. "Transmission Control Protocol". "Diameter Mobile IP Application". Lo. M. "The TLS Protocol Version 1. Tuexen. Xu. Jaques. Perkins. [AAACMS] [AAAREQ] [ACCMGMT] [CDMA2000] [DIAMMIP] Calhoun. Xu. Ayaki. "Introduction to Accounting Management". P. McCann. RFC 2975.. S. Masinter. RFC 2246. C. Perkins. Dierks. B. RFC 2396. Informative References P.. Jacobs. Hameed. STD 7. RFC 793. Jungmaier. S. "Uniform Resource Identifiers (URI): Generic Syntax". R.. Sivalingham.. Harrington. Campbell.. M... P.. Hameed.. RFC 2279. Yergeau. June 1999. G. R. and J. A. Guttman. B.. Patil. Jaques. Manning.. and D. C.. P. Zorn.. H. T.. Y. Farrell. Seki.. G..2. H. S. B.RFC 3588 Diameter Based Protocol September 2003 [TCP] Postel. Aboba. J. Baba. Hiller.. Mitton. RFC 3436. X. "UTF-8. P. P.. "Transport Layer Security over Stream Control Transmission Protocol". Allen. Lipford. Kempf... et al.0". C. Hsu. P. Sivalingham. F.. R. T. Calhoun. Campbell. "Diameter CMS Security Application". and M.. E. Dommety.. McCann. Koo.. Shiino. January 1999.. Fielding. January 1998.
. and W. Willats.. "Review of Roaming Implementations". W. Perkins. Aboba. [IANA-EXP] [MIPV4] [MIPREQ] [NASNG] [NASREQ] [NASCRIT] [PPP] [PROXYCHAIN] [RADACCT] [RADEXT] [RADIUS] [ROAMREV] [ROAMCRIT] Calhoun. "RADIUS Extensions". Eklund. T. Authorization. Lu. and J. M. "IP Mobility Support for IPv4". A. Haag. Wang.. Mitton. and Accounting Requirements". "Mobile IP Authentication. Rigney. W. September 1997. Calhoun. and G. C. Standards Track [Page 139] . Perkins. J. Rigney. S. Aboba. Rigney. RFC 2194. and C. June 1999. RFC 3344.. September 2001. July 2003. Work in Progress.. P. October 2000. et al. RFC 3169. Dommety. RFC 2607. "Criteria for Evaluating Network Access Server Protocols". Beadles. Narten. Mitton. and B. Zorn. January 1999. July 1994. STD 51. "Criteria for Evaluating Roaming Protocols". "Dynamic Authorization Extensions to Remote Authentication Dial In User Service (RADIUS)". "Proxy Chaining and Policy Implementation in Roaming". B. T. Vollbrecht. M.. June 2000. C. Rubens. B. and M. J. S. Simpson.. RFC 2977. and P. "Assigning Experimental and Testing Numbers Considered Useful". RFC 2866. Calhoun.RFC 3588 Diameter Based Protocol September 2003 [DYNAUTH] Chiba. "RADIUS Accounting". D. June 2000. RFC 3576. "Network Access Server Requirements Next Generation (NASREQNG) NAS Model". "Diameter NASREQ Application". Ding.. RFC 2477. G. Rubens. and D.. RFC 1661. RFC 2881.. S. June 2000. Work in Progress. M. Aboba. Glass. Aboba. August 2002.. C. A. Beadles.. Simpson. C. and W. July 2000. J. W. D. Jacobs. J.. Mitton. RFC 2865. "Remote Authentication Dial In User Service (RADIUS)". B. "The Point-to-Point Protocol (PPP)".. RFC 2869. Willens. Alsop. Bulley. Hiller.
Bob Kopacz. et al. Stephen Farrell. Mark Eklund. Daniel C. Acknowledgements The authors would like to thank Nenad Trifunovic. [TACACS] 15. November 1998. William Bulley. Lol Grant. Martin Julien. Mark Jones and Dave Spence. RFC 1492. C. John R. and similarly with Steven Bellovin in the security area. Fergal Ladley. Calhoun. John Schnizlein.. Atkinson. Tony Johansson and Pankaj Patel for their participation in the pre-IETF Document Reading Party. Finally. The authors would also like to acknowledge the following people for their contribution in the development of the Diameter protocol: Allan C. Fredrik Johansson. Victor Muslin. Rubens. David Frascone. Text in this document was also provided by Paul Funk. Jonathan Wood and Bernard Aboba provided invaluable assistance in working out transport issues. RFC 2401. Mark Jones. Sometimes Called TACACS". Sumit Vakil. "An Access Control Protocol. and R. Finseth. "Security Architecture for the Internet Protocol". Peter Heitman. S. Fox. Pat Calhoun would like to thank Sun Microsystems since most of the effort put into this document was done while he was in their employ. and our deep thanks go to them for their time. Ignacio Goyret. Kenneth Peirce. Ryan Moats. Nancy Greene. Paul Krumviede. Paul Funk and David Mitton were instrumental in getting the Peer State Machine correct.RFC 3588 Diameter Based Protocol September 2003 [SECARCH] Kent. Jacques Caron provided many great comments as a result of a thorough review of the spec. Standards Track [Page 140] . Allison Mankin. Vollbrecht and Jeff Weisberg. Haseeb Akhtar. July 1993.
It would thus be difficult if not impossible for an attacker to advertise itself using SLPv2 and pose as a legitimate Diameter peer without proper preconfigured secrets or cryptographic keys.9.0 template-description= The Diameter protocol is defined by RFC 3588.Guttman@sun. et al. The Diameter URL format is described in Section 2. Standards Track [Page 141] . This simplifies the process of selecting an appropriate server to communicate with. Diameter implementations support one or more applications.transport=tcp supported-auth-applications= string L M # This attribute lists the Diameter applications supported by the # AAA implementation. an AAA server to use for accounting. Diameter Service Template The following service template describes the attributes used by Diameter servers to advertise themselves.) Name of submitter: "Erik Guttman" <Erik. The applications currently defined are: # Application Name Defined by # -------------------------------------------------# NASREQ Diameter Network Access Server Application # MobileIP Diameter Mobile IP Application # # Notes: # . Additional applications may be defined in the future. . # An updated service template will be created at that time. A Diameter client can request specific Diameter servers based on characteristics of the Diameter service desired (for example.example.RFC 3588 Diameter Based Protocol September 2003 Appendix A. Example: ’aaa://aaa. # . Still.com:1812. template-url-syntax= url-path= . Template text: -------------------------template begins here----------------------template-type=service:diameter template-version=0. Calhoun.com> Language of service template: en Security Considerations: Diameter clients and servers use various cryptographic mechanisms to protect communication integrity. confidentiality as well as perform end-point authentication. as Diameter services are vital for network operation it is important to use SLPv2 authentication to prevent an attacker from modifying or eliminating service advertisements for legitimate Diameter servers.
MobileIP supported-transports= string L M SCTP # This attribute lists the supported transports that the Diameter # implementation accepts.com IN SRV 2 5060 server2.TCP -------------------------template ends here----------------------Appendix B.com 0 Calhoun. Note that a compliant Diameter # implementation MUST support SCTP. That lookup would return: . and TCP._sctp.example. # An updated service template will be created at that time. # NASREQ. and the following NAPTR records are returned: . order pref flags service IN NAPTR 50 50 "s" "AAA+D2S" _diameter. If the client supports over SCTP.example.example. SCTP. The applications currently defined are: # Application Name Defined by # -------------------------------------------------# NASREQ Diameter Network Access Server Application # MobileIP Diameter Mobile IP Application # # Notes: # .._tcp. The client performs a NAPTR query for that domain. targeted to a host determined by an SRV lookup of _diameter. Diameter implementations support one or more applications.ex. Additional applications may be defined in the future.com. # .example. et al.com IN NAPTR 100 "" _aaa. too. NAPTR Example As an example.. consider a client that wishes to resolve aaa:ex. SCTP will be used._sctp.com regexp replacement "" 50 "s" "AAA+D2T" This indicates that the server supports SCTP. Standards Track [Page 142] .RFC 3588 Diameter Based Protocol September 2003 # NASREQ. though it MAY support other # transports.MobileIP supported-acct-applications= string L M # This attribute lists the Diameter applications supported by the # AAA implementation.com. Priority Weight Port Target IN SRV 0 1 5060 server1. in that order.
Calhoun. Standards Track [Page 143] . It is defined only for request messages sent by Diameter clients or agents. This will result in retransmission of the record soon after the client or agent has rebooted. et al. Duplicates can appear for various reasons: Failover to an alternate server. Implementation problems and misconfiguration.g. (e. failover thresholds need to be kept low and this may lead to an increased likelihood of duplicates. but prior to receipt of an application layer ACK and deletion of the record. Duplicates received from RADIUS gateways. Failover can occur at the client or within Diameter agents. Diameter servers MAY use the T flag as an aid when processing requests and detecting duplicate messages. servers that do this MUST ensure that duplicates are found even when the first transmitted request arrives at the server after the retransmitted request. due to a failover to an alternate peer. Duplicate Detection As described in Section 9. a client may not know whether it has already tried to send the accounting records in its nonvolatile memory before the reboot occurred. the likelihood of duplication will vary according to the implementation. record to be sent. In other situations it may be necessary to perform real-time duplicate detection.RFC 3588 Diameter Based Protocol September 2003 Appendix C. At that time records are likely to be sorted according to the included User-Name and duplicate elimination is easy in this case. It can be used only in cases where no answer has been received from the Server for a request and the request is sent again. accounting record duplicate detection is based on session identifiers. Where close to real-time performance is required.. after a reboot. - - - The T flag is used as an indication of an application layer retransmission event. due to a recovered primary peer or due to a client re-sending a stored record from non-volatile memory such as after reboot of a client or agent). However. Since the retransmission behavior of RADIUS is not defined within [RFC2865]. due to failover to an alternate server.g. Failure of a client or agent after sending of a record from nonvolatile memory. In some cases the Diameter accounting server can delay the duplicate detection and accounting record processing until a post-processing phase takes place. such as when credit limits are imposed or real-time fraud detection is desired. For instance.4. e..
Secondly. the server searches for a duplicate within a configurable duplication time window backward and forward. network partitions and device faults will presumably be rare events. In order to be able to detect out of order duplicates. in order to optimize duplicate detection. it can choose to make use of the T flag or not. and may not be needed by some servers. A Diameter server MAY check the T flag of the received message to determine if the record is a possible duplicate.RFC 3588 Diameter Based Protocol September 2003 In general. et al. so this approach represents a substantial optimization of the duplicate detection process. hashing techniques or other schemes. Standards Track [Page 144] . The likelihood of this occurring increases as the failover interval is decreased. then it may check the T flag marked records against the database with relative assurance that the original records. have been received and recorded. may be used to eliminate the need to do a full search even in this set except for rare cases. For example. perhaps a day. it can be usually be assumed that duplicates appear within a time window of longest recorded network partition or device fault. Since the T flag does not affect interoperability. So only records within this time window need to be looked at in the backward direction. but MAY be implemented by Diameter servers. After this time period has expired. if sent. it is possible for the original record to be received after the T flag marked record. This limits database searching to those records where the T flag is set. generation of the T flag is REQUIRED for Diameter clients and agents.. In a well run network. only generation of duplicates due to failover or resending of records in non-volatile storage can be reliably detected by Diameter clients or agents. In such cases the Diameter client or agents can mark the message as possible duplicate by setting the T flag. As an example. The following is an example of how the T flag may be used by the server to detect duplicate requests. Since the Diameter server is responsible for duplicate detection. such as the use of the T flag in the received messages. During failover. the Diameter server should use backward and forward time windows when performing duplicate checking for the T flag marked request. If the T flag is set in the request message. due to differences in network delays experienced along the path by the original and duplicate transmissions. Calhoun.
Calhoun.. or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF Secretariat. or other proprietary rights which may cover technology that may be required to practice this standard. patents or patent applications. Copies of claims of rights made available for publication and any assurances of licenses to be made available. Standards Track [Page 145] . et al. neither does it represent that it has made any effort to identify any such rights.
7 74915 Waibstadt Germany Phone: EMail: +49 7263 911 701 erik.guttman@sun.com John Loughney Nokia Research Center Itamerenkatu 11-13 00180 Helsinki Finland Phone: EMail: +358 50 483 6242 john.com Jari Arkko Ericsson 02420 Jorvas Finland Phone: +358 40 5079256 EMail: Jari. Eichhoelzelstr.com Glen Zorn Cisco Systems. Inc. Suite 500 Bellevue. California. Inc.. WA 98004 USA Phone: +1 425 438 8218 Calhoun. 95134 USA Phone: +1 408-635-2023 Fax: +1 408-635-2020 EMail: pcalhoun@airespace. 110 Nortech Parkway San Jose. 500 108th Avenue N.com Erik Guttman Sun Microsystems.E.Loughney@nokia.RFC 3588 Diameter Based Protocol September 2003 Authors’ Addresses Pat R. et al. Inc.Arkko@ericsson. Calhoun Airespace. Standards Track [Page 146] .
without restriction of any kind. Acknowledgement Funding for the RFC Editor function is currently provided by the Internet Society. INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES. Calhoun. such as by removing the copyright notice or references to the Internet Society or other Internet organizations. and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared. copied. Standards Track [Page 147] . The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. All Rights Reserved.RFC 3588 Diameter Based Protocol September 2003 Full Copyright Statement Copyright (C) The Internet Society (2003). published and distributed. This document and translations of it may be copied and furnished to others. provided that the above copyright notice and this paragraph are included on all such copies and derivative works. this document itself may not be modified in any way. et al. However. EXPRESS OR IMPLIED. or as required to translate it into languages other than English. in whole or in part. | https://www.scribd.com/doc/123205175/RFC-3588-Diameter-Base-Protocol | CC-MAIN-2017-51 | refinedweb | 38,583 | 51.75 |
Introducing Our Formula.
For this article we'll be looking at computing the volume of a sphere given it's radius with the following formula:
4/3 * pi * (r ^ 3)
This is a very simple formula to implement and we could do (much) more complex things with the techniques we're about to look at.
Using Composition... The Not-So-Nice Way
To get started, let's build a series of simple methods that we can use as building blocks to construct our more complex sphere volume formula.
internal static Double Add(Double a, Double b){ return a + b;}internal static Double Subtract(Double a, Double b){ return a - b;}internal static Double Multiply(Double a, Double b){ return a * b;}internal static Double Divide(Double a, Double b){ return a / b;}internal static Double Power(Double a, Double b){ return Math.Pow(a, b);}
After we have these building blocks in place, we can compose our method with the functional blocks like the following method:
internal static Double VolumeOfSphere(Double r){ // 4/3 ¶ r ^ 3 return Multiply(Multiply(Divide(4, 3), Math.PI), Power(r, 3));}
The resulting code is very ugly and would be difficult to maintain because it's hard to understand at a glance because as a result of the way our calls have to nest we really have to pay attention to the brackets. It probably would have been better just to calculate our formula without our building blocks. Keep in mind, we're going for an easier way to build our method up from smaller functional blocks. This is a prefect example of a small bit of code that is functionally correct but not readable and so could actually be considered bad programming.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."-Martin Fowler et al, Refactoring: Improving the Design of Existing Code (p15), 1999
Making use of monads to make it prettier.
Think of a monad as a coding strategy or design pattern for building complex computations from simpler ones used as building blocks. It is an abstraction of an existing type, in this case the CLR Double type, into something we are able to interact with functionally and that we can use to encapsulate more complex behaviors and hide them from the consumer code making it more human-readable.
We will define a Foo<> class that provides us with one level of abstraction from any existing CLR type. Our implementation will be primarily using the Double type, but we could abstract any type we want.
public class Foo<T>{ public Foo(T pVal) { Value = pVal; } public Foo() { } public T Value { get; set; }}
We need to define our factory and utility methods in terms of our abstraction oo<Double>) instead of Double. I have two different simple builder methods below, the standard Build() which is easily understandable, and the more LINQish notation "AsFoo()" builder extension method (similar to the LINQ AsQueryable()). We will also have constants that we can define like the Foo.PI which just wraps Math.PI. Finally, we have our combinatory functions to add to our stew like add, subtract, multiply, divide and way to raise a Foo<Double> to a power.
public static class Foo{ internal static Foo<T> Build<T>(T pVal) { return new Foo<T>(pVal); } public static Foo<Double> AsFoo(this Double value) { return new Foo<Double>(value); } private static readonly Foo<Double> m_pi = Foo.Build(Math.PI); public static Foo<Double> PI { get { return m_pi; } } public static Foo<Double> Add(this Foo<Double> source, Foo<Double> target) { return Foo.Build(source.Value + target.Value); } public static Foo<Double> Subtract(this Foo<Double> source, Foo<Double> target) { return Foo.Build(source.Value - target.Value); } public static Foo<Double> Multiply(this Foo<Double> source, Foo<Double> target) { return Foo.Build(source.Value * target.Value); } public static Foo<Double> Divide(this Foo<Double> source, Foo<Double> target) { return Foo.Build(source.Value / target.Value); } public static Foo<Double> Power(this Foo<Double> source, Foo<Double> target) { return Foo.Build(Math.Pow(source.Value, target.Value)); }}
So now that we have an abstracted type and a small utility library we can change the formula. This (to me) is much more readable and would be much easier to maintain/modify because it reads just like the formula, from left to right and we don't have to pay as much attention to the brackets because each "step" is self contained and can be placed on a separate line.
internal static Double FooVolumeOfSphere(Double r){ // 4/3 ¶ r ^ 3 return (4.0).AsFoo() .Divide((3.0).AsFoo()) .Multiply(Foo.PI) .Multiply( r.AsFoo() .Power((3.0).AsFoo())) .Value;}
While this change is much nicer to look at it is still kind of noisy and the method really should be in our Foo<> utility library (and have input and output types of Foo<Double>). This will help us make the algorithm implementation syntax even more succinct and pulls it farther away from the consumer code.
public static Foo<Double> SphereRadiusToVolume(this Foo<Double> radius){ // 4/3 ¶ r ^ 3 Foo<Double> four = (4.0).AsFoo(), three = (3.0).AsFoo(); return four .Divide(three) // 4/3 .Multiply(Foo.PI) // 4/3 ¶ .Multiply(radius.Power(three)); // 4.3 ¶ (r ^ 3)}
So now we can call it with the following code. As you may have noticed, I switched the name just to make it more understandable when reading from left to right and also created placeholders for the values 3 (which is reusable) and 4.
Console.WriteLine("VolumeOfSphere: " + (10.0).AsFoo().SphereRadiusToVolume());
And as they say on those annoying late night tv commercials "wallah!". The complexity is separated out into our utility library. Now for the real sales pitch. "But wait! That's not all! You also receive the ability to encapsulate complex combinatory behavior absolutely FREE!".
Let's say we want to protect our whole Foo<> abstraction layer from a DivideByZeroException which could happen in the Foo<Double>.Divide() method right now. We need to find some other way to indicate there was a problem with our complex algorithm with out throwing expensive exceptions.
All we have to do is update Foo<> a bit to carry a flag to indicate if there was an error and maybe a string for the error description.
public class Foo<T>{ public Foo(T pVal, Boolean pHasErr, String pErr) { Value = pVal; HasError = pHasErr; Error = pErr; } public Foo(T pVal):this(pVal, false, String.Empty){} public Foo() { } public T Value { get; set; } public Boolean HasError { get; set; } public String Error { get; set; } #region Overrides public override string ToString() { return HasError? Error: Value.ToString(); } public override int GetHashCode() { return HasError? this.GetHashCode(): Value.GetHashCode(); } #endregion}
And now we can carry errors through our calculations with one simple added utility method. We'll pass the delegate to an extension method that takes two Foo<T>'s and combines them into one. If either of the Foo<T>s has an error, we'll return it instead of executing the delegate.
public static Foo<T> Combine<T>(this Foo<T> source, Func<Foo<T>, Foo<T>, Foo<T>> combine, Foo<T> value){ return source.HasError? source : value.HasError? value: combine(source, value);}
So we now modify our method to take advantage of this error checking passing any problems through the call chain instead of throwing an exception. The syntax is still just as "human-readable" as our previous implementation.
public static Foo<Double> SphereRadiusToVolume(this Foo<Double> radius){ // 4/3 ¶ r ^ 3 Foo<Double> four = (4.0).AsFoo(), three = (3.0).AsFoo(); return four .Combine(Divide, three) .Combine(Multiply, Foo.PI) .Combine(Multiply, radius.Combine(Power, three));}
And another really cool thing is that the consuming call looks exactly the same even though we are hiding much more complex error checking logic behind our abstracted Foo<Double>.SphereRadiusToVolume() method:
Using this technique, we could build an entire library of functions to do whatever we want to do with our Foo<> that would be very easy to understand and consume and yet be able to hide much more complex logic underneath. This is a very useful weapon in the fight against complexity and composition can work for abstracting complex behavior or whenever you can use a divide-and-conquer approach to solving your coding puzzles. For instance, this would be a great approach for building a validation library on top of regular expressions or have a financial analysis project where you have to build dynamic formulas to do market forecasting.
Until next time,Happy coding
Note: These examples were built with VisualStudio 2008 and use the .NET 3.5 framework and so wont compile if you don't have the 3.5 runtime installed.
©2016
C# Corner. All contents are copyright of their authors. | http://www.c-sharpcorner.com/UploadFile/rmcochran/functional-programming-with-C-Sharp-composition/ | CC-MAIN-2016-26 | refinedweb | 1,475 | 52.19 |
NAME
malloc_usable_size - obtain size of block of memory allocated from heap
SYNOPSIS
#include <malloc.h>
size_t malloc_usable_size (void *ptr);
DESCRIPTION
The malloc_usable_size() function returns the number of usable bytes in the block pointed to by ptr, a pointer to a block of memory allocated by malloc(3) or a related function.
RETURN VALUE
malloc_usable_size() returns the number of usable bytes in the block of allocated memory pointed to by ptr. If ptr is NULL, 0 is returned.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
CONFORMING TO
This function is a GNU extension.
NOTES.
SEE ALSO
COLOPHON
This page is part of release 5.09 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at | https://man.cx/malloc_usable_size(3) | CC-MAIN-2022-21 | refinedweb | 137 | 56.55 |
Debugging and diagnosing cache misses
To make the most of task output caching, it is important that any necessary inputs to your tasks are specified correctly, while at the same time avoiding unneeded inputs. Failing to specify an input that affects the task’s outputs can result in incorrect builds, while needlessly specifying inputs that do not affect the task’s output can cause cache misses.
This chapter is about finding out why a cache miss happened. If you have a cache hit which you didn’t expect we suggest to declare whatever change you expected to trigger the cache miss as an input to the task.
Finding problems with task output caching
Below we describe a step-by-step process that should help shake out any problems with caching in your build.
Ensure incremental build works
First, make sure your build does the right thing without the cache. Run a build twice without enabling the Gradle build cache. The expected outcome is that all actionable tasks that produce file outputs are up-to-date. You should see something like this on the command-line:
$ ./gradlew clean --quiet (1) $ ./gradlew assemble (2) BUILD SUCCESSFUL 4 actionable tasks: 4 executed $ ./gradlew assemble (3) BUILD SUCCESSFUL 4 actionable tasks: 4 up-to-date
Use the methods as described below to diagnose and fix tasks that should be up-to-date but aren’t. If you find a task which is out of date, but no cacheable tasks depends on its outcome, then you don’t have to do anything about it. The goal is to achieve stable task inputs for cacheable tasks.
In-place caching with the local cache
When you are happy with the up-to-date performance then you can repeat the experiment above, but this time with a clean build, and the build cache turned on. The goal with clean builds and the build cache turned on is to retrieve all cacheable tasks from the cache.
This would look something like this on the command-line:
$ rm -rf ~/.gradle/caches/build-cache-1 (1) $ ./gradlew clean --quiet (2) $ ./gradlew assemble --build-cache (3) BUILD SUCCESSFUL 4 actionable tasks: 4 executed $ ./gradlew clean --quiet (4) $ ./gradlew assemble --build-cache (5) BUILD SUCCESSFUL 4 actionable tasks: 1 executed, 3 from cache
You should see all cacheable tasks loaded from cache, while non-cacheable tasks should be executed.
Testing cache relocatability
Once everything loads properly while building the same checkout with the local cache enabled, it’s time to see if there are any relocation problems. A task is considered relocatable if its output can be reused when the task is executed in a different location. (More on this in path sensitivity and relocatability.)
To discover these problems, first check out the same commit of your project in two different directories on your machine.
For the following example let’s assume we have a checkout in
$ rm -rf ~/.gradle/caches/build-cache-1 (1) $ cd ~/checkout-1 (2) $ ./gradlew clean --quiet (3) $ ./gradlew assemble --build-cache (4) BUILD SUCCESSFUL 4 actionable tasks: 4 executed $ cd ~/checkout-2 (5) $ ./gradlew clean --quiet (6) $ ./gradlew clean assemble --build-cache (7) BUILD SUCCESSFUL 4 actionable tasks: 1 executed, 3 from cache
You should see the exact same results as you saw with the previous in place caching test step.
Cross-platform tests
If your build passes the relocation test, it is in good shape already. If your build requires support for multiple platforms, it is best to see if the required tasks get reused between platforms, too. A typical example of cross-platform builds is when CI runs on Linux VMs, while developers use macOS or Windows, or a different variety or version of Linux.
To test cross-platform cache reuse, set up a
remote cache (see share results between CI builds) and populate it from one platform and consume it from the other.
Incremental cache usage
After these experiments with fully cached builds, you can go on and try to make typical changes to your project and see if enough tasks are still cached. If the results are not satisfactory, you can think about restructuring your project to reduce dependencies between different tasks.
Evaluating cache performance over time
Consider recording execution times of your builds, generating graphs, and analyzing the results. Keep an eye out for certain patterns, like a build recompiling everything even though you expected compilation to be cached.
You can also make changes to your code base manually or automatically and check that the expected set of tasks is cached.
If you have tasks that are re-executing instead of loading their outputs from the cache, then it may point to a problem in your build. Techniques for debugging a cache miss are explained in the following section.
Helpful data for diagnosing a cache miss
A cache miss happens when Gradle calculates a build cache key for a task which is different from any existing build cache key in the cache. Only comparing the build cache key on its own does not give much information, so we need to look at some finer grained data to be able to diagnose the cache miss. A list of all inputs to the computed build cache key can be found in the section on cacheable tasks.
From most coarse grained to most fine grained, the items we will use to compare two tasks are:
Build cache keys
Task and Task action implementations
classloader hash
class name
Task output property names
Individual task property input hashes
Hashes of files which are part of task input properties
If you want information about the build cache key and individual input property hashes, use
-Dorg.gradle.caching.debug=true:
$ ./gradlew :compileJava --build-cache -Dorg.gradle.caching.debug=true . . . Appending implementation to build cache key: org.gradle.api.tasks.compile.JavaCompile_Decorated@470c67ec713775576db4e818e7a4c75d Appending additional implementation to build cache key: org.gradle.api.tasks.compile.JavaCompile_Decorated@470c67ec713775576db4e818e7a4c75d Appending input value fingerprint for 'options' to build cache key: e4eaee32137a6a587e57eea660d7f85d Appending input value fingerprint for 'options.compilerArgs' to build cache key: 8222d82255460164427051d7537fa305 Appending input value fingerprint for 'options.debug' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c Appending input value fingerprint for 'options.debugOptions' to build cache key: a91a8430ae47b11a17f6318b53f5ce9c Appending input value fingerprint for 'options.debugOptions.debugLevel' to build cache key: f6bd6b3389b872033d462029172c8612 Appending input value fingerprint for 'options.encoding' to build cache key: f6bd6b3389b872033d462029172c8612 . . . Appending input file fingerprints for 'options.sourcepath' to build cache key: 5fd1e7396e8de4cb5c23dc6aadd7787a - RELATIVE_PATH{EMPTY} Appending input file fingerprints for 'stableSources' to build cache key: f305ada95aeae858c233f46fc1ec4d01 - RELATIVE_PATH{.../src/main/java=IGNORED / DIR, .../src/main/java/Hello.java='Hello.java' / 9c306ba203d618dfbe1be83354ec211d} Appending output property name to build cache key: destinationDir Appending output property name to build cache key: options.annotationProcessorGeneratedSourcesDirectory Build cache key for task ':compileJava' is 8ebf682168823f662b9be34d27afdf77
The log shows e.g. which source files constitute the
stableSources for the
compileJava task.
To find the actual differences between two builds you need to resort to matching up and comparing those hashes yourself.
Luckily, you do not have to capture this data yourself - the build scan plugin already takes care of this for you. Gradle Enterprise has the necessary data to diagnose the cache miss when comparing two build scans, and will show you the properties that caused a different cache key to be generated.
There are three ways to compare builds in Gradle Enterprise.
Use the scan list to find the scans to compare, selecting them by clicking the respectiveor icon.
From a scan that you wish to compare with another, click theicon at the top of the scan, then select the second scan by clicking the icon from the list of scans.
Click theicon in the header of a build scan to show previous and subsequent build scans of the same workspace, then click the icon next to the build you want to compare.
It is also possible that task output caching for a cacheable task was disabled. When this happens the reason why caching was disabled for the task is reported on the info log level and in the build scan:
Diagnosing the reasons for a cache miss
Having the data from the last section at hand, you should be able to diagnose why the outputs of a certain task were not found in the build cache. Since you were expecting more tasks to be cached, you should be able to pinpoint a build which would have produced the artifact under question.
Before diving into how to find out why one task has not been loaded from the cache we should first look into which task caused the cache misses. There is a cascade effect which causes dependent tasks to be executed if one of the tasks earlier in the build is not loaded from the cache and has different outputs. Therefore, you should locate the first cacheable task which was executed and continue investigating from there. This can be done from the timeline view in a build scan or from the task input comparison directly:
At first, you should check if the implementation of the task changed. This would mean checking the class names and classloader hashes
for the task class itself and for each of its actions. If there is a change, this means that the build script,
buildSrc or the Gradle version has changed.
If the implementation is the same, then you need to start comparing inputs between the two builds. There should be at least one different input hash. If it is a simple value property, then the configuration of the task changed. This can happen for example by
changing the build script,
conditionally configuring the task differently for CI or the developer builds,
depending on a system property or an environment variable for the task configuration,
or having an absolute path which is part of the input.
If the changed property is a file property, then the reasons can be the same as for the change of a value property. Most probably though a file on the filesystem changed in a way that Gradle detects a difference for this input. The most common case will be that the source code was changed by a check in. It is also possible that a file generated by a task changed, e.g. since it includes a timestamp. As described in Java version tracking, the Java version can also influence the output of the Java compiler. If you did not expect the file to be an input to the task, then it is possible that you should alter the configuration of the task to not include it. For example, having your integration test configuration including all the unit test classes as a dependency has the effect that all integration tests are re-executed when a unit test changes. Another option is that the task tracks absolute paths instead of relative paths and the location of the project directory changed on disk.
Example
We will walk you through the process of diagnosing a cache miss.
Let’s say we have build
A and build
B and we expected all the test tasks for a sub-project
sub1 to be cached in build
B since only a unit test for another sub-project
sub2 changed.
Instead, all the tests for the sub-project have been executed.
Since we have the cascading effect when we have cache misses, we need to find the task which caused the caching chain to fail.
This can easily be done by filtering for all cacheable tasks which have been executed and then select the first one.
In our case, it turns out that the tests for the sub-project
internal-testing were executed even though there was no code change to this project.
We start the input property comparison in Gradle Enterprise and see that the property
classpath changed. This means that some file on the runtime classpath actually did change.
Looking deeper into this, we actually see that the inputs for the task
processResources changed in that project, too.
Finally, we find this in our build file:
def currentVersionInfo = tasks.register('currentVersionInfo', CurrentVersionInfo) { version = project.version versionInfoFile = layout.buildDirectory.file('generated-resources/currentVersion.properties') } sourceSets.main.output.dir(currentVersionInfo.map { it.versionInfoFile.get().asFile.parentFile }) abstract class CurrentVersionInfo extends DefaultTask { @Input abstract Property<String> getVersion() @OutputFile abstract RegularFileProperty getVersionInfoFile() @TaskAction void writeVersionInfo() { def properties = new Properties() properties.setProperty('latestMilestone', version.get()) versionInfoFile.get().asFile.withOutputStream { out -> properties.store(out, null) } } }
val currentVersionInfo = tasks.register<CurrentVersionInfo>("currentVersionInfo") { version.set(project.version as String) versionInfoFile.set(layout.buildDirectory.file("generated-resources/currentVersion.properties")) } sourceSets.main.get().output.dir(currentVersionInfo.map { it.versionInfoFile.get().asFile.parentFile }) abstract class CurrentVersionInfo : DefaultTask() { @get:Input abstract val version: Property<String> @get:OutputFile abstract val versionInfoFile: RegularFileProperty @TaskAction fun writeVersionInfo() { val properties = Properties() properties.setProperty("latestMilestone", version.get()) versionInfoFile.get().asFile.outputStream().use { out -> properties.store(out, null) } } }
Since properties files stored by Java’s
Properties.store method contain a timestamp, this will cause a change to the runtime classpath every time the build runs.
In order to solve this problem see non-repeatable task outputs or use input normalization. | https://docs.gradle.org/current/userguide/build_cache_debugging.html | CC-MAIN-2021-04 | refinedweb | 2,179 | 52.8 |
Behaviour Driven Development for JavaScript: Part Two
In the concluding part of a two part series, Marco Emrich shows you how you can use JavaScript as a vehicle to carry you into the wonderful world of BDD..
This article is the second in a two part series – to get up to speed, you can find Part One here.
JavaScript is object oriented
JS is an object oriented language; this differs from being class oriented. If you have a background in industrial languages like C++ or Java, you might think JS is missing something. I thought so for a long time too.
Actually popular languages like C++ or Java have less powerful implementations of OOP-concepts, which they inherited from the mighty Smalltalk. The development of OOP did not even stop with Smalltalk. There are many languages that took the concepts from Smalltalk even further. These concepts are mostly used only in academia.
One improvement was to get rid of classes. Languages like Cecil, Self or more recently IO experimented with a prototypical approach, which also found its way into JS.
You might still argue that JS does not have the best implementation of prototyping and an ugly syntax compared to languages like Self. The prototypical inheritance concept itself is, however, a great improvement.
The old way
The old way of creating objects was to supply a constructor function. This was targeted at Java and C++ developers to provide them with a coding style that they were used to. But the constructor function also had its downsides. Therefore ECMAScript5 introduced a better way for creating objects.
So how did it look before ECMAScript5 stepped in? Let’s assume you have built a shop and now you need to start selling various products online. In the old days, you would have written something like this:
var Product = function(name) { this.name = name; }; Product.prototype.showName = function() {alert(this.name);}; var myProduct = new Product("Super Fancy TV"); myProduct.showName();
Constructor function (javascript_refresher/product_in_ecma3.js)
Actually, this isn’t that bad. You have a constructor to create your objects and attach methods to the prototype. All individual products have these methods, but there are several weak points to consider.
- There are no private attributes in the JS language. The value of name can be changed at.
Because of these concerns, many developers have created libraries, frameworks and tools that provide all types of object creation and instantiation logic. Many of them introduced classes (for example Prototype5 or Coffeescript6). JS (MDN). A polyfill is a technique to make modern
features available to older browsers. You can find other polyfills
on the Modernizr-Wiki.
The Object.create-polyfill from MDN allows you to use the new way of creating objects in older browsers, such as IE8. This is important when you consider that IE7/IE8 still has a combined market share of about 7% (January 2013). It is not an issue if you only target IE9+, listing 1.6 to ensure that you have the Object.create function. The first line of the snippet checks if Object.create is already there. This ensures that the polyfill won’t override the native implementation if the current browser provides one. If you need additional polyfills for other ES5-features, you can use either Kris Kowal’s or David de Rosier’s es5-shim.
Solo objects
Let’s take another look at the shop project. If you would like to create only one product, there is no need for Object.create. Just create the object directly:
var myProduct = { price: 99.50, name: 'Grindle 3' };
However, this isn’t the best option. You can manipulate the properties of the objects easily from the outside but there isn’t a way to check or transform the assigned values. Take a look at this assignment:
MyProduct.price = -20;
A mistake like this one would mean that your company sells a lot of products fast and has really happy customers – customers that receive 20 bucks with every purchase. Your company wouldn’t be able to do that for long!
Years of experience in object oriented programming and design taught [Stefanov 2010]). All of them have their own distinct set of advantages and disadvantages. There is no single solution, so it comes down to a matter of taste. Here is what I usually do:
Prefix attributes with an underscore, for example _price. This is just a convention to mark the attribute as private. You should never call them from outside the object. Violations to this rule are usually easy to spot. There are also more sophisticated approaches using closure-based patterns to archive real privacy (for example. in [Stefanov 2010]). My opinion is that they aren’t worth the effort, most of the time.
Provide a setter method that starts with “set”, for example setPrice(value). There is no way in older browsers to overwrite the assignment operator =. So this is the next best thing. Java and C++ programmers are used to it.
Provide a getter method with the name of the original attribute, for example price(). Many programmers prefer prefixing the method with “get”. I think this isn’t necessary in JS and just makes the code less readable – your mileage may vary. Sometimes an attribute might be for internal use only, or you want it to be ready-only. In this case just leave out the appropriate methods. So listing 1.8 shows a better implementation.
var myProduct = { _price: 99.50, _name: 'Grindle 3', price: function() {return this._price;}, name: function() {return this._name;}, setPrice: function(p) {this._price = p;}, };
Solo object with getters and setters (javascript_refresher/product_with_getters_and_setters.js). If you want to check the price before setting it, you can now easily do this:
setPrice: function(p) { if (p <= 0) { throw new Error("Price must be positive"); } this._price = p; }
setPrice-method with check (javascript_refresher/product_with_price_check.js).
The real ECMAScript5 implementation is even nicer (listing 1.10). It has the added benefit of calling the getters and setters implicitly, for example myProduct.price = 85.99. Finally, JS supports the uniform access principle! In this tutorial however, we will stick to the first workaround mentioned since you can’t backport this language feature.
var myProduct = { ... get price() {return this._price;}, set price(p) { if (p <= 0) { throw new Error("Price must be positive"); } this._price = p; }, ...
Prototypes
A real shop will); var product2 = Object.create(Product); product2.setName('yPhone 7'); product2.setPrice(599.99);
There is also the convention to start such a prototype with an upper letter, like classes in more traditional languages (i.e. var Product instead of var product).
Initializers
In order to set all attributes of a new product object to their correct values, you would need to call all its settermethods – a major inconvenience. You should build an initializer-method instead. Such a method could be compared to a constructor- method in other languages.
var Product = { ... init: function(name, price) { this._name = name; this._price = price; return this; }, ... }; var aProduct = Object.create(Product).init('Grindle 3', 99.50);
Even better, overwrite the create-Method of Product to encapsulate creation and initialization.
var Product = { ... create: function(name, price) { return Object.create(this).init(name, price); }, ... }; var aProduct = Product.create('Grindle 3', 99.50);
A great advantage of the prototypical approach is the unification of instantiation and inheritance. You don’t need anything special you can – author and numPages – with getters and setters.
The downside is that calling Book several times is redundant and the whole syntax is quite different from defining the base object. Therefore, you usually build a small extend function that makes inheritance a little more convenient (listing 1.15). Again, you wouldn’t need this in real ES5. The real Object.create allows for a second argument containing the extensions.
tip: Alternative implementations of Object.extend are available in jQuery (. extend) and Underscore.js (). If you already have one of these libs in your project, it makes sense to use them instead.
Object.prototype.extend = function(props) { for (var prop in props) { this[prop] = prop; } return this; };
You can now refactor your code using the new extend method.
var Product = { _price: 0, _name: '', price: function() {return this._price;}, name: function() {return this._name;}, setPrice: function(p) {this._price = p;}, setName: function(n) {this._name = n;} }; var Book = Object.create(Product).extend({ _author: null, _numPages: null, setAuthor: function(author) {this._author = author;}, setNumPages: function(num_pages) {this._numPages = num_pages;}, author: function() {return this.author();}, numPages: function() {return this.numPages();} }); console.log(Product); console.log(Book);
(javascript_refresher/product_inheritance_with_extend.js).
Inside prototypical inheritance
The objects and prototype concept has many advantages over static class-based approaches, like:
Unification of inheritance and instantiation. You can use the same mechanism (Object.create) to inherit from prototypes that allow for runtime modification of classes – Ruby or Smalltalk would fit the bill. But JavaScript’s objects-only-approach makes this much simpler.This is a big gain if you like to do any metaprogramming.
The best advantage of the “objects only” approach is its simplicity. Let’s take a look at the inner workings: First of all, you don’t need any special handling for methods. Methods are just object properties that happen to contain functions. So it doesn’t matter if you look up a simple number or call a method. Now take a look at how JS decides which method to call. Listing 1.17 demonstrates the principle.
var Product = { init: function(name) { this._name = name; return this; }, _name: '', name: function() { return this._name; }, setName: function(n) { this._name = n; } }; var Book = Object.create(Product).extend({ init: function(name, author) { Product.init(name); this._author = author; return this; }, author: null, setAuthor: function(author) { this._author = author; }, author: function() { return this.author(); } }); var myBook = Object.create(Book).init('Lords of the Rings', 'J.R.R. Tolkien'); myBook.mostImportantHobbit = "Frodo";
If you try to get the value of myBook.mostImortantHobbit, the JavaScript-engine just takes a look at the myBookobject and returns the value.
A look-up for myBook.name() requires more steps.
The JS-engine didn’t find the name-property on the
myBookobject, so it needs to look it up in its prototype
Book. It isn’t there either, so it follows up the
prototype-chain till it finds it. The property name
actually is available in Book’s prototype
Product. So JS interprets the parenthesis and calls the
function contained in name. The function gets executed in
the context of the myBook. Therefore this._name
refers to the value “Lord of the Rings”. Even if JS does
need to execute several steps, they are easy to understand. Always
follow the prototype-chain.
Instantiation and inheritance do not need to be handled differently.
Other things to consider
In a real project there are many other things to consider. You usually want to keep your code in namespaces. To manage your namespaces and file dependencies you might want to use a tool that provides AMD (Asynchronous Module Definition). RequireJS or curl are popular ones.
You might even like to use one of the bigger base frameworks like Ember, Backbone or AngularJS. I won’t delve into these things here, since they are not necessary to understand behaviour driven development. I urge you to really take a look into better ways to structure you code bases. It can make a big difference.
Alternate styles
JS is a very flexible language, supporting various programming paradigms (at least functional and object oriented). This allows for many different approaches to software design and development. You might like a pure functional approach, or do OOP with prototypes, or use a library for class-based object-orientation instead. You might consider using mixings/traits or other advanced constructs. Perhaps you will consider using a preprocessor/transpiler like Harmonizr for writing ECMAScript6/Harmony Code, or even trying out CoffeeScript. For the purpose of this tutorial, it doesn’t matter. The behaviour driven approach should work using any of these traits or mixings.
So take my JS-style here with a pinch of salt; I kept it a little bit simpler than in real projects. Consider it a vehicle to carry you into the wonderful world of behaviour driven development.
Be the First to Comment! | https://jaxenter.com/behaviour-driven-development-for-javascript-part-two-107636.html | CC-MAIN-2020-05 | refinedweb | 2,035 | 60.41 |
10.3 Coverage testing with
gcov
The GNU coverage testing tool
gcov analyses the number of times
each line of a program is executed during a run. This makes it possible
to find areas of the code which are not used, or which are not exercised
in testing. When combined with profiling information from
gprof
the information from coverage testing allows efforts to speed up a
program to be concentrated on specific lines of the source code.
We will use the example program below to demonstrate
gcov. This
program loops overs the integers 1 to 9 and tests their divisibility
with the modulus (
%) operator.
#include <stdio.h> int main (void) { int i; for (i = 1; i < 10; i++) { if (i % 3 == 0) printf ("%d is divisible by 3\n", i); if (i % 11 == 0) printf ("%d is divisible by 11\n", i); } return 0; }
To enable coverage testing the program must be compiled with the following options:
$ gcc -Wall -fprofile-arcs -ftest-coverage cov.c
This creates an instrumented executable which contains additional
instructions that record the number of times each line of the program is
executed. The option
-ftest-coverage adds instructions for
counting the number of times individual lines are executed, while
-fprofile-arcs incorporates instrumentation code for each
branch of the program. Branch instrumentation records how frequently
different paths are taken through ‘if’ statements and other
conditionals. The executable must then be run to create the coverage
data:
$ ./a.out 3 is divisible by 3 6 is divisible by 3 9 is divisible by 3
The data from the run is written to several files with the extensions
‘.bb’ ‘.bbg’ and ‘.da’ respectively in the current
directory. This data can be analyzed using the
gcov command and
the name of a source file:
$ gcov cov.c 88.89% of 9 source lines executed in file cov.c Creating cov.c.gcov
The
gcov command produces an annotated version of the original
source file, with the file extension ‘.gcov’, containing counts of
the number of times each line was executed:
#include <stdio.h> int main (void) { 1 int i; 10 for (i = 1; i < 10; i++) { 9 if (i % 3 == 0) 3 printf ("%d is divisible by 3\n", i); 9 if (i % 11 == 0) ###### printf ("%d is divisible by 11\n", i); 9 } 1 return 0; 1 }
The line counts can be seen in the first column of the output. Lines which were not executed are marked with hashes ‘######’. The command ‘grep '######' *.gcov’ can be used to find parts of a program which have not been used. | http://www.network-theory.co.uk/docs/gccintro/gccintro_81.html | crawl-001 | refinedweb | 430 | 60.04 |
Nearby: Call for participation · Workshop Program · Chairs' summary report · Minutes Day 1
See also: IRC log
Minutes of the first day are also available.
Paul Biron: created summary of all reports. Stand out observation: Too many people have wanted too many things from schema from day1. One mans 80 is another mans 20 e.g. redefine either bread and butter or completely useless. we all tend to be selfish in defining what goes into the spec. Equally number of people indicated no change was needed. haven't heard anything new here… these issues have all been expressed before
Steven Ericsson-Zenith: you are being unfair in the reprimand
Paul Biron: deliberately! Standards writing is hard. Compromise is essential. People have to realize that you got to bend. Cannot satisfy everyone with this language. As a group we are at crossed purposes with each other. As an editor and a user I know we have to listen to each other and achieve solutions together. so Is my characterization correct?
Mary Holstege: you cannot have tight idiomatic code generation by tossing out features that support versioning/extensibility plus versioning/extensibility plus universal feature support in all tools, all at the same time.
Steven Ericsson-Zenith: 2 issues. 1) vendors implementation in their tools. vendors say impossible to have consistent implementation. Onus is on committee to define what is correct
Noah Mendelsohn: Can only go so far. Can say what is or isn't an XML document, can't say what software can be used. W3C normally specifies what it takes for a document or format to be conformant; sometimes provides test cases. Usually stays out of the business of certifying that a particular piece of software is conformant.
Dan Vint: That is a reasonable position but( e.g) many tools claim to be an XML tool while supporting very little
Noah Mendelsohn: WS-I doesn't really do this either
Dan Vint: not looking for W3C to certify everything but need an indication of what level of support is being offered.
<Chris Ferris> I think that a comprehensive test suite that was an accurate reflection of the spec (even if it didn't provide complete coverage) could go a long way to providing a means by which the market can police itself with regards to conformance. Of course, that would also require that the w3c "market" this concept… something along the lines of what we have done in WS-I. I would be glad to discuss this with staff or the WG at their pleasure
David Ezell: profiles have already been proposed, but I'm not sure they're adequate. What we need is an XML object serialization language that covers the problem space between different OO languages.
Paul Downey: but schema has already profiled all the languages in the world…
Panel = Ashok Malhotra, Paul Biron, Mary Holstege, Noah Mendelsohn, Michael Sperberg-McQueen,
David Ezell, Leonid Arbouzov, Tony Cincotta
David Ezell: quick intro to WG. and NACS (National Association of Convenience Stores) they care about standard = saving money. Sometimes NACS member vendors hate it that competitive advantage is 'given away' in a standard. As such a vendor, I can identify with the discomfort of the major vendors in this meeting, but at a different level. Two new schema features about which NACS cares a great deal are versioning and co-constraints; we already have a huge investment in XML Schemas, even though it is not really good enough to support our requirements.
<Steven Ericsson-Zenith> note: I did not mean to suggest the W3 should tell software vendors what software to write or how to write it - my point was rather that the committee is responsible for enabling conformable tools through the standard
<David Orchard> I think "1.1" will be an inappropriate name. Hard to see how backwards compatibility will be maintained and meet the versioning goals, particularly if wildcards are changed.
David Ezell: We have produced a document on component designators. That document potentially fulfills some of the requirements of the semantic web with regard to type (i.e. content) identification. We have countenanced limited changes to the component model but so far only one "breaking" change with XML Schema 1.0, that change being addition of precision decimal.
Jonathan Marsh: is the 'formal description of XSD' still active?
Panel: Answer no lack of resources has meant this is on the back burner
<Paul Downey> thinks formal description would be of most value if you could change the spec as a result. it's too late now it's out there in so much code. though a formal description which could generate test cases could be of value
Michael Sperberg-McQueen: basically members got enough from what was produced. It would still be a good thing…
Steve Ericsson-Zenith: small but important audience for formal description
Michael Sperberg-McQueen takes the floor to talk about comments
Michael Sperberg-McQueen: WG has error reporting procedure. Fixes for 1.0, changes for 1.1, clarification etc. Written procedure to follow linked off home page. Problem with collection of errata is co-ordinating changes with other grpups that may not have reviewed errata. W3C approach is that errata are informative not normative. Last Nov 2nd edition of XML schema 1.0 with circa 150 changes. WG seeing problems that indicate vedors are still working off the old version
<Steven Ericsson-Zenith> so I heard the following: the formal specification work that was completed - and is apparently used in the formal work of XPath and XQuery is not supported by the committee because there is a mismatch between the specification and the published standard
Chris Ferris: this is a common problem, bugs found? WG fixes bug in spec and publishes as errata. Some vendors pick up on the published errata and make the necessary changes to their product. Other vendors note the errata but feel the issue(s) not important enough to change delivery dates of software etc. This results in interoperability issues between implementations. So what can we do to better provide for the community?
Michael Sperberg-McQueen: 2 things, in general WG position is to promote 1.0 answer unless 1.0 spec has a contradicion. Each erratum should have 1 or more test case. Would also be useful to have tool that examines schema. Maybe not every erratum can be detected that way but most could
<Paul Downey> +1 to erratum specific test cases, before and after would be useful
David Ezell: WG did minute decision to have test cases for every errata…
Paul Biron: There is an alarming lack of documentation from vendors about what level of errata have been included
Jonathan Marsh: wouldn't that just be noise from our point of view?
David Ezell: I like the suggestion that
submitters of errata should accompany their comments with test case
assertions. Tony will talk about the test suite in a moment. I
strongly encourage everyone to read the WG Note
Processing XML 1.1
docs with XML schema 1.0 processors, since is shows a possible way
forward for supporting XML 1.1. Community feedback would help the WG
plan how best to support (or not support) XML 1.1 in the future.
Tony Cincotta takes floor to talk about test suites
Tony Cincotta: There is a framework document for the test suites. Metadata includes location, what is being tested etc, submissions are public. Contributions to test suite open to everyone and encouraged. Process document describes process for dealing with tests. First pass assesses that structure is correct. Then WG gives it 'acceptable' status and it is displayed consistently with other tests in the suite. One it is reviewed found to be error free it is given status of stable and published. errors mean it is give a or 'disputed' status and goes back to the WG. Schema tests 1.0 compiled by Henry with major submission from Sun, microsoft, NACS
Leonid Arbouzov: test suite is an important tool for proving interop of implementations
but unfortunately not required conformance for vendors. Vendors may
choose to pass some tests and fail others. So what we did in Java conformance tests is that we have included all
W3C Schema tests into Java conformance tests. Now all Java implementations
must pass every single valid test of W3C Schema test suite. Hopefully this should
improve compatibility and interoperability of XML Schema implementations
at least in Java world. Main two issues for us however are
- first, we don't know which tests in W3C Schema test suite are valid and which are not. Some of them are outdated.
- second, if someone wants to add new tests and improve test coverage, one doesn't know which test should be developed. There is no accurate information on which parts of specs are tested and which are not and which require extra testing. Sun will continue to provide W3C XML Schema tests in Java conformance tests and we also have some extra XML Schema tests that we plan to contribute back to W3C.
Paul Downey: wrt Java are there specific tests for individual areas e.g. JaxB
Leonid Arbouzov: Yes but vendors must pass all tests
David Ezell: How many tests are there in the second edition of the test suite?
Tony Cincotta: several thousand.
Mary takes floor
Mary Holstege: SCD's identify components in the schema component model
Waleed Abdulla: so it's like XPath for Schema
Mary Holstege: you can use it to compare two schemas
Jonathan Marsh: can be used for layered spec, that's the use-case for WSDL component designators
Noah Mendelsohn: URIs for identification is a part of the webarch
Noah Mendelsohn's presentation: IBM pointed out shortcomings in the
xsd:Decimal type at the time schema 1.0 was going to Recommendation
status. The Schema WG promised to reconsider for Schema 1.1, and as a
result the Working Drafts for Schema 1.1 propose a new type. The
latest draft calls it "pDecimal" but the group has since agreed to the
name "precisionDecimal." Of key importance is that the new type is
aligned with the emerging IEEE754r decimal type, and thus also with
java.math.BigDecimal, .Net
System.decimal,
and many others. See [slides]
for more details.
Noah Mendelsohn: new decimal type to coexist with existing one. original type not compatible with emerging IEEE. Differences. IEEE unifying Decimal and floating point in a single standard with similar semantics. Operations defined. Significant digits count… IEEE suggests storage formats
Ashok takes floor
Ashok Malhotra: XPath strongly typed taking types system from schema 1.0
<Steven Ericsson-Zenith> precision decimal reference:
Waleed Abdulla: are new types supported in XPATH
Panel: Yes, only introduced a type that they had in their hierarchy anyway
Waleed Abdulla: does schema 1.1 have new namespace?
Noah Mendelsohn takes floor to talk about versioning [slides]
<Steven Ericsson-Zenith> I asked if it was possible for xsd 1.0 to be a profile of xsd 1.1 - Noah Mendelsohn pointed out some issues with base types that might make that a challenge
Paul Downey: most WG conduct themselves in public but schema does not. Is that a problem for getting people involved?
David Ezell: most of what we do feels public anyway, but it's possible that monitoring public lists could slow us down even further. However with regard to the versioning topic, we need much more public scrutiny. We need to examine all the ways that people "version" their XML languages and try to come up with a way to support those as best we can.
<David Orchard> An additional resource Compatibility articles
Noah Mendelsohn: (from slides) XML should be key to loose coupling. idioms for evolving language vocaband schema not agreed e.g. roles of namespaces also disagreement over extension vs restriction. Use cases driving a lot of the WG analysis. WG has description of terminology and proposed mechanisms. Noah has written white paper on evolving XML schemas
<David Orchard:> there is the W3C versioning mailing list that is public
Noah Mendelsohn: Document ed David Orchard and Norm Walsh referenced. Some basic principles: clean support for repeated revisions (>20). Versioning 'Sometimes Not Always' (SNA) tied to namespaces. Don't presume constructs in instance docs (e.g. <extension>). More controversial? .. forward/backward SNA required. Breaking changes happen
Ümit Yalçınalp: what is the issue here with breaking the rules?
Steven Ericsson-Zenith: are you arguing against arbitrary changes in schemas?
Michael Sperberg-McQueen: Noahs point is that creating a new version MUST make a schema processor 'die'
Noah Mendelsohn: difficult thing is schema is a tool for the application, can not say what users will do. We are building a tool but trying not to bake the model into the tool
Steven Ericsson-Zenith: are you proposing to make changes to schema language to enable schema to capture redefinition /deprecation of elements?
Noah Mendelsohn: Principles continue… Check/enforce compatibility in tools. Versions may or may not form sequence or tree. Revisions sometimes not always expressed as deltas. Restriction vs Extension. Base schema allows all future content. wildcards… validate future content, weak wildcards beat UPA problems, New wildcard matches: any elements not known about in this schema. Process decision 2 minutes to finish off… Extension… base schema validates only version 1 content but new processing nodes indictae which subset of content would have
Steven Ericsson-Zenith: uncomfortable with use of the term 'wildcard' here
David Ezell: Major minor use case. pulled from UBH covers the 'breaking change' scenario. describes schemas as the exist today. 2nd use case. OO how do you serialize/deserialize object and how do you cope when things change. 'Specialization' is need to create template schema
David Ezell quickly decribes remaining use cases and invites review from participants.
<David Orchard> FWIW, I plan on offering an evaluation compared to some Web services use cases.
[break]
Paul Downey: Topics to be discussed based on yesterday's vote: Schema 1.1, Test Suite, Versioning. Now is the appropriate time to bring up ideas about how to change the schema language. Let's start with versioning
Paul Biron: There have been a lot of discussions going on…
Eric Johnson: other say it's different [bit buckets]. Agrees with Noah — should not bake any of these ideas into the XSD spec.
<David Orchard> I disagree that changing versions always means changing namespaces.
Erik Johnson: we should put hooks in so that processors can use their own rules
Paul was using the namespace change concept as an example only, BTW.
Eric Johnson: Would anyone in this room be happy if the spec says the only legal schemas are version in one or two ways mandated by the spec?
Waleed Abdulla: Could the W3C do a best practices doc?
Ashok Malhotra: Someone *else* should do that work.
Dan Vint: Isn't there precedence that a new version = new namespace?
Paul Biron: Maybe, but there is probably no one right answer.
Dan Vint: It's the only solution I can get to reliably work at this time.
<David Orchard> Versioning and XML namespace policy
Ümit Yalçınalp: No one has an identification scheme to declare "this is the major version", "this is the minor version", etc.
<David Orchard> The meaning of "Major" and "Minor" is the problem.. does "minor" mean "backwards compatible" change, "small software" change, "small document" change?
<David Orchard> re: xml 1.1 and schema "1.1".
<Chris Ferris> a namespace is just that, a space of names
Mary Holstege: There is a hole in the architecture in that namespaces are unrelated [values]
<Paul Downey> thinks namespaces are about ownership not just versioning
Paul Downey has a presentation about Web Services Description issue LC124 [slides]
Paul Downey: "Compatible Evolution". XML is "yet another self-describing format". add optional stuff, don't delete stuff, don't change the meaning of stuff, communicate breaks in compatibility. LC124 — Evolution is a *big* issue for web services, WSDL WG failed to engage the XSD WG, LC124 - versioning last-stand, Concrete Proposal. Since we use schema to describe message exchanges, this is really a schema problem
<David Orchard> Options being discussed for LC124 at LC124 Options
Paul Downey: XML Schema 1.0 for Description — 1. Description of content constructed by a sender, 2. description of content available for a receiver, 3. validating the format of a message. Versioning and XML 1.0 — got to get it right in version 0, UPA and greedy xs:any make writing extensible schemas *tricky*, have to resort to dumb schema tricks. Validate Twice (Henry Thompson's technique) — 1. Validate document, 2. Prune PSVI elements marked "*[pe:validity()='notKnown']", 3. Validate pruned document.. [going back to "XML Schema for 1.0 for Description] — you can do point 3.. LC124 Questions — Does ignoreUnknowns impact data mapping?, Is this a tractable problem, Should WSDL define this?
<David Orchard> btw, an "isCompatibleWith" attribute in WSDL 2.0 also went down to flaming defeat, see LC54 Proposal
<Chris Ferris> repeating URI for Henry's Validate Twice: Versioning made easy with W3C XML Schema and Pipelines
[The group is walking through a scenario introduced by Waleed, but missed by the scribe]
Waleed Abdulla: what about a content model (a, b, c, xs:any) where c is optional? c will be unknown because of UPA?
Michael Sperberg-McQueen: There is a terminology problem: this is *ambiguous* / non-deterministic, but not unknown
David Ezell: Speaking not as chair, Henry's solution to this problem represents the best of the 80/20 rule.. Hopes we'll give serious consideration of this, although WSDL can do whatever you want
Mary Holstege: Need clarification [on the "Annotation, Extension, Mandatory" slide in Paul Downey's slides], which Paul had skipped for time.
Jonathan Marsh: So, WDSL would say that "a WSDL processor may, must, or should ignore unknown content in msgs where "unknown" is determined by "Henry's algorthm"?
<David Orchard> Mary Holstege, see my note on the options for lc124. It's Annotation for Schema, Extension in WSDL, and possible Mandatory for WSDL.
Paul Downey: I talked to Henry, there were some concerns [but missed by the scribe]
Michael Sperberg-McQueen: A processor that offers an option for this can be a conformant processor
<David Orchard> I would say "The "ignoreUnknown" property set to "true" indicates that a processor should not fault when processing messages that contain _unexpected items_….." and "… The unknown content may be identified by a W3C XML Schema processor. The [validity] property in the Post Schema-Validation Infoset will contain a "notKnown" value if unknown content is found."
Radu Preotiuc-Pietro: Isn't the behavior of validators described by the spec? If so, how can you change the validator without changing the spec?
<David Orchard> Radu answer: behaviour is described, you don't change the validator but you layer on top of it to make sure the 2nd validation gets what you want.
Noah Mendelsohn: What if I wanted a tool that compiles "C", sees a problem, changes the code, and recompiles the code again — it's the same process
Noah is explaining the layered concept in this situation
Noah Mendelsohn: XML Schema validation is applied to one of the validation passes
Radu Preotiuc-Pietro: but having it all in XSD would provide interoperability
Derek Denny-Brown: Not having a good way of separating concerns between what to ignore under what context. Partial understanding can turn into "silently ignored"
Chris Ferris: Chris Ferris: Most web services don't do validation, many cases it's not a B&W thing whether a message is [XSD] valid,. You don't throw a million dollar P.O. away just because of a schema error. That's not how business is done.
<David Orchard> I think web services do validation, but they have compiled code based on the schema which does the validation…
Chris Ferris: Validation is not necessarily a boolean result, the 2-pass validation may be problematic with security (digital sigs, etc.).
<Ümit Yalçınalp> +1 to David Orchard. In essence the validation is in the data binding
Jonathan Marsh: Regarding Noah's presentation and restriction / extension — Noah: which do you like better?
Noah Mendelsohn: I was speaking for the WG, there is no definitive answer yet — we are still working the use cases, and we've had users express strong preferences both ways.
Jonathan Marsh: The pruning step: requiring validation to process the data in the message (e.g. expose through programming constructs) may be too painful. Typically each message isn't validated at runtime.
<David Orchard> If the wording is done right, it doesn't mandate a validation step or 2. It mandates acceptance of unknowns..
Paul Downey: I found myself using UPA because it helps narrow the permutations of possible schemas
Dan Vint: This needs to be down in XSD as well as WSDL — we need it in schema as well
Paul Downey: [basically agrees]
<Paul Downey> XML is about communication, so useful to be able to annotate the schema, not just WSDL
Paul Biron: Validate twice operation comes about because the notion that validation in schema is NOT a binary op — every node in the tree has 6 possible outcomes. tried to validate, did not try, pass, fail, etc.. validate 2x means "if you send extra stuff, it technically des not conform to the schema, but the application may choose to accept it".. I would not want to have a mode in schema that declares the document as valid. other processors can decide if the unknown content is valid
Michael Sperberg-McQueen: I think this is different — the behavior of the validate 2x process is different than RDF. I am making the assumption these are all top-level elements. [On the white board]. 2x validation will not accept a document (abcccc) for schema (a, b, c[1-3]). What does WSDL say about the relationship between schemas and the messages a service SHOULD, MUST, MAY accept?
Jonathan Marsh: It just says "this is the message format"
Douglas Purdy: Extension/restriction — we have thought a lot about that. Both are useful for different things. Restriction — how type authors revise existing types. Extension — Say I author a P.O. type, but implementers want to add new stuff. so, one is for versioning and one is for extension. On this proposal for 2x validation — it scares me.. we never know where the message is going to be [physically]. It may be that I have a reliable msg system that processes messages not via WSDL (might be Michael Sperberg-McQueenQ)
Paul Downey: I was careful to avoid the term intermediary — I used "observer".
Douglas Purdy: If I strip the soap:header off the top oand process the body later, how to I validate the body?
Paul Downey: The output of validation is not a binary step — it's a PSVI
Douglas Purdy: Does my schema processor need to be aware of these rules?
Paul Downey: The app that invokes the schema validator has to be aware of these rules.
Douglas Purdy: We always want to be able to "beware the evil intermediary"
Radu Preotiuc-Pietro: If you add things that are not in the spec, they are chameleon and risk interoperability issues
David Ezell: I would like to ba able to invoke a "contract test"
Jonathan Marsh: Could we put this in schema?
David Ezell: I don't think we could get there
<David Orchard> WRT Douglas Purdy's point, it seems somewhat strange to not use WSDL but to use Schema and validate Web Service messages. How does the msmq know what schema to use? Needs a "web service description"..
<Chris Ferris> hmmm… again, I'm not sure I agree
<Chris Ferris> much of the discussion here has been that validation is really an application-level thing…
<Mary Holstege> more like: what to _make_ of incomplete validity or invalidity is an application-level thing
Alex: The validate 2x algorithm is a pipeline, so in that sense it is very much at the application level
<David Orchard> no more at the app level than SOAP Handler chains are at the app level..
<Chris Ferris> david e's contract test was: can I process the message? he specifically said, does the message have a 'b' (using Michael Sperberg-McQueen's (a, b, c{1-3}) example where the instance was a, b, c, c, c, c
Dan Vint: We just need to have something in schema to help solidify how these processors are expected to act.
Noah Mendelsohn: The reason (good or bad) you choose to skip content is a question you can't answer in the schema spec.
Ümit Yalçınalp: From a data binding perspective, the WSDL processing is separate from the schema processing issues
<Paul Downey> we wouldn't have a web if HTML was strictly validated
<David Orchard> There's nothing stopping a Java implementation from doing this in one step when it gets fed the schema + "ignoreUnknowns" property
Ümit Yalçınalp: I don't like to look at this as a two-step process because it won't happen. It's not an application problem— schema validation is used by data binding independently of the application.. I don't see this as an application issue.
<Ümit Yalçınalp> JAXB 2.0 does this already
David Ezell: I can't call a competing vendor and tell them the message they are sending me is invalid because it fails to deserialize in JAXB and expect them to help me debug the problem. However, if I can tell them it fails schema validation at such-and-such a point, I'll be much more likely to get positive action.
<Steven Ericsson-Zenith> per "we would not have a web if it were strict" - it is one thing to display public data - another to build reliable applications that depend on data contracts
<scribe> Chair: The minutes should show that versioning took up all of the available time.
<Mary Holstege> right, so for some applications, what you make of partial or complete invalidity is to barf. fine choice
<David Orchard> or partially barf?
[The workshop is recessed for lunch until 13:30 Pacific Time]
<Douglas Purdy> David, I saw that you had a question about my statement about durable messages. I don't think that I explained my scenario clearly enough — I was just referring to processors that rip the envelope and look at the body solely.
Noah Mendelsohn: Tim Berners-Lee asked me to convey his perspective to you. Specifically, Tim strongly believes that schemas should be about constraining the "sentential forms" of documents. In other words, schemas help you separate the set of all possible documents into two piles: those that are correctly formed per the schema and those that are not. Tim believes it is typically a mistake to view the content of documents as op-code like instructions for processing. Some people use schemes to implement that operation-oriented model, and Tim wants in most cases to discourage it.
<Chris Ferris>
Philippe Le Hégaret does a W3C 101 presentation [slides]
Philippe Le Hégaret: Articles are on the W3C website and are typically linked from the group page. WAI is for accessibility … Might want to discuss that these (slide looking around) are working groups rather than interest groups. I18n working group does not currently develop specifications but they wanted the option. The wiki is writable by the world… which is an issue. The i18n group produces articles for users and technical spec writers. There is a concern about patent policy and the wiki. That is, outside contributors haven't agreed to the patent policy. RSS has been working quite well for i18n to reach their users. Considerations: the resource problem is the biggest issue (e.g. if there is a decision to write an article, someone has to write it).
Jonathan Marsh: If more work has to be done to write up Henry's validate twice, then maybe an incubator group would be a good way to do that. Incubator groups are somewhat like task forces.
Ashok Malhotra, Oracle [slides]
Ashok Malhotra: support entities, schema evolution, remove UPA. Need to think about how to sell XML Schema. #1 thing: Marketing!
Alexander Milowski: Can you take a class? Yes, in the information systems schools and not the CS departments.
Ashok Malhotra: Need more books (e.g. more than one). A better primer… Some published best practices aren't necessarily "best practices". Need better testing and certification.
Questions: Who ought to do this?. and need resources.
<Chris Ferris> is this the "coach" to which Ashok was referring? it is Regex Coach and written in Lisp. The Regex Coach - interactive regular expressions
Philippe Le Hégaret: The W3C is not experienced in certification. NIST has experience doing that.
Question: What does SQL do? Is there some kind of SQL certification?
Jeff Mischkinsky: NIST had some kind of SQL certification. but that was in the 80's. There was a certification program with fairly good coverage. But that's a very expensive thing to run. And it is hard to do. Right now, there is no SQL certification program.
<Paul Downey> thought all ISO STANDARDS had conformance suites
One thing missing on the slides: library of reusable components (e.g. a type library).
?: Registries aren't popular at the W3C. Registry implies a unique thing… Repository is where you put it. Registry has a unique identification.
Noah Mendelsohn: Producing schemas is not the same as testing and processor that uses schemas… A lot of care has to be done to put into describing what the kinds of software is considered a process and what it does. There is a layer of work that needs to be done… Type libraries may be an ideal thing for an incubator group.
Soumitra Sengupta, Microsoft [slides]
Soumitra Sengupta: entrusted with the team that builds the core components. Co-occurrence constraints are important that they'd like to see it layered on schema. The format for word will be XML going forward. Visio is the only office format that won't move from binary files to XML. When confused on simple types, it defaults to string. In office 2003, there are some restrictions and may not be there in the next version. InfoPath has something similar to co-occurrence constraints. There has been a tremendous amount of work on schema conformance in the next System.XML and MSXML 6. A better formal specification would be helpful. XML to object/XML to Relational is not an easy problem and will not get fixed easily. Trying to change the schema to solve this problem is not the right thing. 300,000+ developers using XSD. At XML 2005 they will present a full study of what they've found. There is tremendous value in XML Schema. Don't just change it… Office support the full XSD spec will increase its use. The file saved in the next version will be a zipped XML document. XSD is providing real value in-spite of the pain. XSD 1.0 should still be the basic foundation of exchange. Will collaborate with all vendors for interoperability. Strongly believe data binding should be out-of-scope for the W3C. Profiling is not a bad thing. Microsoft had a different position at one point.
Noah Mendelsohn: When Douglas Purdy talked about profiles, profiles are a good thing to optimize around… you appear to be going further.
Soumitra Sengupta: Profiles are a good thing but middleware should support the whole thing. Investing a lot in best practices… should include actual schemas that are working.
Philippe Le Hégaret: Lots of people say the spec is complex, but no one mentions the primer. Are people reading the primer?
several in the room: Everyone reads the primer and then the spec…
Philippe Le Hégaret: People have said "just say no to WSDL2"… just look at the spec… but it is hard to make those kind of specs easier.
several in the room: The primer is great for your first introduction… then you need to find your local guru to understand further.
Michael Sperberg-McQueen: What we need is "readers" for XML Schema.. Examples need to be relevant to the reader.. this is not a new problem… every language has this challenge at the beginning…
Paul Biron: My memory, we had part 1 and part 2 and one member said "I'm going to write a primer" and then it was published as part 0. So, if someone thinks we need a reader, then write one.
Jonathan Marsh: Now every working group should have a primer material and that's not core to the WG and so the work stretches out for years. Constrain the WG, try not to do primers, and then have outreach groups to do these things. At this point, you've done a primer, 5 years of experts, there's a market for that material,… but the schema group now offers producing the errata and getting all the nits worked out.
Jonathan Marsh: If interoperability is a priority, test suites and errata would be very valuable.
<David Orchard> I will point out that in WSDL 2.0 people have not generally wanted to do work on the primer, but people have now started using the primer examples for making their points and it's changed WG members opinion on issues.
Noah Mendelsohn: Clarification work is need for both users and spec readers. Have had reports from people who said that it was very painful but that it does answer the questions. One of the traps we could run into is that "doing x or y that is different" could run into problems.. This spec two many passes and this is the best we came up with…. One of the problems is that we'll change something that was correct event if hard to find when we change the spec for clarity.. My view, at this point, the best is to do selective clarification. Fixes to the spec where necessary.. In selected more major areas, clarification of certain areas (e.g. imports and includes). Point: the original specification doesn't go away…. The risk in clarifying the spec is that to change one thing you might have to change a lot of the spec.
Chris Ferris: Chris Ferris: Often, people such as myself go to the XSD spec and chase down the rules to figure out a particular problem and become enlightened but there is no record of that so others can benefit. A wiki where people could post their findings would be useful in helping to clarify issues for others benefit.
Noah Mendelsohn: The FAQ started that way…
Chris Ferris: If it was easier for the public to contribute that might provide a lot of value.
Soumitra Sengupta: What we do is write the tests…
Noah Mendelsohn: The spec does get easier to read once you learn how it's organized. I
suggest we might want to publish some information on how to use the
specification to answer your questions.
Might be a good piece of work for the Schema WG to produce.
Michael Sperberg-McQueen: If you want to know if an instance is valid, you start in section 5.2. Not everyone knows that.
(?): go through and actually apply the rules… to figure that out, the rules aren't cross-related. It is clumsy… maybe if you start from the right spot knowing what you are looking for… you have to watch for these edge cases isn't actually called out… and follow a lot of dead ends.
Noah Mendelsohn: want an annotated XSV…
Derek Denny-Brown: tool vendors encounter issues in different order…
Michael Sperberg-McQueen: if we could safely refactor the document, we'd do it in a flash. There are different opinions on what safe, refactoring, etc. means…
Jonathan Marsh: What's done is done. Not clear if the pain is increasing or dropping.
Paul Downey: What about new implementers? Do they need to spend 5 years too?
Noah Mendelsohn: Mystified that there aren't more books.
David Ezell: wanted to respond to "chickening out"… don't feel that we're chickening out. Feeling that since we've failed to write a clear thing, we may not be the right person to write this. There are two important reader groups: Einstein's and elvis's…. Need more material for Elvis…
<Henry Thompson> I would like to get a sense from this group if we added one more thing to structures beyond the status quo, namely weakened wildcards (we already have subsumption for particle restriction agreed), nothing more to datatypes (i.e. the impending last-call draft), and NOTHING MORE, and declared victory on 1.1, with a promise to focus subsequent effort on 1) Layering co-constraints on top, separately; 2) Best practices for versioning, working with what we've got; 3) lot
<David Orchard> A few years ago people would use XFront's schema design guides regularly..
[session ended]
<Henry Thompson> It's my bedtime, hopes someone will feed in his comment at the appropriate time. Michael Sperberg-McQueen/Noah Mendelsohn/Mary Holstege — do you understand what I'm suggesting? I feel that we could easily use at least 50% of the (hopefully expanded) WG's time for a year putting out Best Practice Versioning Notes just on how to make the best use of our existing design, and if we did that for a year or 18 months then we might have enough concrete experience to look at XML Schema V for Versioning. And I hear a lot people asking for those Notes here today
<Erik Johnson> Are the Best Practices Notes public?
Paul Downey suggests 15 minutes for each 3 topics and 45 mins for wrap up
Three topics are validation, profiles and UPA
Jonathan Marsh: This is related to LC124 in WSDL.
Paul Downey: Is the code binding a requirement?
Michael Sperberg-McQueen: Presents David Orchard's example (last name, first name, any element can appear in between or after)
Noah Mendelsohn: Code binding is an important requirement, but some people are using it as an implied requirement dumbing down XML and schema to meet the needs of more traditional programming languages. Mixed content and choice were both in XML before schema was hatched. Both are tremendously important. "Code binding" should not be a euphemism for getting rid of such key features of XML.
Dana Florescu: Sympathetic to code binding, but it is not the only use case (X Query)
David Orchard: First name, last name, and a wildcard that leaves the possibility of extension a middle name.. There are actually two examples. Middle name (when it occur in the middle) is separate.
Douglas Purdy: To make changes to schema to support data binding is leaky. This leads to the profile discussion. However, w3c making a change for writing generators is not good idea.
Discussion about what UPA is…
Ashok Malhotra: Prevents backtracking.
<Kohsuke Kawaguchi> RELAX NG proved once and for all that you can do without back-tracking even if you don't have UPA
Paul Downey: What is the difference in typing and binding?
Noah Mendelsohn: Binding is where you will put it in a Java bean, for example.
Michael Sperberg-McQueen: With UPA you can use a simpler construction and build deterministically. The automata is deterministic by UPA.
<Kohsuke Kawaguchi> I mentioned that you might save a little in constructing a state machine but you'll pay a big cost of checking UPA
Paul Biron: The other thing UPA does is when there are appinfos attached to elements, if I get content model that violates UPA which one do I use? It prevents this case.
Derek Denny-Brown: We have tools that depend on appinfo, annotations. I will be uncomfortable in loosening the restriction.
Paul Downey: How does this interact with databinding? JAXB uses Appinfo. In an ambiguous content model, it will be problematic. I like determinism.
Paul Downey: Are profiles useful or harmful?
Douglas Purdy: In perfect world we will not have a profile. Programming model will be aligned with schema, but it is not the case. Pressure from customers dictate what we do.. We have used the lessons learned from SOAP builders and adopted in WS-I basic profile.
<David Orchard> It's not nearly as rosy as that because some vendors have profiled the profile.
Douglas Purdy: No attributes, use element, xsd primitives sequence,… can become a profile.. There are two different scenerios: code first vs. schema first.
Chris Ferris: If WS-I did not preclude the stuff outside the profile, then it will be possible to guarantee a reasonable programming model.. We could say this and it will not preclude others to use other features.
Douglas Purdy: The key is that tools should not fail outside the boundary. The vendors should support all the schemas.
Chris Ferris: It is not an interop problem, it is a convenience problem.
David Ezell: I keep hearing IIOP. Does the profile solve a problem or introduce a set of conventions?
Paul Downey: There is a strong market for tools that support a particular feature set.. If you stay within a feature set, you will get a good programming experience.
<Chris Ferris> there is never a guarantee of interoperability
Ashok Malhotra: Another way is to say always use element form qualified, etc. These are user guidance.
Jon Calladine: If the profiles can not be verified by tools, they are not that useful.
Ümit Yalçınalp: +1
Noah Mendelsohn: Optimize for the profile, but support everything…
<Chris Ferris> +1 to what noah said
Mark Nottingham: There are languages PHP, Python…
Noah Mendelsohn: A simple subset of the schema will be easy to write a parser for.
Paul Biron: Worried about profiling. We have profiles of the WS-I profiles for use in HL7… and I don't understand why, because those specs are so easy to implement I don't see why our people need profiles, but they want them.
Douglas Purdy: When we engage with customers, users do not want DOM.
Ümit Yalçınalp: +1
<Mark Nottingham> +1
Paul Biron: Why can not the tool vendors do more?
Jonathan Marsh: Another thing a profile does to encourage vendors to extend the patterns of use.
<Chris Ferris> Soumitra mentioned in his talk two experimental efforts at incorporating XML into Java and C#, namely XJ and Cw
Douglas Purdy: We like to represent graphs, but noone can understand semantics.. As long as we can use a different mapping but preserve our semantics, we are ok.
Paul Downey: how many think that a schema profile is a good idea?
Answer: 16
<Mark Nottingham> 30 in the room (not counting Chairs and W3C Team)
Discussion on what the next question should be…
Noah Mendelsohn: The profile we are discussing is for a specific purpose: data binding. There are other uses of profiles.
Paul Downey: If a profile is done, should it be done at the w3c?
Steven Ericsson-Zenith: The question is whether the mechanism is defined by the w3c and the profile is defined elsewhere…
Ümit Yalçınalp: There are two questions. Explicit support in the language for the definition of a profile vs definition of a contrained set of XML Schema features which is helpful for data binding
DF: Layers of compatibility was not a good experience for XQuery. Everyone will implement everything anyway.
??: Profile will help getting the spec together. For example, profiles that define extensions will help reduce the complexity of the spec and understanding of the requirements.
scribe: There needs to be one source of profiles, preferably w3c.
David Ezell: A process question: We are running out of time and we can not resolve what the profile should be. We need to focus on the specific question.. Is the w3c the right place to do this?
<Chris Ferris> my view is that if the web services activity were the venue for a profile that defined the sweet spot of xsd 1.0 that made for a pleasant user experience, I could support that, but I also think that ws-i may be a better venue since we already are set up to develop profiles. wiki good
Ümit Yalçınalp: +1 wiki
Michael Sperberg-McQueen: Time for us to move to the summary.
Noah Mendelsohn: It has been an repeated experience in w3c we do better with concrete proposals. That is hard to ask from the users. Nonetheless, the same approach applies…
Henry Thompson: weakened wildcards, simplified definition of restriction, datatypes in current draft. can we call victory ? This is a proposed program for XML Schema 1.1
scribe: would like to focus on (1) layered co-constraints (2) best practices for versioning.
<David Orchard> Worried that this doesn't set Schema up for what it needs going forward wrt versioning. weakened wildcards is at best a partial solution. Mutliple namespace documents are very common.
Derek Denny-Brown: How does it work with existing processors?
David Ezell: our intention has been not to cause unnecessary pain.
<David Orchard> Can fix versioning by doing additions that are optional and thus compatible.
Discussion on what w3c should do…
scribe: should there be Schema 1.1 or not?
Noah Mendelsohn: What does it mean? What should the WG should do then if 1.1 was dropped.
Michael Sperberg-McQueen: Effect of dropping 1.1 would mean that maintainance of the test suite and errata as well as the promotion material preparation.. will be the focus of the wg.
[adjourned] | http://www.w3.org/2005/06/22-xsd-user-minutes.html | crawl-002 | refinedweb | 7,570 | 63.9 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2011-01-23 16:05, michael wrote: > [...] Hey, Sorry for the late reply. I am taking the liberty of answering this one first. >. Regarding the next step: well, >> > >> > I would also like you to clean up d/rules. At least remove/merge >> > uninterested targets and comments. Please also either fix the "noopt" >> > build option or remove the code for it (fixing it probably requires >> > patching upstreams Makefile, since it does not react to CFLAGS). >> > Personally I prefer things like the debhelper "tiny rules"[2] with >> > override targets (or cdbs, but I have less practice with it). These >> > styles have the advance of hiding the "standard stuff", making the >> > "non-standard" parts more visible. > I'm not sure if it's worth changing to cdbs and/or quilt right now for > only 4 small changes (I use it for an other adopted package - snacc - > right now, so it's not a question of skill). > I removed that dh_desktop line - that's o.k. for I added the #, but I > can't see the necessity of changing the other things or removing > comments. It was o.k. all the time so far and is doing no harm. I also > like to have some comments, even if they remain from the initial > conversion to a debian package. >. Finally there is this part, which I asked you to look at: ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif I do not see any changes to it, nor to the upstream Makefile. Does this work as intended? That is, will DEB_BUILD_OPTIONS=noopt dpkg-buildpackage produce an unoptimized package? As I recall I came to the conclusion that it probably did not work, but feel free to correct me if I am wrong. >> > >> > When you clean up the rules file, please bump debhelper to at least 7. >> > if you go with "tiny rules" with overrides, you will need a >> > Build-Depends on debhelper (>= 7.0.50~) - but the compat is still 7 in >> > this case. >> > > Why that? Even lintian was only requesting (on that mentioned snacc > package W: snacc source: > package-lacks-versioned-build-depends-on-debhelper 5) to change from >>4 > to >>5. On the other hand actualised lenny is using 8.0.0~bpo50+2, so > why not change to 8, for I haven't checked against older versions and I > do NOT intend to do so? > Just to be complete : this change has to be made in the control file, > not in rules. So, starting with Lintian here. The Lintian warning you saw is about the package having a Build-Depends on debhelper 4, when the package said it used debhelper 5 features (in debian/compat). Since compat 5 is not strictly deprecated, Lintian will not warn about its usage. As for debhelper in lenny; lenny has 7.0.15 - the version you are seeing is debhelper in lenny-backports. There is a difference between the two. I am willing to believe that snake4 is an unlikely candidate for security or (old-)stable uploads. I see no reason why you cannot use debhelper 8 instead of 7 for snake4 actually. I have just been accustomed to using compat 7, so the new 8 compat went past me. :) > [...] > > Kind regards > Michael > > If you have any questions to the above, feel free to write back on list. If I do not reply within four days (like I failed to do this time), feel free to ping me in private as well. Else I would recommend you send an RFS to the Games Team. :) ~Niels -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - iQIcBAEBCAAGBQJNSeqtAAoJEAVLu599gGRC47IQAJuMLVmr0GRkz3Cxb14mcO3c QPIO/dJx0smtZ0J6vX1wteHfH0Fo3Z9avzE2ryu7QgGOtDGwPVLhD9fWq0+Ad3F/ vus3IrSDmNRbmpRhRR/Ja8URswHt1pF4sA42343DcmUgscNP8I3JSpB4yCPeeQut Kfgva7UZmeOgri4gnAuCJL9Kp8XGSKsPWWSaHjI6JdlANAv4/gJuLpHYD8/8DPiA lYUBDe+GXB72YU9VrRai8t5MZkoOx0deJaHeJSaM/5mpfBbrraMBT2Kv1qxZ02F8 ydUELFx/odDmQS8Nv/7zD8qvSjNIG/m1kscOwKvwounf8UBhoE33JdQAOEo1ihAB MPBt2YUQSQhTcGxSDWLw2WP/UFkppAvSTil3cB14qkF525wNi261RUGNmG9yPyms aRXErM6yGKfNKDSzJvivjeeA40WST3/tUfwoMMIy7UpgyRXwlEZlf+PCoz7mYzIx lqQps+gNWDvHIepFAHwx1/FJVPsRiNFV/gmitRpYHF4CTSbljeiGiGkWN5HYXVkA mStw6vfxRLpsDMYnKX/cBCE26gIwBV0cvFukkKOD9GeR0daPT7XhId+cIrrRVd1q Cae1sw5U16HhrGOudVJHnbly4V38DPKtLy0OUqC1Cpr4fetdreBEYx7atRg08p2x zwh2YoYd9QnFIwrFhLb3 =hWF9 -----END PGP SIGNATURE----- | https://lists.debian.org/debian-mentors/2011/02/msg00017.html | CC-MAIN-2018-17 | refinedweb | 647 | 64.61 |
In the admin site, I have a custom form. However, I want to override the save method so that if a certain keyword is entered, I do not save it into the database. Is this possible?
class MyCustomForm (forms.ModelForm):
def save(self, commit=True):
input_name = self.cleaned_data.get('input_name', None)
if input_name == "MyKeyword":
//Do not save
else:
return super(MyCustomForm, self).save(commit=commit)
AttributeError 'NoneType' object has no attribute 'save'
def save(self, force_insert=False, force_update=False, commit=True):
m = super(MyCustomCategoryForm, self).save(commit=False)
input_name = self.cleaned_data.get('input_name', None)
if input_name != "MyKeyword":
m.save()
return m
The
save() method is supposed to return the object, whether saved or not. It should rather look like:
def save(self, commit=True): input_name = self.cleaned_data.get('input_name') if input_name == "MyKeyword": commit = False return super().save(commit=commit)
However, as you can see here and here, the form is already called with
commit=False and the object is saved later by the
save_model() method of your
ModelAdmin. This is the reason why you got
AttributeError 'NoneType' object has no attribute 'save'. If you check the traceback of the exception, I'm pretty sure the error comes from this line.
Thus you should, in addition, override your
ModelAdmin's
save_model() method:
def save_model(self, request, obj, form, change): if form.cleaned_data.get('input_name') == 'MyKeyword': return # Don't save in this case super().save_model(request, obj, form, change) # And you'll also have to override the `ModelAdmin`'s `save_related()` method # in the same flavor: def save_related(self, request, form, formsets, change): if form.cleaned_data.get('input_name') == 'MyKeyword': return # Don't save in this case super().save_related(request, form, formsets, change)
Given your comment in this answer
It is working now but I just have one related question. The admin site will still display a green banner at the top saying "The model was added successfully". Can I override some method so that it is red and says "The model already exists"?
It looks that what you want to do is not overriding the save method but controlling form validation. Which is completely different. You just have to override your form's clean method.
from django import forms def clean(self): """ super().clean() if self.cleaned_data.get('input_name') == 'MyKeyword': raise forms.ValidationError("The model already exists")
Or, even better since it looks like you want to clean a single field:
from django import form def clean_input_name(self): data = self.cleaned_data['input_name'] if data == 'MyKeyWord': raise forms.ValidationError("The model already exists")
However, I guess
input_name is also a field of your model and you don't want to raise this error only on one form but across all your project. In which case, what you are looking for are Model validators:
from django.core.exceptions import ValidationError def validate_input_name(value): if value == 'MyKeyword': raise ValidationError("The model already exists") | https://codedump.io/share/tDpSOENOqk5h/1/django-admin-site-modify-save | CC-MAIN-2016-44 | refinedweb | 477 | 50.43 |
President’s message
Sig Taus Continue to Make a Difference Year-Round The past few months have been an eventful time for our country and our fraternity. As you read this SAGA, you will find many examples of our brothers and alumni who have stepped forward to help others, who are not as fortunate as many of us. I am proud to have you as my brothers.
“We need to think outside the conventional wisdom that we can only rush during certain periods of the year.”
This is the best of Sigma Tau Gamma and we all (current active brothers and alumni) must continue our efforts. As we assist others, we build brotherhood and bonds. These bonds grow stronger when we direct them toward positive goals. I have heard from many of you about my last SAGA piece and wanted to thank you for your feedback. Again, I emphasize that bringing new members into our brotherhood helps to overcome hate and intolerance. What else can we do to continue to make a difference? In our local communities we can get involved with the “Books for Kids” program or the “Read Across America Day” in early March. Both of these efforts impact our fellow citizens. Have each of our chapters participate in our annual National Service Day. Invite faculty, campus administrators, parents and alumni to participate with us in our service projects. In our chapters, we can rush 365 days a year. We need to think outside the conventional wisdom that we can only rush during certain periods of the year. Take two associate classes per semester and invite more males on campus to become part of our fraternity. Have your associates run a rush event for their friends on campus. Yes, having rush events in March or April can yield successes. Finally, I wanted to announce a new initiative to assist our chapters to become stronger; with the goal being an enhanced brotherhood experience for our members. We call this our improving chapter quality initiative. This year, ten chapters have stepped forward to participate in a pilot test of this initiative. These chapters are completing a thorough analysis and self-assessment of their operations as a fraternity chapter. They are determining what major areas they would like to improve upon in 2002. In addition, a team of volunteers is working with them to improve their chapter. We are confident this initiative will improve the overall brotherhood experience for these chapters and result in a stronger Sigma Tau Gamma chapter on their campuses. We hope to expand this initiative to other chapters in the following years. Thank you to the chapters and the mentors assisting in this process.
Thomas N. Janicki, 31st National President 2
SAGA
WINTER
’02
SAGA Volume 74 (475-360)
Issue 2 Winter 2002
Staff
4
A Brotherhood United Sig Taus share their personal accounts of September 11, 2001.
12 Roskens Scholars
ON THE COVER: Background photo of World Trade Center remains in New York City, courtesy of Michael Rieger/FEMA News Photo; foreground photo of Lt. Paul Mitchell, USN, Delta Xi ’95, self-portrait.
Editor Justin Kirk Co-Copy Editors Janet Kelman, Lydia Gittings Art Director Kristy Schwaller Editor Emeritus Robert E. Bernier Publisher William P. Bernier
Deadlines for submissions: Spring 2002 - March 25, 2002 Summer 2002 - May 25, 2002 Fall 2002 - August 25, 2002 Winter 2003 - November 25, 2002 The Saga of Sigma Tau Gamma is published quarterly by Sigma Tau Gamma Fraternity Inc., P.O. Box 54, Warrensburg, MO 64093-0054. Periodicals postage is paid at Warrensburg, MO, and additional mailing offices. Printed at Modern Litho-Print Co. in Jefferson City, MO. Address all communications, including change of address, to the Fraternity. “Sigma Tau Gamma,” its coat of arms and badges are registered service marks of Sigma Tau Gamma Fraternity, Inc. Postmaster: Send form 3579 to Sigma Tau Gamma Fraternity, P. O. Box 54, Warrensburg, MO 64093-0054.
2 President’s Message 14 Alumni News 16 Chapter News
To Parents: Your son’s magazine is sent to his home address while he is in college. We hope you enjoy reading it. If he is no longer in college and not living at home, please send his new permanent address to Sigma Tau Gamma Fraternity, P.O. Box 54, Warrensburg, MO 64093-0054. This issue of The Saga was partially funded by the “William P. Bernier Endowment for Educational Publications, as funded by Marvin M. Millsap” and Alumni Loyalty Fund contributions.
17 Chapter Eternal 19 Foundation Message
Contact Us: Alumni and undergraduates are encouraged to submit news, stories, and photos for The SAGA to the editor at jkirk@sigmataugamma.org. Photos should be sent via regular mail to Editor, P. O. Box 54, Warrensburg,, MO 64093.
Phone: (660) 747-2222 Fax: (660) 747-9599 Mail: P. O. Box 54, Warrensburg, MO 64093
PLEASE VISIT SIGMA TAU GAMMA ONLINE AT:
WINTER
’02
SAGA
3
The tragic events of September 11th changed the lives of Americans -changed the way we live and our outlook on the world. Everyday citizens emerged as heroes. The true meaning of heroism became more definitive. Among these heroes stood the Brothers of Sigma Tau Gamma. In the face of adversity, they met the challenge. The following pages are dedicated to our Brothers - Brothers who served our country, as firefighters, police officers, military personnel and leaders Brothers who exemplify the principles of Benefit and Leadership - Our Brothers.
Brothers At The World Trade Center In the wake of the September 11, attack on the World Trade Center, the SAGA searched for the stories of brothers who lived the experience at the scene of that tragic day.
Clay Patterson, Alpha Chi ’00 (University of Illinois) worked in an office across the street from the World Trade Center. He called the World Trade Center “magnificent” and considered it a privilege to walk “underneath those massive gleaming towers.” On September 11, he was not in his office, but at a project near a school a few miles north in the Bronx. Upon learning about the first plane hitting the World Trade Center, he had enough presence of mind “to call my Dad, leaving a message that I was not in the office today, because I knew he would be worried.” “When the towers collapsed,” he writes, “I was in complete disbelief. I can remember thinking, no way, not those towers. They’re massive. How could it.” His energy turned to searching for coworkers and friends. Clay never returned to his office near the World Trade Center and now works from an office in New Jersey.
Brandon Wustman, Gamma Chi ’91 (Michigan Technological University), is a research scientist at New York University. On Tuesdays he would normally walk to Washington Square for a routine meeting with his boss, passing through the north tower of the World Trade Center. On September 11, he was running late and caught a subway train instead. It was on the subway that he learned about an “explosion” at the World Trade Center. Brother Wustman writes that about 20 minutes later “I was exiting the subway station at Astor Place. I noticed crowds of people had gathered on the sidewalks. Traffic was at a stand-still and people were pointing south, toward the twin towers. I looked up to see smoke billowing from the tops of both towers. As I was crossing the street, I asked a police officer who was directing traffic what had hapBackground photograph by Michael Rieger/FEMA News Photo.
4
SAGA
WINTER
’02
pened. He looked at me with tears in his eyes and said, “They’ve crashed two jets into the towers.” I instantly ran for my office, just a few blocks away. I tried several times to call Sandeep (my wife) at home, but the line was busy. So I wrote my boss a note, telling him I had to return home. Just as I opened the door to leave, the lab phone rang and it was Sandeep crying. I told her I would head home. At the Wall Street stop on the subway home, a group of three people got onto the subway and one woman was telling of her escape from one of the twin towers. When I arrived at the Bowling Green station, I exited to find the traffic in complete grid lock and everyone out of their cars watching the burning towers. Inside the apartment, I called my parents to tell them that we were OK and we were going to find Sandeep’s sister, Amar who worked in the World Financial Center. I figured she might be outside by the water, since her building was evacuated. We followed the path along the Hudson River, around the south end of the marina, at the World Financial Center. We were just opposite of the south WTC tower, about 200 yards away. We suddenly heard an incredibly loud rumbling sound. We looked up to see the tower falling toward us, and we instantly turned and ran. Some people were jumping in the river, while the rest just kept running. We ran to the closest building, jumped a fence, and hid under a short overhang. The overhang protected us from the larger debris, but not from the cloud of dust that followed. Everything went black and we covered our faces with our shirts so we could breath. We found our way into a restaurant, everyone looked like ghosts covered head to toe with a thick layer of gray dust. We decided to try to make it back to our apartment, not knowing what could happen next. Outside, the world lacked all color. Everything was gray and we walked ankle deep in gray soot and paper; newspapers, order requisitions, magazines, receipts, business cards, etc. In the river, tub boats (called in by the Coast Guard) were picking up the people who had jumped into the river. Back at our apartment, we were told to wait in the basement of the building until we were given further instructions. After waiting in the basement for several hours, we
decided to go up to our apartment to pack a few things. We had only enough time to grab our credit cards, a flashlight, and a bottle of water when someone shouting and pounding on doors informed us that there were gas leaks all over the area and we were being evacuated immediately. We could see from our window, people were being hurriedly boarded onto police boats and every other type of floating vessel and swept across the river to Liberty State Park in New Jersey. At Liberty State Park, over a hundred ambulances were lined up on a football-size field, waiting for victims. The uninjured, including ourselves, were bussed to a nearby National Guard Base, and a few hours later to another larger base. Here, we finally received word from my parents that Amar had contacted them and was fine. Around 7:00pm, those who had a place to go were bussed to Penn Station in New Jersey. At the train station, we were decontaminated and put on trains to where ever we wanted to go. I attempted to buy a ticket, but the man at the counter laughed at me and told me no tickets were needed today; just get on the train. We boarded one headed for New Brunswick, NJ, where we met friends, rented a car, and drove to my parents in Michigan.”
Andrew Porta, Phi ’93 (Southeastern Louisiana) is a consultant in Financial Services Management with DeLoitte Consulting. He lives in Charlotte, North Carolina and works from offices in Charlotte, Atlanta and New York. His New York office was in the World Trade Center. On September 11, he was working from the New York office and was lodged at the World Trade Center Marriott Hotel. As he was putting on his shoes to head to the office, he heard a loud thundering explosion that rocked the building, followed by the sound of metal scratching on metal. His first thought was that maybe something went wrong with the construction they were doing upstairs. A gas pipe explosion? He made his way to the window to look out-
WINTER
’02
SAGA
5
side, only to see a sight he will never forget. There was debris raining from the sky and people running frantically. He grabbed his briefcase and knew he had to get out. When he opened his door, he saw others also looking for an escape route. They headed down a staircase to a backside exit that had a large glass atrium. As they worked their way down the steps they could see the horror unfolding outside. Burning debris blocked the exit. He could see the severe injuries outside. Members of the group were beginning to panic. Others wanted to break the glass and attempt to climb over the debris. Andrew convinced everyone to head back to the 2nd floor so they could see if the lobby was a better option. When they arrived at the lobby, there was a WTC Marriott Hotel, crowd of people waiting to exit. They collapsed glass atrium. were slowly funneling people out to the south with women and children going first. He was 30 to 40 feet from the exit when he heard a 2nd explosion. Firefighters and policemen came rushing inside as the fiery debris was raining outside. At this point, pandemonium set in and even Andrew began to question whether he would get out. Once the outside looked clear, the firefighters and policemen began allowing people to leave the building. When it came to Andrew’s turn, they told him to run straight south, don’t look back and do not stop to try and help anyone as they are beyond help. As he ran south, he could hear explosions and debris crashing near him. He ran for two blocks before he turned to see the horror he left behind. He attempted to call his wife, but he couldn’t get through. He decided to run a couple more blocks to a point that he thought was safe and he sat down to take a rest. As he was sitting there, he realized he was still carrying his briefcase. From where he was siting, he could see the towers burning and people jumping from the top floors. One of his partners was able to get through to him on his cell phone to ascertain that he was okay. Moments later, he began to hear a loud crashing sound. As he looked up, he saw the top of one of the towers coming apart and a cloud of debris and dust rushing toward him. He began to run in the opposite direction. While he was running, he noticed a woman had stopped and was gasping for air. He stopped to help and to try to get her to safety. He stopped a man to see if he could help and he happened to still be carrying his lunch bag. They used the lunch bag to help her catch her breath. As he looked up, he noticed a half a dozen people standing around, trying to help. It was at this moment he realized that there were people from all walks of life coming together to help. They were able to help get the woman to a point where she wasn’t in any immediate danger. Now that he had a chance, he wanted to find his colleagues to see if they were okay. As he was walking, two people literally bumped into him and it just happened to be his colleagues. While standing there, they could see the second tower fall and knew they wanted to get off the island as soon as possible. The three of them loaded a ferry to Hoboken, NJ and went to stay with a friend’s relatives. It wasn’t until 48 hours later that he was finally able to see his wife. When Andrew looks back on September 11th, he remembers the tragedy and horror. But he also remembers the true sense of American pride, when everyday citizens stepped up and became heroes. 6
SAGA
WINTER
’02
Rob Ferraro, Epsilon Theta ’99 (Plymouth State College) is a foreign exchange broker for a private firm at the New York Board of Trade, which was located on the 8th floor of 4 World Trade Center. He remembers looking at the gleaming World Trade Center, from his Brooklyn apartment at 6:30 AM on September 11, on a crisp clear morning, thinking that it was going to be a gorgeous day. The trading day began slowly and normally, then the world changed at 8:46 AM. He writes: “The lights flickered for a few seconds, the floor noticeably shook. The trader’s ooohd and aaahd. I heard one broker say to another, “maybe a bomb went off again”. Apparently, the same flickering of the lights and shaking of the floor occurred during the 1993 WTC bombing. The next few minutes were the scariest of my life. Out of the corner of my eye I caught several grown men noticeably crying, sprinting for the exits. All of the people who were eating breakfast that day in the cafeteria had an unobstructed view of American Flight 11 slamming into the North tower. My instincts told me to run for my life. None of us had any idea what had happened. I found myself running down the stairs as fast as I could, with about 400 other people, all asking the same question, “what had happened”. When I got to the bottom floor and emerged from the building, I saw the horror. Thick black smoke billowing from the North tower. Bits of plane pieces falling all around us. It was as if I was in Hell. The wind was swirling, picking up the paper that had been sucked out from the blast. Everyone stared at the horrible scene unfolding in front of our eyes. The sight of seeing bodies drop from 110 stories up and hitting the concrete will never leave my mind.” Rob is thankful for God sparing his life and mourns the loss of friends and coworkers who lost their lives that tragic day.
Background photograph by Michael Rieger/FEMA News Photo.
Richard J. Spanard, Beta Tau ’93 (Slippery Rock University) is a U. S. Army captain and commander of an Explosive Ordnance Disposal company based in northern New Jersey. On the morning of September 11,. The building was full of people in the midst of evacuating. A second explosion was heard, and people began mobbing the three escalators in a state of panic. Spanard and the now five soldiers with him began yelling for everyone to remain calm and walk to the elevators in an orderly fashion. “To our surprise,” Spanard said, people heard and obeyed the direction. With his cell phone not working, Spanard, with another soldier, moved to a second deli to use landlines to establish telephone communication. He was at this deli when he experienced “the terrifying sensation of a 110 story building coming down.” After deciding that this deli was no longer safe, he moved to a public school building that was being evacuated. After all of the children were safely relocated, he used the telephone to account for all of the sailors and soldiers that were to meet with him that morning. Then they began receiving calls from parents concerned about the safety of their children. “We were able to calm them and reassure them and give them the location and phone number of the school to which their children had been moved. I will never forget the fear in the voices of those parents” he recalled. “In all honesty, to this day, as those unforgettable events replay in my mind, it brings tears to my eyes.”
The Principle of Benefit, To Serve Fraternity, College, Country!
First Responders Brothers Answer the Call Sigma Tau Gamma brothers were among those who answered the call to serve on September 11, 2001. Those who answered the SAGA call for stories all identified others as heroes, but of course they are heroes as well.
Kevin Cunnane, Alpha Nu ’91 (SUNY-Oneonta) is a New York City Fire Marshal. He was at Tower 1 of the World Trade Center. He writes; “I can tell you that the FDNY consists of the finest men this country has to offer. We suffered huge losses, as you know, but certainly the civilians that died represent the real tragedy of September 11th. My FDNY Brothers were doing their job. A job that we all love. I am sure that any one of us, who lived to tell about September 11th, would trade places to save just one more life that day. I lost many close friends, too many acquaintances to count, and 343 colleagues. They orchestrated the greatest rescue in the history of the United States that day, and that is how they need to be remembered. The FDNY heroes were casualties of war, please don’t call them victims.” Pat McNerney, Gamma Alpha ’93 (Mansfield University of Pennsylvania) is a Port Authority police officer who was on duty at the World Trade Center. Joe Schetroma, a fellow Gamma Alpha chapter brother, persistently tried to contact Pat to be sure his brother was OK. Here is Pat’s story as told to Joe in an e-mail. “All is well here, thanks for inquiring. In regards to 9/11, it was the worst day in my police career and the department’s history. We lost 37 members that day, more than any police department in history. We are only a department of 1,400, so it was personal for everyone. “I was standing on the corner of 42nd Street and 8th Avenue when I saw one of the planes go by. Our reaction was that of surprise because the plane was so low and it was traveling north to south over Manhattan Island. Several minutes later we received a radio call to return to the police station ASAP. We returned to the police station where a commandeered bus was waiting to take us to the World Trade Center. As we made our way, we were informed that a plane had hit one of the towers. As we came around a corner, we could see the fire. As we got closer we started to observe people jumping out of the windows. The bus stopped one block away from the towers. As we exited the bus, we continued to see more people jump from the tower. Thankfully, we never saw them land. We were split up into two groups. My group was ordered to go around to the opposite side of the WTC to provide assistance. The other group was ordered to assist in the concourse area of the WTC. These officers entered the building and put on Scott Air Packs to assist others. As they got deeper WINTER
’02
SAGA
7
inside, the building started to come down. Three of the officers who were on the bus with me, and who I had turned out of roll call with that morning, were killed. Officers, Will Jimeno and John McLoughlin, were trapped for over 10 and 12 hours respectively. They were the last two survivors’ pulled out of the debris. One of the three officer’s killed, Dominic Pezzullo, had initially survived the falling of the first building. He was okay and able to get out, but when he heard Jimeno and McLoughlin in pain, he came back for them. The second tower then came down and killed him. Somehow, Jimeno and McLoughlin were buried under the first tower and the second tower missed them. Jimeno say’s he was able to speak with Pezzullo before he died. It was truly incredible what he did. It was horrible enough for Jimeno to have to go through this event, but to have his friend next to him and to hear him say his last words was even more difficult. Jimeno and McLoughlin were both in Intensive Care for months and hopefully will fully recover.” “Though I got off the subject of what my day was like, I felt I needed to tell you about some true heroes. I responded and assisted people coming out of the Trade Center. When the first building started to come down, we started to move people back. We then evacuated a building and a high school. As we were evacuating the high school, the second building came down. We were afraid other buildings were going to get hit and we were receiving reports that other planes were possibly on their way. We had heard unconfirmed reports about the Pentagon and the plane in Pennsylvania, so we also thought we might be attacked again. There was actually talk of us jumping into the Hudson River if another plane came. We then regrouped with some other Port Authority police officers. We attempted to enter the debris but were told not to enter because of the structural integrity of the other buildings was in question. Building number seven came down at 5:17 pm. We were all ordered back and they sent in replacements for us. As I walked to the train, I realized that this was the only time I have ever walked eight blocks in Manhattan without a car passing me. It was like a ghost town. Joe, there is so much more to tell it is incredible, but these 12 and 13 hour days, six days a week, don’t leave me with much time for anything. Will be in contact.”
“The FDNY heroes were casualties of war, please don’t call them victims.” ---- Kevin Cunnane, Alpha Nu ’91
8
SAGA
WINTER
’02
Hiram Tabler, Tau ’85 (East Central Oklahoma University) is an Administrative Officer in the 45th Support Detachment Force of the Oklahoma Army National Guard. Prior to the events of September 11th, he was preparing to deploy 24 soldiers to the Republic of Egypt for a military operation named Bright Star. Needless to say, the events September 11th caused hesitation of the deployment. Before, during, and after the deployment, the heightened awareness of security kept his unit busy because their job was to assess military base security and force protection for units deployed into an area of operation. He responded; “I want to let everyone know that we, as soldiers and civilians, need to be aware of the threat and situations within the United States of America. For a long time we have lived in a society that has been freedom oriented and we must now give up some of our freedoms to live in a safe society. Please be patient as the government and our military tries to figure out how to keep us safe on our own soil. This may mean placing military police on our streets and jet fighters in the air over our own lands. Some may not think this is necessary and may think it’s overkill to do this, but believe me, our government and military organizations are most concerned with the safety of our homeland. I know that waiting in long lines at the airport, having the mail system slow down important letters to our families, and going through metal detectors and being searched at certain facilities may inconvenience people. This needs to be an accepted as a new way of life if we want to protect ourselves from terrorist activities. I became a member of two great organizations, the Sigma Tau Gamma Fraternity and the United States Army. These two organizations have helped me become a better person and a proud, patriotic American.”
Background photograph by Michael Rieger/FEMA News Photo.
From the Pentagon The events of Sept. 11 have affected each of us in a differenet way. For some brothers, it hit close to home. Daniel Clara, Beta Tau ’95 (Slippery Rock University) is a teacher near Somerset County in Pennsylvania. On the day of the attacks, Dan and his students were in the library. When the attacks began, they were able to see the live footage. “While some of my students wept, others just stared in disbelief.” Even with the tragic events happening in the world, Brother Clara could only think of what his students were feeling. He writes, “I felt a horrible sense of foreboding as I looked at the students who were with me that day. That day, they lost a sense of safety and security that may never completely return.” The plane that crashed in Pennsylvania passed directly over Brother Clara’s school and crashed a mere 30 miles away. For Dan, it was a little too close to home. “A few seconds earlier, and that plane may have come down in the middle of my hometown. I remember thinking that it had been close. In fact, it was just seconds that made the difference,” he wrote.
Jeff Janosik, Beta Iota, ’83 (California University of Pennsylvania) “As an active duty Army officer assigned to the Pentagon, the events of 9/11 certainly affected me as much as any American. As a brother of Sigma Tau Gamma Fraternity, however, that day proved once and for all what brotherhood is all about. Although assigned to work on the Headquarters, Army Staff, which is located in the Pentagon, my agency was temporarily located less than a half-mile away due to a phased renovation project of the northwest sector of the Pentagon. I was originally scheduled to return last June, then postponed to August, then at the last minute postponed again to mid-October. As of 9/11, our agency had moved our unclassified servers and some office equipment and furniture. The area that I was to return to was the EXACT area that was attacked. If not for the renovation project, the number of casualties would have been significantly higher. Ironically, on 9/10, I attended a morning meeting located in that same area. Indeed, a twist of fate. In the hours and days that followed, I received countless phone calls and e-mail messages from old brothers, which reinforced my faith as a Sig Tau. Although I’ve remained semi-active with my Chapter’s Alumni Association, I had no idea that so many brothers even knew of my current assignment. In fact, within minutes of the attack on the Pentagon, my first four phone calls were from brothers. Several other brothers who reside throughout the country would contact me throughout that day and night, as the nation watched with horror and wondered where the next strike may be. Even with my phone lines and internet links either being down or congested, they persisted in getting through to me. I feel humbled to think that so many good people truly care about me. I would imagine that 9/11 has forced all of us to refocus our lives on the important things in life. For me, fulfilling my responsibilities as a father, husband, Catholic, career Army officer, and yes - as a Sig Tau, will never be the same. Fraternity life may be waning at college campuses. But, it’s clear to me that the friendships I made as a young undergrad, and as a brother of Sigma Tau Gamma, are solid and will last indefinitely. For that, I am forever grateful.”
Joseph A. Vitale, Epsilon Iota ’99 (College of New Jersey) used to spend countless hours gazing at the NYC skyline. Growing up just 40 minutes away, he would often visit the many landmarks the city had to offer. Even months after the tragedies of September 11th, Joe is still in awe of the sight of the NYC skyline with the landmark Twin Towers absent. He writes, “About three days after, I was at the waterfront in Jersey City, New Jersey, which is right across the Hudson River from lower Manhattan. The smoke was still rising. Just down the river, one could see the Statue of Liberty, whose presence in that harbor was even more enlightening. I have been to Ground Zero to pay respect for those who have been lost. I was one of the lucky ones. One by one, I was able to hear from all of my friends and loved ones who dodged death that day. It all has been a truly humbling experience.” Joe teaches 7th and 8th grade and has discussed many aspects of the September 11th tragedy with his students. Many of them have been touched directly. “Brothers, sisters, mothers and fathers have been taken from these young people and it’s a loss that can never be repaid,” Brother Vitale writes. But as an educator, Joe will play an important role in helping these students cope with the loss. WINTER
’02
SAGA
9
“Lifelong Principl
by Lt. Paul “Bones” Mitchell, USN, Delta Xi ’95
The Pacific Ocean — An F-14A Tomcat, attached to Fighter Squadron One Five Four (VF-154) “Black Knights”, flies over USS Kitty Hawk (CV 63) after completing a training mission. VF-154 is assigned to Carrier Air Wing Five (CVW 5) and is homeported at Naval Air Facility Atsugi, Japan. U.S. Navy photo by Chief Photographer’s Mate Mahlon K. Miller. [990807-N-0226M-002]
es” “Camelot 200, Tomcat Ball, state 6.2.” The F-14A Tomcat on short final from the VF-14 Tophatters finished off another combat mission in support of Operation ENDURING FREEDOM with another perfect arrested landing aboard the aircraft carrier USS ENTERPRISE (CVN-65), deployed somewhere in the Arabian Sea.
S
o ended another “day at the office” for me.
You might be wondering, just who is this? At my squadron they call me “Bones.” At Delta Xi Chapter I was known as “Mav.” I am a 1995 graduate of Carnegie Mellon University. Today, I’m a RIO (Radar Intercept Officer) who flies in F-14A Tomcats. I just returned from a seven-month deployment aboard the ENTERPRISE flying combat missions in support of Operation ENDURING FREEDOM. You might wonder why I’m writing something for this issue of the SAGA about how September 11th impacted my life. Aside from the obvious impact it had on me from being deployed there and out on the “front lines” when ENDURING FREEDOM first kicked off, when Ben Roberts (one of my fellow brothers from Delta Xi) and Justin Kirk approached me about this issue of the SAGA, I realized that many of the principles I learned from Sigma Tau Gamma had a direct connection to those things that kept me safe while flying combat missions over Afghanistan. I first heard the news while sitting in my ready room on the carrier. The entire day seemed almost surreal, taking on a “this should only happen in the movies” kind of feel. After I got over the initial shock, my training kicked in, focusing my efforts onto the job at hand. You might ask, what does that kind of focus entail? It takes a sense of value…that feeling of belonging to something that is greater than yourself. Whether it’s to Sigma Tau Gamma, to the US Navy, or as a citizen of the United States, it’s still the same concept. It takes a sense of learning…the humility to realize that no matter how far you’ve come, you still have a long way to go. It takes a responsibility to rise to the challenges of leadership…to have the courage to make the hard decisions and do the right thing when the going gets tough. It takes a dedication to excellence…an unswerving quest to strive for superior performance and better yourself. It takes an unquestionable commitment…the responsibility we all have to benefit our fraternity, college, and country. And it also takes a sense of honor and integrity…that way of living which affords you and everyone you meet the dignity they deserve while upholding your ideals. The principles I learned in Sigma Tau Gamma (the six principles of Value, Learning, Leadership, Excellence, Benefit, and Integrity), I carried with me as I dealt with the events of September 11, and later as I went into combat in support of Operation ENDURING FREEDOM with a sense of honor, courage, and commitment. Many people don’t think about what they learned from their college fraternity days on a daily basis, but I think if you live by those basic truths, you can accomplish anything. Those six principles helped give me the strength to survive over those dangerous skies of Afghanistan and return home to share my experiences with you.
Scholars
ROSKENS Scholastic Achievement Award The Ronald W. Roskens Scholastic Achievement Award recognizes those members who attain a grade point average of at least 2.75 on a 4.0 scale. The program exists to encourage scholastic achievement and to facilitate the involvement of faculty advisors in that process. Those members who are eligible for the award receive a custom-printed Sigma Tau Gamma Scholar T-shirt and a certificate suitable for framing. The headquarters office also sends a letter to the students’ parents in recognition of his scholastic achievement. Ronald W. Roskens, NMF, Alpha Eta ’53 (University of Northern Iowa) for whom the award is named, was the fifteenth national president of Sigma Tau Gamma Fraternity. He is a leader in higher education, having been President of the University of Nebraska. In the George Bush administration, he was director of the U.S. Agency for International Development. He is now an international business consultant.
Alpha Gregory C. Barry ’02 David R. Bodenhamer ’03 Paul J. Dick ’03 Brian M. Dobrynski, CSM ’01 Tyler M. Dykes, WCMF ’02 Aaron J. Eich ’04 Tyler S. Farnsworth ’02 Andrew P. Griffin ’00 Christopher P. Huelsebusch ’01 Scott T. Lenz ’03 Don W. Lile II, CSM ’99 Jacob S. Lock ’03 Keegan C. Magee ’03 Cameron N. McDaniel ’01 James C. Milne ’02 Bradley C. Pryor ’03 Christopher P. Rodriguez ’01 Mark W. Schulte ’03 Benjamin J. Spiking ’03 Brice M. Spridgen ’02 David M. Steffens ’02 Benjamin T. Troiani ’02 Jeremy R. Underwood ’04 Clifton R. Vandeventer ’03 S. Michael Woods, CSM ’02
Beta Chancie C. Adams ’01 Adam A. Allmon ’01 Benjamin R. Askew ’02 James A. Atkins ’01 Nicholas P. Becherer ’01 Mark E. Beckrich ’04 Andrew C. Blandford ’03 Brett A. Bohon ’01 Matthew W. Britt ’03 Daniel C. Chavez ’02 Matthew K. Clauss ’02 David W. Cleaver ’02 Jonathan L. Cleaver ’04 Sean P. Corrigan ’04 Brian M. Cosmano ’04 Wesley D. Creech ’04 Joshua D. Diehl ’01 Drew A. Dunahue ’03 William S. Gillis ’01 Joshua M. Grahlman ’03 Lee T. Hall ’04 Neil C. Harris ’04 Jeffrey T. Heisler ’03
12
SAGA
WINTER
’02
Luke S. Hubbard ’01 Justin B. Imhof ’02 Preston L. Imhof ’04 Benjamin J. Klein ’04 Joe R. Kummer ’03 Jake J. Maier ’04 Joseph A. Manning ’04 Colman D. McCarthy ’04 Matthew S. McDuff ’04 Brett E. Meeske ’05 Neil A. Meyer ’04 Patrick D. Morrison ’02 Blake A. Padberg ’02 Matthew A. Pieper ’02 Wyatt Z. Roberts ’03 Joshua A. Roesch ’04 Brian M. Roscoe ’02 Kenneth K. Rosenkoetter ’02 Matthew J. Roth ’02 Andrew G. Schroll ’03 Thomas P. Schuette ’02 Ryan M. Sedlak ’01 Ryan K. Shreve, CSM ’02 Joseph L. Skinner ’04 Peter T. Smith ’04 Thomas B. Spencer IV ’02 Timothy A. Spencer ’03 Christoph J. Strohmayer ’02 Wesley E. Swee ’02 Steven W. Turner ’04 Joseph M. Voss ’04 Scott E. Weindel ’02 David M. White ’04 Daniel J. Williams ’03 Adam C. Winfrey ’01 William P. Wingbermuehle ’01
Epsilon
Pi
Adam T. Baker ’03 Jeff Blackard ’02 Bret C. Bozich ’04 Darin T. Cizerle ’02 Matthew E. DeDonder ’02 Ian M. Griffin ’02 Edward Hosch ’02 Jason M. Krenzel ’05 Zachary A.Moore ’01 Ross E. Nigro ’02 Ryan M. Raven, CSM ’02 Ben J. Rees ’04 Brian J. Skahan ’03 Kris K. Von Fossen ’01
Jeffrey L. Fenton ’04 Trent A. Kissinger ’02 Darren T. Laustsen ’02 Jay A. Mathews ’01 Jeffrey C. Mountain ’04 Joel P. Rodriguez ’00 Justin P. Ruggles ’04 Jesse E. Rusinski Jr., CSM ’02 Brandon J. Sondag ’03 Kenneth A. Sosnick ’03 Vincent B. Valerio Nathan A. Wolfe ’04
Sigma Iota Dominick P. Altieri ’04 Paul M. Bartholet ’04 Eric S. Dideon ’01 John D. Eaton ’02 Chris L. Gentille ’02 Michael B. Jarnicki ’03 Robert L. Leon ’02 Michael E. Phillips ’02 Joshua J. Pijor ’02 Nicholas A. Prato ’05 Randall T. Schroeder ’01 Michael A. Vetrick ’03
Lambda Matthew J. Mueller ’03 Shawn T. Travis ’04 Justin C. Varland ’02 Jeffrey R. Williamson ’02
Delta
Mu
Sean M. Daly, CSM ’04 Patterson W. Gayden Jr. ’03 Matt A. Kerns ’03 Clinton S. McCurry, CSM ’01 Michael J. Museousky ’02 James C. Musgrove ’03 Darin L. Nichols ’99 Grant M. Rempe ’04 Paul D. Rundle ’04 Cody M. Snyder ’05 Danny W. Stotler ’01 Jesse C. Tuel, CSM ’01 Greg N. Watt ’02
Nathanael B. Baker ’03 Chad K. Buchanan ’04 Joseph S. DeFalco ’04 Chad D. Hendrix ’03 Michael D. Jenkins ’04 Michael A. Jensen ’00 Jeremiah B. Johnson ’02 Paul A. Key ’02 Michael D. Kiester ’03 Macy P. Mitchell ’03 Michael R. Paulsen ’04 Nicholas P. Prins ’02 Ryan L. Wood ’03
Joshua E. Allen ’01 Kyle E. Allison ’04 Jody A. Bradshaw ’02 Thomas J. Cabantac ’01 Evan Collins Ronnie A. Dodd ’02 Aaron K. Forrester ’02 Chad H. Gossett ’00 Joshua H. Greene ’03 John D. Hardin ’03 Christopher A. Hillis ’03 Bryan R. Lawrence ’03 Jeremy M. Moix ’02 David T. Soloman ’02 Stephen J. Strack ’02 Clint M. Tyler ’00 Patrick M. Westerman ’03 Bradley S. York ’03 Jonathan J. Young ’01
Alpha Zeta John J. Flora ’02 Shane C. Hohn ’02 Nathan M. Montgomery ’01
Alpha Phi Justin T. Buchheit ’02 Jeremy S. Fitzjerrells ’04 Aaron J. Miesner ’04 Walter J. Peleshenko ’01 Craig A. Raney ’04 Todd M. Reich ’02 Karl A. Samson ’04 Matt A. Uchtman ’03 Jeffrey M. Wehner ’03
Scholars Alpha Chi
Beta Lambda
Alexander M. Barr ’03 Christopher M. Bengston ’04 Ross F. Bickel ’04 Jeremy L. Bosch ’03 Andrew C. Branson ’04 Artie E. Calbert ’03 Brian D. Dauenhauer ’02 Brian D. DeGraff ’01 Stephen I. Delicath ’01 Kyle C. Hanson ’04 Gregory T. Harris ’03 Stephen S. Hellerman ’02 Ben J. Jablonski ’02 Theodore R. Jablonski ’04 Rodrique Lauture ’02 Edward H. Leonard ’02 Nilay D. Mistry ’02 Jason D. Moore ’04 Todd D. Pozen ’02 Benjamin D. Rigby ’01 Michael D. Salinas ’03 Dominique G. Sanchez ’04 Paolo S. Segre ’03 Matthew R. Shipley ’04 Aaron J. Smiley ’03 Philip J. Wenger ’03
Charles K. Appler ’02 Brian A. Damato ’03 Marcus J. DePasquale ’02 David C. Dixon ’03 Tyrel J. Fisher ’04 Daniel J. Herbert ’03 Gregory A. Human ’04 Brent A. MacDonald ’03 James D. McBride ’04 Brian J. McInerney ’03 Jeffrey M. Pittman ’04 Jonathan P. Schiemann ’02 Charles K. Smith ’03 Jason M. Tomlinson ’01 Justin R. Watkins ’04 Timothy V. Weidner ’02 Joshua J. Wingstrom ’02
Alpha Psi Jeffrey S. Archer ’03 Benjamin T. Bachman ’04 Michael T. Butson ’04 Christopher M. Damich ’03 Matthew W. Fowler ’01 Jonathan W. Lekse ’04 Thomas H. McKnight ’03 Benjamin D. Morgan-Cohen ’03 Robert B. Pugh ’04 Matt S. Schnieders ’04 Matthew D. Smiles ’04
Beta Tau Aaron A. Anderson ’02 Christopher G. Benedict ’00 Pete M. Brough ’04 Anthony H. Brunner ’02 Michael J. Chmielewski ’02 Shane P. Cody ’03 David J. Flick ’02 James E. Kane ’02 Jason M. Keffel ’01 Phillip J. Martello ’04 Brian C. Mattison ’01 Matthew H. Meneely ’02 Troy D. Miller ’00 Brandon D. Nickel ’03 Adam N. Renner ’02 Alexander P. Samaras ’03 Robert J. Slopek ’02 Christopher S. Todd ’03 Nathaniel T. Wills ’03
Alpha Omega Zachary P. Best ’03 Edward P. Bosanquet ’03 James W. Dolson ’03 Brian C. Foerstel ’01 Joseph M. Fritschen ’05 Christopher M. Horvath ’03 Lenny Ilyashov ’01 Eric J. Lindholm ’00 Matthew J. Neil ’04
Kevin M. Ahern ’02 Mike R. Hauert ’02 David W. Thornbury ’02 Michael J. Trotta ’02
Delta Beta
Gamma Theta Matthew K. Berra ’04 Jason R. Collier ’00 Robert J. Curcuru ’01 Dave E. Kinworthy ’01 William E. Kruse ’99 Donnie B. Maisel ’04 Colin C. Post ’01 S. Bradley Thompson ’00
Gamma Nu Chad A. Bauman ’02 Brandon A. Berrey ’04 Michael M. Cain, CSM ’03 Brett E. Carlson ’00 Jeremy A. Daus, CSM ’99 Eric L. Galvin ’03 Timothy A. Hafermann ’00 Frank J. Horvath Jr., CSM ’01 Collin S. Jasnoch ’04 Corey M. Lansing ’01 Aaron A. May, CSM ’00 Jason E. McLean ’02 David E. Pawelk ’04 Jason A. Reeves ’03 Michael W. Richter ’04 Justin M. Soine ’02 Andrew W. Way ’03
Shawn W. Chartier ’02 Michael A. Greenheck ’03 Erik D. Henningsgard ’01 Kyle R. Kieliszewski ’03 Jerry L. Laack ’05 Robert A. Laduron ’02 Kyle E. Larson ’02 Keith J. Mlodzik ’03 Jeremiah R. Moll ’03 Tyler J. O’Rourke ’02 Jeremy R. Probst ’03 Adam B. Prochaska ’02 John P. Richter ’02 William R. Schubert ’02 Joshua P. Schwenzfeier ’02 Nicholas A. Seeger ’03 Eric J. Urban ’02 John C. Wearing ’04
Steven A. Anzo ’04 Joseph T. Dietrich ’04 George J. Fischer ’04 Daniel G. Heizman ’04 Mark A. McClendon ’04 Brent W. Ratliff ’04 Scott A. Ratliff ’02 Michael F. Shawki ’04 Donald A. Smith ’03 Quan M. Tran ’04 Brendan J. Walker ’04
Beta Chi Keith R. Alger ’03 Joseph D. Dominguez ’02 Bryan M. Ingold ’02 Jeffrey M. Knier ’03 Kevin L. Marien ’01 Dustin S. Schroepfer ’04 Brian D. Shaw ’02 Barry D. Sommer ’01 Andrew C. Sommers ’04 Scott K. Swanson ’02
Gamma Gamma
Jason S. Myers, CSM ’02 Brian P. O’Connor ’02 James J. Saksewski ’00 James E. Scarlett ’02 Casey S. Sparks ’04 Kevin A. Toadvine ’02 David A. Vennie ’04 Michael P. Vigrass ’03 Roben M. Walker ’03 Josh E. Wendschlag ’03 Jeremy L. Winsor, CSM ’02
Gamma Xi
Beta Alpha
Beta Kappa
Jason D. Steinshouer ’01 Nathan A. Suverkrubbe ’02 Daniel P. Svoboda ’05 Luke V. Warman ’03 Daniel P. Wesolowski, CSM ’02 Laron K. Williams ’04 Michael R. Witte ’00
Nathan B. Bennett ’03 Robert W. Bishop ’02 Andrew A. Bohnenkamp ’01 Derek L. Frese ’05 Andrew P. Gregory ’04 Jared C. Hanson ’02 Matthew R. Hillebrandt, CSM ’02 Christopher J. Marcello ’02 Paul P. Maupin ’04 Michael K. Nelson ’04 Matthew B. Noffke ’05 Seth R. Ryser ’01
Philip R. Brenckle ’03 Michael J. Bushwack ’03 Michael T. Byrne ’02 Colin M. Chisholm ’03 Brad M. Ciccolella ’02 Matthew M. Cuomo ’02 John S. Donoughe ’04 Daniel J. Donovan ’04 Bryan M. Durkin ’03 Robert A. Fiori ’02 Ryan G. Flannery ’03 Dustin W. Freas ’05 Steven A. Hale ’02 Bao D. Huynh ’04 John J. Kelly ’02 Michael J. Kulasewski Jason S. Lasser ’04 Matthew R. MacDonald ’03 Edward J. Molyneaux ’01 Ronald A. Paulovich ’03 Christopher J. Sidoni ’03 Jeffrey C. Wall ’03 Timothy W. Walsh ’01 Michael R. Webster ’04
Delta Iota Jason C. Bennett ’02 Shane F. Clancy ’03 Kevin T. Clawson ’03 Scott S. Cook ’00 Kristofer T. Freeland ’04 Clinton W. Jones ’00 Christopher C. LaGrone ’02 David R. Maloch ’04 Kyle T. Sanders ’01 Curt Y. Smith ’03 Tate R. Smith ’01 Matthew R. Turner ’01 James T. Waller ’04 Michael L. Webb ’02 Marvin B. Weido III ’02 Nick P. Wright ’04
Delta Upsilon Ryan T. Alexander ’02 Kolby D. Baker ’02 Joshua K. Boyce ’02 James T. Haring ’02 Patrick M. Kramer ’02 Jason D. McElhaney ’01 Jarrod D. Stanton ’02
Gamma Omicron Yoshiro Aoki ’04 Shinichi Asano ’04 Travis W. Haley ’05 Michael D. Petrella ’05 Keitaro Uehara ’04
Gamma Chi Charles V. Burch ’01 Patrick T. Jeffs, CSM ’01 Jason M. Kelly ’03 William R. Lee ’03
Delta Psi Adam Bernthaler Michael N. Hepler ’05 Joseph G. Hoover ’04 Kevin B. Lynch ’04
Aiken Colony Chad A. Adams ’04 David B. Buck ’01 Justin B. Hensley ’03
WINTER
’02
SAGA
13
Alumni News Delta Delta
Alpha Central Missouri State University Jacob Luebbring ’00, is currently employed as a Development Specialist in the foundation office at Linn State Technical College. Brother Luebbring graduated from CMSU in December of 2000 with a B.S.B.A. degree in Marketing. Jacob was recently engaged to Emily Rohrbach and resides in St. Thomas, Mo.
University of North Carolina Thomas E. Little ’86, was recently named President of Leasing Professionals, Inc. Little started with LeasePro in 1989. In his most recent position, he sold vehicles and marketed vehicle lease financing services to professionals and automobile dealers throughout eastern North Carolina. Brother Little is active in the Pitt County-Greenville Chamber of Commerce, the East Carolina University Pirate Club, and has also volunteered for United Cerebral Palsy. Tom and his wife Wendy reside in Greenville, N.C. and have one daughter, Anna.
Delta Nu Sam Houston State
Sigma University of Central Arkansas Galen Horton ’93, has taken a position as a Key Account Manager for the Coca-Cola Wal-Mart team, responsible for the Arkansas sales area. Brother Horton previously held the position of Cold Drink Channel Manager for the Mid-South Division of Coca-Cola Enterprises in Memphis, Tenn. Galen and his wife Christy have two daughters; Emiley who is 3 years old and Grace who is 1. They will be relocating to the Central Arkansas area.
Chi Western Michigan University Chris Hammill ’95, has taken a position with Hamtramck Public Schools as Vice Principal at Dickinson Elementary in Port Huron, Mich. Brother Hammill also works part-time as a Sheriff Deputy in the Marine Division for St. Clair County. He patrols the international border between Canada and the U.S. on the St. Clair River and Lower Lake Huron. Brother Hamill was a founding father of the Chi chapter and served as Chapter President. He and his wife recently adopted a son, Tommy, who is two and a half years old. 14
SAGA
WINTER
’02
Michael Adrian ’95, has been a producer of High Definition Television since 1995. He currently works for Mark Cuban (owner of the Dallas Mavericks) and HDNet, America’s first all HDTV Network. Brother Adrian produces Cuban’s weekly show as well as HDTV content that goes over the network. In the past, Adrian has produced anything from America’s first all High Definition Broadcasts to a behind the scenes feature of musical artist, Kid Rock. Brother Adrian has been working with actor Barry Corbin and a pro bono team on a new documentary project. Adrian and his team are putting together a 30-minute documentary about New Horizons Inc., a nonprofit residential treatment program that works to rehabilitate abused children. The documentary looks at the harsh reality children have endured before coming to New Horizons, and how the center’s programs have helped the children grow and heal. “We interviewed several children, teachers and staff. The harsh reality becomes evident not only through the stories, but through the tears. They all cried as they described a story that awakened them to child abuse,��� Adrian recalls. Adrian says he was looking for a project that would be ideal for the highresolution format of HD. “Brandon Grebe of New Horizons contacted me to see if I could help create a media demo that demonstrated the critical mission of their treatment center. HDTV is so realistic that it gives you a true sense of being inside the story. I immediately knew this was the project I had been looking for,” he says. After receiving the OK from actor Corbin, it took Adrian only six months to write a treatment and enlist commitments from sound designers, scriptwriters and other film crew members in Houston and Dallas. Corbin will be doing on and off-camera narration. Adrian will offer the documentary to PBS, major networks, a network in Japan and the HD Consortium — a group of stations nationwide that broadcast in HD. Information provided by Missy Turner and the Houston Business Journal
Epsilon Eta Murray State College Matthew R. Martin ’92, moved to Ft. Smith, Ark. in August 2001, and accepted a new job as county parks administrator for Sebastian County Government which is the largest county parks department in the state.
Σ
Alumni News
Sigma Chapter Donates 86 Years Worth of Memorabilia to University Archives By David Grimes, Sigma ’91
T
he Alumni Association of Sigma Chapter (University of Central Arkansas) donated its collection of papers and memorabilia to the UCA Archives at a reception held in the school’s library on October 9, 2001. This collection dates back to the beginnings of the group in 1915.
Brother Martin was a founding father of the Epsilon Eta Chapter at Murray State College. He and his wife, Cathryne, were blessed with their second child, Connor David Joel Martin in November. They also have a daughter, Alexandra.
The organization was founded on Thanksgiving Day in 1915 as a club known as the Owls. The Owls became UCA’s first Greek letter organization in 1928 when they became a local fraternity known as Kappa Phi Sigma. In 1934, the group became Sigma Chapter of Sigma Tau Gamma.
PHOTOS:
Many items are from fraternity events including rush banquets, homecoming festivities, and the annual White Rose Formal. There is also a wealth of photographs capturing memories from all eras of the chapter.
At left - Michael Adrian (far right) seated courtside at a Dallas Mavericks game. Below - left to right: David Grimes, Σ ’91, Conway Mayor Tab Townsell, Σ ’84, and Jimmy Bryant, UCA Archives.
Among the highlights of the voluminous collection are handwritten meeting minutes from the 1920’s and 1930’s, and several scrapbooks from the 1940’s, 50’s, and 60’s. Included in the scrapbooks are sections about World War II, detailing the service of numerous brothers, including the obituaries of several who did not return.
In addition to chronicling the fraternity’s legacy, this collection is also important in that it helps detail the history of the college, which was founded in 1907, and the city of Conway, Arkansas. The material was kept in a series of cardboard boxes and plastic containers before being handed over to the Archives to properly preserve and catalog. The boxes had been passed around from brother to brother over the years and kept in attics, closets, and garages. It is amazing it was never lost or destroyed. It is a testament to the quality of the type of young men that Sigma Tau Gamma attracts that they would ensure that such care was taken to preserve this invaluable collection for almost a century. As a part of the dedication, the winner of the secondannual Laney Award was announced. The Sigma Chapter Alumni Association presents this award to a chapter alumnus who has demonstrated leadership and achievement in their chosen field after graduation. It is named after Ben Laney, who was a member of the organization in the early 1920’s, when it was known as the Owls. Laney later went on to be elected governor of Arkansas, serving two terms from 1945 to 1949. The award is presented each year during UCA’s homecoming week. This year’s winner was Dee Brown, Sigma 1931 of Little Rock, Ark. Brown is an award-winning author of numerous books about the American West, including the landmark “Bury My Heart at Wounded Knee.” He was presented the Sigma Tau Gamma Distinguished Achievement Award from the National Fraternity in 1973. WINTER
’02
SAGA
15
Chapter News
Lambda Camps for Cash
BY JUSTIN VARLAND, LAMBDA ’02
THE DOORBELL RINGS. You quickly glance out the window to see who it could be. It is the evening so it may be a special friend, your sister, or baby-sitter, but it isn’t. It is a group of college students. Intrigued, you see a large sign with Sigma Tau Gamma in big letters across it and what looks to be... a tent? Yes, it is a tent and the Sigma Tau Gamma Fraternity is not afraid to use it. All they want is to spend the night on your lawn, unless you fork over at least $5.00 and send them somewhere else. This scenario has been a common occurrence throughout Spearfish, S.D. the past three weeks. These students have been creeping over to different lawns daily. Yes, these men have beds of their own to sleep on. But, they have another motive. “After one week of camping on campus and two weeks of lawn-hopping, Sigma Tau Gamma has raised $1,750.00 for the September 11th fund,” Vice President of Programs Scott Davis said. The “September 11th” fund has been organized to aid the families of those lost in the September 11th attacks in New York City and Washington D.C. The idea to camp out first came up in a fraternity meeting a few days after the attacks. Everyone was faced with the same problem of confusion and the need to help someone or something. “We were trying to think of a way to combine our yearly campus events while helping the people in New York,” Davis said. So, they went camping. After a week on campus, the fraternity decided to take their idea a step further. “We decided we had saturated the campus community,” said
Davis. “So, we threw the tent in the pick-up and went looking for new campsites.” Often camping only briefly due to the generosity of Spearfish residents, the number of campsites grew quickly to around 100 after two weeks. The campsites usually caught residents by surprise. After the surprise and a minimum donation of $5.00, the residents owned the luxury of directing the fraternity to its next ‘stay’. “We had a blast,” said Davis. “And, the fraternity never had to stay a whole night.” Along with ‘having a blast,’ the fraternity found success. “This ran more successful than we ever expected. We raised almost as much money with this fundraiser as we did with the entire Books for Kids drive we did last year.” commented Sigma Tau Gamma President Justin Varland. “Sigma Tau Gamma is the strongest organization on campus. They have been great in working with the community and raising money for those in need,” said Student Life / Union Director Jane Klug. “I’m very proud of them and glad to be able to work with them.” Sigma Tau Gamma’s grand total of $1,750.00 will be specifically sent to the New York Firefighters “9-11” Relief Fund. “We all knew that anyone could give blood for the Red Cross. We wanted to do more, it’s kind of our obligation.” Davis said. In addition, this tragedy hit home for the organization. During this entire fundraiser, the organization had some other intentions other than the usual, “doing this for the good of man kind.” Sig Tau President Justin Varland, was personally affected by the bombing. He regretfully lost his aunt, Julie Geis, to the September 11th attack. Sigma Tau Gamma will send this money in honor of Julie Geis. “I never intended on doing this for Julie,” said Varland. “I wanted our guys to do it so that we could make a difference from all the way out in South Dakota. The guys brought it up last week and sent a card to my parents. It nearly brought me to tears. It really shows what friendships we’ve created. Hopefully the families in New York are as touched as I was. We just want to help in some minute way.”
Gamma Psi Holds Charity Concert
O
nly days after the horrific attacks of September 11th, the Gamma Psi chapter held a fundraiser to benefit the September 11th fund. On September 15th, the chapter held a benefit concert featuring O.A.R with special guests King Solomon’s Grave. The event was the largest philanthropy in the history of the Greek Community at Illinois State University. Two thousand forty-three tickets were sold for the event and the chapter donated $10,000 to the September 11th fund. In addition to that amount, $1,000 will be donated to Books for Kids. After seeing the events of September 11th unfold, the chapter felt the need to contribute. “We are deeply saddened by the events of September 11th and feel that this contribution, however small in comparison to contributions being made, can help the recovery efforts in New York City,” Philanthropy Chair Chris Smith said.
16
SAGA
WINTER
’02
Chapter Eternal
Chapter Eternal KENNETH L. SHIPLEY, Alpha ’53 (Central Missouri State University) joined Chapter Eternal on Thursday, December 20, 2001. He was 73.
K
Ken was born in Kansas City, Mo., and graduated from CMSU in 1953. He graduated with a B.S. in Education and completed 26 hours of graduate work before being called to serve in the U.S. Navy during the Korean War. While at Central, Brother Shipley joined Alpha Chapter and served as Chapter President. Shortly after graduation Brother Shipley began, what would be, a dedicated lifetime of volunteer service to Sigma Tau Gamma. Ken and his wife, Christine, served as house parents to Alpha Chapter for several years prior to the Korean War. Brother Shipley began advising Gamma Phi Chapter (Southern Indiana University) when it colonized in 1972. He served in this capacity for 25 years. At the Grand Chapter in 1998, Brother Shipley was honored with the “Prof.” Grubbs Distinguished Advisor Award for his service to Gamma Phi. From 1972 to 1983, Ken served Sigma Tau Gamma as a District Governor. In 1980, he was the recipient of the Outstanding District Governor Award in recognition for his leadership and service to Sigma Tau Gamma. After stepping down as District Governor in 1983, Ken was awarded the Honorary title of District Governor Emeritus, becoming the first brother to earn the designation. Ken served aboard the USS Valley Forge during the Korean War and later in the New Orleans, Olathe, Memphis and Chattanooga Naval Intelligence Reserve Units. From 1978 to 1993, Brother Shipley was a Naval Academy Information Officer and a member of the Military Advisory Board for U.S. Rep. John Hostettler, R-Ind. When he retired from the Navy in 1988, he had attained the rank of Captain in Naval Intelligence.
After his release from Active Duty in 1956, Ken began a sales career with Procter & Gamble. In 1962, he moved to Evansville, Ind. and became Director of Food Sales and Government Markets for Bristol-Myers Squibb. He established the first telemarketing group for the Evansville operations to coordinate customer orders, sales information and product management to food markets. Brother Shipley retired from Bristol-Myers Squibb in 1989 with the title Director of Trade Sales and Military Markets. Following his retirement, Ken became co-owner of Midwest Telecom Communications with his son David and served as Vice President. Ken was a dedicated volunteer to numerous other civic organizations. Brother Shipley was a member of the Scottish Rite, Hadi Shrine and the Demolay Legion of Honor. Ken was also a member of the Metropolitan Evansville Chamber of Commerce, serving as ambassador and chairman of several committees from 1989 to 1993. He was honored as Committee Chairman of the Year in 1990. Brother Shipley also served as Interim Director of the United Way of Southern Indiana and was a past president of Rolling Hills Country Club. He served as President of the Evansville Rotary Club from 1998 to 1999 and had been a member since 1988. He was currently serving as Director of Membership Development. Surviving are his wife of 51 years, Christine; a daughter, Rebecca Ziga of Evansville, Ind.; three sons, Richard and David, both of Newburgh, Ind. and Mark of St. Louis; a sister Deanna Kay Arnott of Overland Park, Kans.; and eight grandchildren, Drew, Carrie, Alex, Carson, Colin, and Abigail Shipley and Christopher and Elizabeth Ziga.
GARY M. DAVIS, Alpha Phi ’60 (Southeast Missouri State University) joined Chapter Eternal on October 21, 2001. He was 59.
G
Brother Davis graduated from Southeast Missouri State with a degree in mathematics and history. After graduation, he attended Naval Officer Candidate School in Newport, R.I. and was commissioned as an officer in the Navy. Following his naval career, Gary became a national sales manager and vice president of sales and marketing in the Heat Transfer Industry. In recent years, he began his own consulting company, Gary M. Davis & Associates, providing services such as the hiring of sales representatives for business corporations. Surviving are his wife, Pat; three sons, Scott, Todd and Sean; his mother, Mary; a brother, Richard; and a sister, Donna Cummings. WINTER
’02
SAGA
17
Chapter Eternal JEFF SCHWAN, Gamma Chi ’97 (Michigan Technological University) [pictured left] was a member of the Beta Xi pledge class. We first met Jeff, an Electrical Engineering major, as pledges of the Beta Pi class. He was mysterious but was an easy Sig and our relationship with Jeff as brothers and great friends immediately developed.
J
We lived together at 1115 Ruby, which requires a certain attitude. Late nights after studying, working out, or playing basketball or soccer would end in a small soiree in Jeff’s room. In his third floor hole, Jeff would enlighten us with his eclectic, strong musical choice nobody heard of before, seeming always to play just the right song for the mood. Jeff projected quiet confidence, was opinionated yet subtle, and seemed to know when the little things matter and when life is just too short to worry about the details. He approached every situation with an open and clear mind because he knew that his attitude would only broaden his opportunities and experiences.
JOHN DALE HOUSE, Omega ’79 (Southwest Missouri State University) joined Chapter Eternal on January 6, 2002 after a battle with pancreatic cancer. He was 46.
J
Brother House earned his Bachelor’s degree from SMS in Business Administration and worked in computer technology for St. John’s and Integrated Solutions Group. John is survived by his wife, Lin; a stepdaughter, Kendra Schneider; and a granddaughter, Sierra Wheeler, all of Springfield, Mo.
MICHAEL SCHRODEL, Beta Pi ’93 (Frostburg State University) joined Chapter Eternal in late August after a two-year battle with cancer. He was 31.
M
For the brothers of Beta Pi, Mike was the epitome of a true Sig Tau. He was a brother who lived life to the fullest and always had a positive outlook on life. While in the chapter, Mike was a very active brother and served as V.P. of Finance. Close friend Steve Herndon Beta Pi ’95, recalls the impact Mike had on the chapter. “He did a remarkable job managing the books, and was always very active socially. He was quick to volunteer for anything, and performed every task with a smile. He was also an integral part of the Sig Tau championship intramural football team.” Mike’s wife Teresa, was a former White Rose Queen for Beta Pi Chapter. He is also survived by a 3 year-old daughter; 18
SAGA
WINTER
’02
To Jeff, his body was a temple. A temple to be worshipped, cared for, and used. Jeff had a passion for basketball and, with his huge hands and feet, made up for his shortness of stature. Jeff’s athleticism did not stop there. We showed him the thrill of snowshoeing, camping, hiking, and stupid physical humor. This new passion took him to the summit of the third highest peak in the Americas: Mt. Orizaba at an altitude of 18,500 feet. Our memories of a friend we loved cannot be surmised in an event, a thought, or even a novel. Some of the fondest memories are the little things that we did together that seemed so inconsequential at the time, but live forever in Jeff’s, and our hearts. Everyone who met Jeff each remembers him for his or her own reason. Celebrate Jeff’s life; he did. On September 27, 2001, Jeff Schwan passed away. Jeff loved his family, brothers, and friends. He treated people right. It seems ironic that he would pass from such a horrible disease having conducted his life as a good person. And whether this helps us try to find the answer to why he is now gone or not, he is and we all will miss him immensely. Jared LaFave ’98, Scott Herkes ’98, Bill Peers ’97
Carmen. In an effort to help ease the financial pressure of Mike’s loss, the Frostburg Sig Taus presented Teresa with a check for $8,000. In the near future they also hope to set up a trust fund for Carmen. Brother Eric Udler Beta Pi ’90 gave a eulogy at Mike’s funeral and said “I speak for everyone who knew Michael. He was a remarkable person. His bravery, so stark and real, that even those used to seeing people in dire circumstances were moved by his attitude.”
Toward the end of his struggle with cancer, Mike frequently commented on how happy he was that his illness was the catalyst for reuniting many Sig Tau brothers who lost touch with time and miles. Herndon added, “We are hoping to keep this going each year with a memorial picnic in honor of Mike, so we don’t have to rely on tragedy to pull us back together.” Mike wrote a very moving letter that was read at his funeral. In the letter he shared some advice by which he lived his life. “Live every day like it is your last. Keep a positive outlook and enjoy the little things that make you happy. It is amazing how much you can change someone else’s life in a positive way just by keeping a positive attitude.” Mike, your positive attitude has had a positive effect on many people. You will be missed.
$
Foundation Message
Charitable Contributions
$
ig Taus have always had a responsibility to give help to others. Whether it’s lending a helping hand to a Brother or neighbor, or contributing to a worthy cause, we have a long tradition of “doing good.”
There are many ways to multiply the value of the help we are able to give. At the chapter level, our philanthropy is aided by the fact that we are a cohesive group. At the National level this group commitment continues. Our Books for Kids program is a good example. Each year our chapters and alumni associations team up to contribute many THOUSANDS of books for children. Clearly, no one member or chapter could accomplish this great feat alone. Perhaps an overlooked partner in “doing good” is our own government. Current tax laws are fairly friendly toward helping us to help others. These laws let us leverage our ability to contribute by permitting us to take deductions against income, and sometimes to avoid income altogether, when determining our income taxes. (One caution is that a contribution to a local college chapter is not deductible for income tax purposes. Only contributions to organizations exempt under Section 170 of the Internal Revenue Code are deductible as charitable contributions. These generally include those qualified as Section 501(c)(3) entities. Sigma Tau Gamma Foundation, Inc. is a Section 501(c)(3) entity to which contributions are deductible even if specially designated to ultimately benefit a specific college chapter.) There are identifiable stages in charitable giving:
At the first stage we make a contribution of service. This gift of our time and energy, to our chapter, the national fraternity, or another charitable organization involves little or no cash expense. This phase of giving is most common to collegiate members and new alumni because they generally have more time than money to give. Individuals at lower income levels have lower income tax rates. Therefore, the tax impact of charitable giving is not usually an important factor. Contrary to some beliefs the donation of one’s time is not deductible, but out-of-pocket costs incurred are deductible within certain limitations. The next stage of giving tends to be through unplanned cash donations. Tax savings tend to be of minimal motivation, though comments of “I can write it off” become more common. Generally contributions are deductible only if you are able to itemize deductions on your tax return (some states do allow deductions even if you can’t itemize on your Federal return). The third stage is planned giving and it requires more tax savvy. It’s not a matter of how much to give, but how to give so that it will give both the Brother and the charity the biggest benefit. The tax savvy Brother will consider giving more at one tax rate – to the extent it can be deducted at that rate.
For example, a Brother may consider giving more when he is having “a good year” and he is in the 38.6% tax bracket than he might want to give in a more “normal” year, when he is at the 27% tax rate. For every hundred dollars donated, the charity receives just as much, but the net cost to the Brother is about $11.60 less. Another consideration is to eliminating income altogether while still getting the same tax deduction. This occurs when a Brother contributes appreciated assets to a charity. For example, assume a combined federal and state income tax rate of 45% and a combined capital gains tax rate of 25%. You decide to sell some stock for $2,500, which you purchased for $500, and give the net proceeds to a charity. You will recognize a capital gain of $2,000 ($2,500 - $500) and will have to pay capital gains taxes of $500 ($2,000 x .25). Therefore, you will have net proceeds of $2,000 to give to the charity. The charitable contribution will reduce your other income taxes by $900 ($2,000 x .45). The net tax savings for the contribution was $400. In effect, it cost the Brother $2,100 to make the $2,000 contribution.
Assume instead, that you gave the stock directly to the charity. The contribution of the stock is not considered taxable to you as a sale. The charity is tax exempt and will not be taxed when it eventually sells the stock; therefore, it receives the full $2,500 benefit of your contribution. You will be able to deduct the full $2,500, which will reduce your other income taxes by $1,125 ($2,500 x .45). In this case, it cost the Brother a net $1,375 to make a $2,500 contribution. As you can see, not only did the charity gain $500, but it cost the Brother $725 less to make the contribution. (Note that you should never contribute capital loss assets directly to a charity because your ability to utilize the loss will be lost. Instead, you should sell the asset and contribute the proceeds to the charity. By doing this, you will get the same charitable deduction, but will also be able to write off the loss.) There are even more beneficial ways to make charitable contributions, especially as your tax burden increases (especially if an estate tax applies - which could impose an additional tax at your death of upwards of 50%). Included in these are charitable lead or remainder trusts, which allow a contribution to be made while retaining a great portion of the benefit of the asset contributed. If properly structured and using an insurance trust, it’s even possible to give away assets and have your own family’s assets increase by more than the value of the property donated. Space does not allow me to detail these ideas further, though perhaps I may in the future. Fraternally, Paul S. Motin, Beta Xi ’83, WCMF, J.D., LL.M., C.P.A. Disclaimers: Note that the information in this article is not intended to be, nor should it be considered as legal advice to you. No attorney - client relationship exists. Every taxpayer’s situation is different. Seek your own competent tax advice before using the information set forth.
WINTER
’02
SAGA
19 | https://issuu.com/sigmataugamma/docs/sagawinter02 | CC-MAIN-2017-09 | refinedweb | 12,721 | 76.62 |
Key:source
The source tag is a meta-tag, used for categorising the source of information added to the database. It is not usually used for rendering, but it assists with the verification of data, and informs future editors about the origins of the data they are modifying.
More details about the source can be added using the source_ref tag.
The source tag can be used on all objects, and can also be used on changesets, to specify the source for a group of edits.
It can also be used as a namespace prefix to specify the source of a single attribute. For example, to attribute a source for a name tag, use source:name=photograph, or to indicate the reason for speedlimits (sign, roadmarkings, implicit speedlimits) use source:maxspeed=*.
If the tag already has a namespace prefix (e.g. mf:name=Broadway then use mf.source:name=photograph).
Use of the image tag implies source=photograph. It is not necessary to add a source tag in this case if this is the only source of information for the object. See also Geotagging Source Photos.
If a particular source is later found to infringe copyright (e.g. some source that was believed to be OK is later discovered or ruled to be copyrighted) then it would be possible to easily remove all OSM data originating from that source.
Reliability
The usefulness of the source tag is reduced in areas where data from many sources has been added. After many diverse edits the data may depend on so many sources that it can not be accurately attributed. Also, some editors fail to update the source tag when they edit objects, leaving the source tag reflecting only the original source of the object. Examining the history of the object to see when the tag was added and when it was changed may assist in ensuring the source is correctly understood.
Annotation
Providing further information about tag values for other mappers and in some cases also for users. See Annotations for more details.
This table is a wiki template with a default description in English. Editable here.>
Most common sources and their meaning
This section lists the most commonly used values of the source key and describes its meaning. If there are more versions (by year, capitization etc.) it is included once only. Most of the fields are blank, fill in what you know.
Imports
Many bulk imports have their own unique source tag. Users doing imports are advised to give notice of their intended actions on the Import Mailing List.
- source=AND Data donated in 2007 by AND Automotive Navigation Data, see the AND Data wiki page.
- source=DOP_LVA
- source=DOP_LVA_BY_01 - (pilot scheme from 2008-12-12 to 2009-03-31) extending osm by digital orthophotos provided by the land surveying office of Bavaria, Germany
When tracing from aerial or satellite imagery, the imagery provider is often given as the source, e.g. yahoo, bing, landsat, etc.
- Source=PGS - Almien coastlines (PGS)
- Source=GSHHS - Almien coastlines (GSHHS) (not used much)
- Source=waypoint - Waypoint upload tool [1] | http://wiki.openstreetmap.org/wiki/Proposed_features/Source | crawl-003 | refinedweb | 514 | 63.39 |
I have a service that helps with some routing issues related to my environment and now I need to cope with template routing issues
Ideally I would be able to do something like this:
import { PathSvc } from './globals/path.svc';
@Component({
templateUrl: this.pathSvc.alias + '/app/my.comp.html'
})
export class MyComp {
constructor(private pathSvc: PathSvc) { }
}
requests:38 Error: TypeError: Cannot read property 'pathSvc' of
undefined(…)
<base href="/{alias}" />
if i correctly understood, you want to create a service that can act as an helper out of the angular's DI process.
Like @Günter_Zöchbauer said, an Injectable can't be used outward of an instance of an Ng2 object (Component, Injectable...) but in your case, create an injectable is irrelevant. Create an angular app doesn't mean that all your files must contain angular objects, you can also create basic classes/constants..
For example, if you want an helper that build an url for you, you can create a class and use it in a component declaration simply by importing it.
//urlbuilder.ts const host:string = ''; export class UrlBuilder { static generate(file:string = '') { return host + file; } } // component.ts import {UrlBuilder} from './urlbuilder'; @Component({ templateUrl: UrlBuilder.generate('/foo.html') }) export class FooComponent {}
You can even export a function instead of the class, it will work too. The following code show the same code as above but with a function and an es6 tag.
//urlbuilder.ts const host:string = ''; export const UrlBuilder = urlBuilderFn; //basic tag function that build a template string with potential variables function urlBuilderFn(strs, ...raws) { let builtStr = '', length = strs.length; for(let i = 0; i < length; i++) builtStr = strs[i] + (raws[i] !== undefined && raws[i] !== null ? raws[i] : ''); return host + builtStr; } // component.ts import {UrlBuilder as url} from './urlbuilder'; @Component({ templateUrl: url`/foo.html` }) export class FooComponent {}
However, if wanna use your helper with the DI too (for whatever reasons, need for angular deps..) you can make an injectable class with a static method.
//urlbuilder.ts const host:string = ''; @Injectable() export class UrlBuilder { constructor(private http:Http) {} static generate(file:string = '') { return host + file; } doSomething() { return this.http.get(UrlBuilder.generate('/foo/bar')) } } // component.ts import {UrlBuilder} from './urlbuilder'; @Component({ templateUrl: UrlBuilder.generate('/foo.html') }) export class FooComponent { constructor(private builder:UrlBuilder) {} ngOnInit() { this.builder.doSomething() } }
On the other hand, if your only issues are with the templates why don't you write them directly as template string or just import them with your task manager (webpack..). Generally, if you don't have dynamic view and so, have to generete them from your server, prefer to avoid http calls to retrieve them and load them directly in the javascript files. | https://codedump.io/share/Y5JnoBvZ59rg/1/how-can-i-use-a-service-or-global-function-in-the-component-declaration | CC-MAIN-2017-13 | refinedweb | 441 | 56.45 |
Product Header: Bajaj Allianz Invest Plus Plan Tags: Invest Plus, Bajaj Allianz Invest Plus, Bajaj Insurance, Bajaj, Wholelife, Whole Life, Traditional Date: Meta Description: The Bajaj Allianz Invest Plus Plan is like an extremely costly fixed deposit, with very little insurance cover. You would rather avoid this product Category: Insurance
Analysis: Beyond the fairly complex product brochure, the Invest Plus is more like a fixed deposit with a small life insurance cover built in. Not a bad idea, you might say. But given the charges hidden in this policy, it’s not worthwhile investing in it at all. In a fixed deposit like product, you are looking at safety and modest returns (say 6%-8% every year). A low return product like this is extremely sensitive to charges and costs. The Invest Plus Plan imposes a 5% charge on each premium, thus dragging the effect return down even below savings deposit rates! There is a distinction in the product between ‘Basic’ and ‘Enhanced’ premium. But cutting through the complications, suffice it to know that both are subject to this 5% charge, and both would return only about 6%-8% a year (and only ~3% after charges). So this distinction is a red herring. In an amusing choice of words, there is a ‘Minimum Guaranteed Return’, but the company will only declare this rate at the beginning of every year. Thus, what you have is actually worse than a fixed deposit – lower rates of return (due to the charges) and no idea what your returns will be over the life of the product. Also, this is not a unit linked product and has no equity; so the fantastic illustrations your agent or the brochure may give of 10% and higher return every year are meaningless. The life insurance component is miniscule, not exceeding 20 times your annual premium. If you really want life insurance, a good term plan will give you life insurance of about 500 times your annual premium – so you would rather avoid the Invest Plus.
Product Feature:
Parameter
Value
Fintotal Comment
Entry age
7-60 years
Life Cover
5 / 10 / 15 / 20 times annual
This is far too low to be of much practical
premium
use for your family
Accidental Death Benefit
If you want any of these features, you
Total / Partial Disability Benefit
would rather take a separate insurance
Critical Illness
policy for the same, rather than Invest Plus
Riders available
Waiver of Premium Hospital Cash Benefit Family Income Benefit Minimum Premium
Rs10,000/- per year
Premium Allocation
5% on all basic and enhanced
Charge
premiums
Mortality Charge
As per age
Surrender / Premium
10% - 50% depending on policy
Discontinuance Charges term remaining
This is far too high for a debt-like product
This is extremely high and makes the product inflexible
Illustration: As seen, the return is much lower than even a simple fixed deposit. Worse, the lock-in period is very stringent, and you effectively cannot withdraw without severe penalty except in the last five years of the policy. We therefore advise you stay away from this product.
Let us assume a simple case: •
Your age: 30 years
•
Policy term: 20 years
•
Premium: Rs 20,000 per year
•
Sum assured: Rs.2 lakh
•
We assume the gross return of Invest Plus is 6% (which is a very likely scenario)
•
We assume the return on a fixed deposit is 6% (actually it could be more, but we are being
conservative)
Fintotal Recommends: | https://issuu.com/fintotal/docs/bajaj_allianz_invest_plus_plan.docx | CC-MAIN-2018-05 | refinedweb | 575 | 51.21 |
“import egi.simple as egi” no longer works in version 1.84.0. It indicates that the module cannot be found. Similarly the EGI demo program throws the same error.
Import egi no longer working
OK. I’ve rebuilt the standalone distros in 1.84 and maybe this got missed (unfortunately egi and other hardware manufacturers don’t make it easy for us to automate installing their packages so I have to manually edit the distributions).
Which platform are you talking about?
Windows 10.
Thanks (and thanks for Psychopy!)
OK, that will be included in the next standalone package release (1.84.2; but not soon) but in the meantime you could simply extract the folder
egi from the zip file below and drag it into your
PsychoPy2/lib/site-packages folder
I think that should make it work again
Hi everyone,
I am trying to make a EEG experiment (initially working on psychtoolbox). I use an EGI system and attempt to use the egg psynetstation library then.
However, the
import egi.simple as egi is not working for me.
I get the error :
import egi.simple as egi Traceback (most recent call last): File "<input>", line 1, in <module> File "/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/egi/simple.py", line 347 type(1L): ('long', '=l'), # '=' -- translation is: four bytes ^
When I try to run line per line of the simple.py script I get stuck with :
from socket_wrapper import Socket Traceback (most recent call last): File "<input>", line 1, in <module> ModuleNotFoundError: No module named 'socket_wrapper'
Not sure if I download this package it will solve the problem.
I use Psychopy Standalone v3.0.0b12 on a macOS High Sierra version 10.13.6
Is there something that I did wrong?
thanks for your help!
Hello Marie,
I worked on connecting EGI NetStation to PsychoPy few months earlier. I believe the
socket_wrapper issue arises when you don’t have proper connection setup. I’m not sure what part of the stage you are at, but you need to make sure that:
- First all the cables/hardwares are setup properly (connection among PsychoPy computer, amplifier, NetStation computer)
- NetStation workbench configuration is setup properly so that it has proper IP and port number to read in
- Then, the PsychoPy code and egi module
I made a documentation back then and hope this could be any help.
If you are just beginning to connect PsychoPy to EGI, I think you can start from the beginning of the wiki page. Let me know if you have any questions!
Best,
Jin Jeon
Hey there ,
Thanks for your quick response, and moreover the wiki : I took a look over it and it is great ! I will take a look at your work since I’m also using this experiment for infants and I will be using Tobii pro SDK as well.
The problem about the connection setup is that I can’t change anything since it’s working for other team using the set-up.
Note that my experiment was working perfectly when I was using psychtoolbox.
The only difference of the set up you draw in the wiki is the use of a blackbox connecting two computers (Mac and windows) to the egi computer. All those connection are with Ethernet wires.
Concerning the psychopy, I follow the indications of phschopy itself by installing the Standalone version on my Mac. I didn’t install python 3 before I only have python 2.7 from macOS.
I am actually trying to begin all over again by removing Psychpy3 and install Psychopy2 with the stable version (compare to the beta one) …
So now the script is running without errors BUT nothing is happening on the egi computer (the screen didn’t switch when the ns.Start_Recording() is launch although Psychopy returns “True”).
Do you have any other suggestions?
Hey Marie,
Yes, I also used PsychoPy2 1.90.3. What is the NetStation version of yours? Also, are you saying that your current same setting works on Psychtoolbox but doesn’t work with PsychoPy?
I haven’t used psychtoolbox to connect to EGI Netstation, but I’m assuming the code and configuration could be a little different, which is why it is not currently working. I also had to strip out the ‘black box’ or the ‘sync box’ when I was converting to PsychoPy because that black box was no longer used in the PsychoPy setting. I’m not sure if removing it is necessary though.
As for the connection issue, what was the script that you ran? Did it show any error message?
You can try running
pyns_auto.py Link to Github.
This file is like the most basic file that simply connects and automatically sends event labeled as ‘auto’ for the first 1-2 minutes. You can see the instructions at
If you want to minimize and break the testing to small increments so that you can figure out what stage is causing the issue: you can run
pyns_auto.py even without PsychoPy interface if you have PsychoPy installed to your system. You can simply type
python -i pyns_auto.py in the terminal.
If this file is not able to send signal, I’m assuming it is likely that either hardware cables or Netstation is not setup properly.
Let me know how it goes, or if you have any questions on the stuff that I just wrote.
Best,
Jin
Also, it might be a good idea to start a new post instead, and if you do so, you can tag me there
It works !! I assume it was a problem of Psychopy version ( beta 3 vs 2 v1.90.3). Thanks for your help!
My guess is that EGI (pynetstation) isn’t working on Python3 and, so far, I haven’t managed to get the PsychoPy3 release to compile properly on Python2.7
Pynetstation (egi) with python 3
@jon Could you help me then i just have a huge headache to deal with versions…
I need to run an experiment using tobii-research (python 2.7 or 3.5) simultaneously with egi (seems python 2.7 as you suggested), and with dynamic variable for sounds and image as well as the best time currency (Psychopy3 python 3.6).
I’ve tried to install python 3.5 through anaconda following the recipe on Psychopy installation webpage. When I try to launch psychopyApp.py (after cd to the psychopy/app/ folder) but I get this error : RuntimeError: shellCall() requires Python 2.7, or 3.6 and newer.
How can I make all those work together? I am adding the condition of wanting to use the psychopy builder.
Thanks for any answer I am truly desperate right now… | https://discourse.psychopy.org/t/import-egi-no-longer-working/1044 | CC-MAIN-2019-13 | refinedweb | 1,121 | 73.58 |
Welcome to part 5 of the Raspberry Pi tutorial series, in this tutorial and the next few, we'll be introducing some of the sensors that are available. Probably the most popular sensor is the Raspberry Pi Camera module.
To connect the camera module, find the camera ribben cable port, behind the ethernet port. To "open" it, use your fingers on the two tabs on the edge and pull gently up, it should come up very easily. When up, you can slide in the ribben cable, then press back down on the same tabs to lock the cable in place:
Next, before we can use the camera module, we need to enable it. To do this, do
$ sudo raspi-config
From here, choose the interfacing options:
Then the camera:
Yes to enable, and then go ahead and reboot:
Now, since we'd like to see the camera, we're going to require a desktop. You can either remote desktop into your Raspberry Pi for this, or you can connect physically to it. Once you're in, right click on the desktop, choose "create new"
I am going to call my file
cameraexample.py.
Let's open the terminal next (
control+alt+t) and do a
$ sudo apt-get install python3-picamera. You will likely find that you already have it, but we want to be sure.
Now, in our
cameraexample.py file:
import picamera import time camera = picamera.PiCamera() camera.capture('example.jpg') camera.vflip = True camera.capture('example2.jpg') camera.start_recording('examplevid.h264') time.sleep(5) camera.stop_recording()
So we've done a few things above. We define the
camera object as
camera, and then we can use a bunch of methods. First, we use
.capture() to snap a quick photo. If we look at this photo, we can see it is upside down, since the camera is upside down. No problem, we can flip the camera vertically with the
.vflip, you can also use
.hflip to flip the camera horizontally.
Next, we can record with
.start_recording, stop with
.stop_recording(), and we can use
time.sleep() to determine for how long.
To see your video, open terminal, make sure you're on the desktop (
$ cd Desktop), and then do:
$ omxplayer examplevid.h264. This will play it, but only on your actual display. If you're connected via remote desktop, you might not see the video, at least I didn't, and instead it showed up on the actual connected screen.
In the next tutorial, we're going to get into the GPIO pins for the Raspberry Pi, and a new sensor. | https://pythonprogramming.net/camera-module-raspberry-pi-tutorials/ | CC-MAIN-2019-26 | refinedweb | 432 | 65.93 |
Hey there people,
I'm trying to create a very basic pong game that can be played over the internet or over a network, now I have the game which can be ran on one computer and two players can play it, so I can split it up into a server and a client, the server will ofcourse hold all of the information, bat position, ball position, score blah blah blah, and the client will just receive the data and use it to display the ball bats and what not.
But I have looked around at many tutorials about java networking (most of them are out of date), and I still can't really get my head around it. Many tutorials say to use InputStream and OutputStream, I know an InputStream can read in files and what not, but not sure about OutputStream, now I have seen the socket class in action from tutorials, but I really can't understand that ... well ok so for example
We have a server like so
import java.net.*; import java.io.*; public class ChatServer { private Socket socket = null; private ServerSocket server = null; private DataInputStream streamIn = null; public ChatServer(int port) { try { System.out.println("Binding to port " + port + ", please wait ..."); server = new ServerSocket(port); System.out.println("Server started: " + server); System.out.println("Waiting for a client ..."); socket = server.accept(); System.out.println("Client accepted: " + socket); open(); boolean done = false; while (!done) { try { String line = streamIn.readUTF(); System.out.println(line); done = line.equals(".bye"); } catch(IOException ioe) { done = true; } } close(); } catch(IOException ioe) { System.out.println(ioe); } } public void open() throws IOException { streamIn = new DataInputStream(new BufferedInputStream(socket.getInputStream())); } public void close() throws IOException { if (socket != null) socket.close(); if (streamIn != null) streamIn.close(); } public static void main(String args[]) { ChatServer server = null; if (args.length != 1) System.out.println("Usage: java ChatServer port"); else server = new ChatServer(Integer.parseInt(args[0])); } }
And here is the client
import java.net.*; import java.io.*; public class ChatClient { private Socket socket = null; private DataInputStream console = null; private DataOutputStream streamOut = null; public ChatClient(String serverName, int serverPort) { System.out.println("Establishing connection. Please wait ..."); try { socket = new Socket(serverName, serverPort); System.out.println("Connected: " + socket); start(); } catch(UnknownHostException uhe) { System.out.println("Host unknown: " + uhe.getMessage()); } catch(IOException ioe) { System.out.println("Unexpected exception: " + ioe.getMessage()); } String line = ""; while (!line.equals(".bye")) { try { line = console.readLine(); streamOut.writeUTF(line); streamOut.flush(); } catch(IOException ioe) { System.out.println("Sending error: " + ioe.getMessage()); } } } public void start() throws IOException { console = new DataInputStream(System.in); streamOut = new DataOutputStream(socket.getOutputStream()); } public void stop() { try { if (console != null) console.close(); if (streamOut != null) streamOut.close(); if (socket != null) socket.close(); } catch(IOException ioe) { System.out.println("Error closing ..."); } } public static void main(String args[]) { ChatClient client = null; if (args.length != 2) System.out.println("Usage: java ChatClient host port"); else client = new ChatClient(args[0], Integer.parseInt(args[1])); } }
now when the server is up it waits for a connection, using this line
socket = server.accept();
first off, is the program stuck in a loop when it does that?
I understand most of this, but not the networking parts, I understand they throw around the OutputStream and InputStream but I'm still not 100% comfortable on my understanding of it
If anyone could be so kind to explain this to me in basic terms I would be most grateful.
Canvas | http://www.gamedev.net/topic/638301-java-networking-help-to-understand-sockets/?forceDownload=1&_k=880ea6a14ea49e853634fbdc5015a024 | CC-MAIN-2015-06 | refinedweb | 570 | 51.04 |
Device and Network Interfaces
- line discipline for unique stream connections
#include </sys/steam.h>
int ioctl(fd,I_PUSH,"connld");
connld is a STREAMS-based module that provides unique connections between server and client processes. It can only be pushed (see streamio(7I)) onto one end of a STREAMS-based pipe that may subsequently be attached to a name in the file system name space with fattach(3C). After the pipe end is attached, a new pipe is created internally when an originating process attempts to open(2) or creat(2) the file system name. A file descriptor for one end of the new pipe is packaged into a message identical to that for the ioctl I_SENDFD (see streamio(7I)) and is transmitted along the stream to the server process on the other end. The originating process is blocked until the server responds.
The server responds to the I_SENDFD request by accepting the file descriptor through the I_RECVFD ioctl message. When this happens, the file descriptor associated with the other end of the new pipe is transmitted to the originating process as the file descriptor returned from open(2) or creat(2).
If the server does not respond to the I_SENDFD request, the stream that the connld module is pushed on becomes uni-directional because the server will not be able to retrieve any data off the stream until the I_RECVFD request is issued. If the server process exits before issuing the I_RECVFD request, the open(2) or the creat(2) invocation will fail and return -1 to the originating process.
When the connld module is pushed onto a pipe, it ignores messages going back and forth through the pipe.
On success, an open of connld returns 0. On failure, errno is set to the following values:
A stream onto which connld is being pushed is not a pipe or the pipe does not have a write queue pointer pointing to a stream head read queue.
The other end of the pipe onto which connld is being pushed is linked under a multiplexor.
connld is being pushed onto a pipe end whose other end is no longer there.
An internal pipe could not be created.
An M_HANGUP message is at the stream head of the pipe onto which connld is being pushed.
Internal data structures could not be allocated.
A file table entry could not be allocated.
creat(2), open(2), fattach(3C), streamio(7I)
STREAMS Programming Guide | http://docs.oracle.com/cd/E23824_01/html/821-1475/connld-7m.html | CC-MAIN-2014-23 | refinedweb | 407 | 68.81 |
Flickr app using Model-View-Controller in Qt and Windows Phone
This article demonstrates how to create Model-View-Controller architecture in Qt and Windows Phone. The context in which it is described is a Flikr app.
Windows Phone 8
Windows Phone 7.5
Symbian
Introduction
Model-View-Controller is a well known software design pattern. This pattern is used in both Qt and Windows Phone - in Qt we use Model-View-Delegate and in Windows Phone 7 we have Model-View-ViewModel pattern. One way of considering the parts of the pattern is:
- Model : Store the data
- View : Display the data
- Controller : Communicate between Model and View to process the data.
In this code example we implement a Flikr application for both platforms. While creating the application we will follow the MVC model and will compare the similarity and difference between the platforms in the handling the data. This project is designed to help beginners understand how the MVC pattern is used in Qt and WP7.
Implementation
We create empty projects for both Qt and WP7. We first add code in Qt project and will put the similar code in WP7.
Model
The Model is collection of class that can store data, separate data. Occasionally it can also communicate with any user interface. Here we will get the Flickr data and store it for further use. We are storing four information Title,Image URL, Author and Date about each Flickr item.
Qt Project (Model.qml)
Lets add a QML file in the Qt project, Right Click project explorer->Add New-> QML (from left panel)-> QML File ( from right panel) , name the file name as Model.qml and add the below code. This is our Model class in Qt project. This class will store each model item attributes.
XmlListModel {
id: feedModel
source: "" // flickr
query: "/rss/channel/item" // flickr
namespaceDeclarations: "declare namespace media=\"\";"
// Flickr
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" }
XmlRole { name: "photoAuthor"; query: "author/string()" }
XmlRole { name: "photoDate"; query: "pubDate/string()" }
}
WP7 Project (Model.cs)
Lets add a CS file in WP7 project, Right Click project explorer->Add -> New Item-> Select Class (from middle panel), name the file name as Model.cs and add the below code. This is our Model class in WP7 project. This class will hold the parsed data.
public class Model
{
public string UserName { get; set; }
public string ImageSource { get; set; }
public DateTime PubDate { get; set; }
public string Author { get; set; }
}
View
The view is represented by a screen where we display the data. In our case we will display the Flickr thumbnail, title, author and the date in list view.
Qt Project (View.qml)
Lets add a QML file in the Qt project, Right Click project explorer->Add New-> QML (from left panel)-> QML File ( from right panel) , name the file name as View.qml and add the below code. This is our View class in Qt project. This class will display the Flickr data into the screen.
Component {
Item {
id: wrapper; width: wrapper.ListView.view.width; height: 86
Item {
id: moveMe
Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 }
Rectangle {
x: 6; y: 4; width: 49; height:49; color: "white"; smooth: true
Image { source: imagePath; x: 0; y: 0
height:49
width:49 }
}
Column {
x: 100; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2
Text { text: title; color: "white"; width: parent.width; font.pixelSize: 14; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
Text { text: photoDate; width: parent.width; font.pixelSize: 14; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
Text { text: photoAuthor; width: parent.width; font.pixelSize: 14; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
}
}
}
}
WP7 Project (MainPage.xaml)
In WP7 project XAML file represents the View of the application. So we will consider the default MainPage.xaml file to be the our View in this case. To display the Flick data onto the screen lets add the below code inside <Grid…> element in MainPage.xaml file
<!--ContentPanel - place additional content here-->
<Grid x:
<ListBox Height="650" HorizontalAlignment="Left" Name="listBox1" VerticalAlignment="Top" Width="456" >
Author}" TextWrapping="Wrap" FontSize="24" />
<TextBlock Text="{Binding PubDate}" TextWrapping="Wrap" FontSize="24" />
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
Controller
The Controller communicates with the front end of the Model and sends the data to View for loading.
Qt Project (Controller.qml)
Tipically Controller.qml is the main.qml in Qt project. I have just renamed the file and add some code in it. In Qt project first we have created one rectangle of specific height and width after that we have added the Model and ListView in it. This class first loads the data into Model and then display it in List View. This is the class which decides which Model to load and how the data should be displayed.
Rectangle {
id: mainwindow
width: 360//parent.width
height:640// parent.height
color: "green"
Text {
id: idText
text: qsTr("Flickr")
color: "black"
font.pixelSize: 31
font.bold: true;
style: Text.Normal;
styleColor: "white"
x:140
}
Model {id: feedModel}
ListView {
id: list
anchors.left : parent.left
anchors.right: parent.right
anchors.top : idText.bottom
width: mainwindow.width ; height: mainwindow.height
model: feedModel
delegate: View {}
}
}
WP7 Project (MainPage.xaml.cs)
For WP7 MainPage.xaml.cs is the controller class. Where it loads the data into Model class and then display the data in List View.
// Constructor
public MainPage()
{
InitializeComponent();
WebClient webclient = new WebClient();
webclient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webclient_DownloadStringCompleted);
webclient.DownloadStringAsync(new Uri("")); // Flickr search
}
void webclient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error != null) {
MessageBox.Show("error");
}
// parsing Flickr
XElement Xml = XElement.Parse(e.Result);
XNamespace ns = ""; // flilckr
listBox1.ItemsSource = from flickr in Xml.Descendants("item")
select new Model
{
ImageSource = flickr.Element(ns + "thumbnail").Attribute("url").Value,
UserName = flickr.Element("title").Value,
Author = flickr.Element("author").Value,
PubDate = DateTime.Parse(flickr.Element("pubDate").Value)
};
}
Source Code
- The full source code of Qt example is available here: File:MVCQt.zip
- The full source code of WP7 example is available here: File:MVCWP7.zip
Tomi - Great topic but not sure about the semantics
Hi,
Great topic and great article! However, I'm not so sure about the semantics of the Qt version. In my opinion the view composes of both the ListView and its delegates and the controller is hidden (i.e. comes with property binding and not actually implemented by the developer). Thus, I feel that the Controller.qml does not define the controller at all but I guess this is a matter of opinion and open for debate.
It would also help if you would be kind enough to restructure the code snippets a bit (indentations according to proper code style/convention etc.).
But again, thanks for the great article!
Br,Tomi
Tomi_ 15:44, 3 November 2011 (EET)
Hamishwillee - I agree with Tomi
I've subedited this a bit and improved the English.Please indent the code snippets and also please reconsider what Tomi has said about Qt semantics..
hamishwillee 07:39, 26 April 2012 (EEST)
Somnathbanik - Compatibility
This article is Compatible for both Windows Phone 7 and Windows Phone 8.We will update the title accordingly.
somnathbanik 13:04, 5 June 2013 (EEST) | http://developer.nokia.com/community/wiki/Flickr_app_using_Model-View-Controller_in_Qt_and_WP7 | CC-MAIN-2014-10 | refinedweb | 1,213 | 60.31 |
Support induction recursion
Now that we have
-XTypeInType, let's take it a step further and allow induction recursion. This feature exists in Agda and Idris. Here is a short example of what can be done in Agda:
mutual -- Codes for types. data U : Set where nat : U pi : (a : U) → (El a → U) → U -- A function that interprets codes as actual types. El : U → Set El nat = ℕ El (pi a b) = (x : El a) → El (b x)
Note that the
U datatype and the
El function depend on each other. But if you look more closely, the header for
U does not depend on
El; only the constructors of
U depend on
El. So if we typecheck
U : Set first, then
El : U → Set, then the constructors of
U, then the equations of
El, we're OK.
Translation into Haskell:
import Data.Kind data family Sing (a :: k) -- we still require singletons data U :: Type where Nat :: U Pi :: Sing (a :: U) -> (El a -> U) -> U type family El (u :: U) :: Type where El 'Nat = Int El (Pi a b) = forall (x :: El a). Sing x -> El (b x)
This currently errors with
• Type constructor ‘U’ cannot be used here (it is defined and used in the same recursive group) • In the kind ‘U’
It needn't error. (I'm cheating a bit here, because for unrelated reasons, we can't return a
forall on the right-hand side of a type family. But that's not the issue at hand.)
I have some very sketchy notes on how we might do this here. | https://gitlab.haskell.org/ghc/ghc/-/issues/11962 | CC-MAIN-2020-34 | refinedweb | 266 | 76.76 |
Hi,
I'm starting to learn C#, and so far am happy to say have been quite successful in coming to terms with the langauge use etc, but I need help!
I am trying to define form objects in a class:
but this code produces compiler errors (I am using Borland C# Builder).but this code produces compiler errors (I am using Borland C# Builder).PHP Code:
public class atitle {
int x; int y; int w; int h;
string paneluse;
private System.ComponentModel.Container components = null;
private System.Windows.Forms.Panel activepanel;
activepanel = new System.Windows.Forms.Panel();
activepanel.Location = new System.Drawing.Point (x, y);
activepanel.Name = "panel_"+paneluse;
activepanel.Size = new System.Drawing.Size(w, h);
activepanel.TabIndex = 0;
public void activepanel_click (object sender, System.EventArgs e){
//do stuff
}
}
I would really appreciate it if someone could show me the correct code to use
Thanks in advance,
-hammerhead | http://forums.devshed.com/net-development-87/defining-form-objects-classes-100740.html | CC-MAIN-2016-36 | refinedweb | 150 | 53.07 |
I need to write a function where, for any list, each element in the list is added together and to see if it equals a constant.
For example:
L = [1, 2, 3, 4]
1+2=3
1+3=4
1+4=5
2+3=5
2+4=6
3+4=7
C = 3
def prize(L):
possible = []
C = 4
prevprev = L.pop(0)
prev = L.pop(0)
print("initial", prevprev, prev)
for n in L:
i = prev + prevprev
prevprev = prev
prev = L.pop(0)
if i == C:
possible.append(i)
return possible
print("possible ", possible)
I couldn't quite follow your code or explanation quite well, but I believe this does what you want. This is done without the
itertools module. Using it would produce a more compact code. This is done as an alternative to
itertools
lst = [1, 2, 3, 4] def prize(L): pair_list = [] C = 4 # Creates a list of tuples (1, 2), (1, 3), etc for x in L: for y in L: # if x != y | To prevent 1 + 1 and 2 + 2 (following example) # (y, x) not in pair_list | Prevent inverted pairs if x != y and x + y == C and (y, x) not in pair_list: pair_list.append((x, y)) # Return list tuples that add to constant return pair_list print('Possible', prize(lst))
if you wish to use itertools then you would use
from itertools import combinations def prize(L): C = 4 return [(x, y) for x, y in combinations(L, 2) if x + y == C] lst = [1, 2, 3, 4] print('Possible', prize(lst)) | https://codedump.io/share/CJqsugetXd2x/1/how-to-find-the-sum-of-each-element-in-a-list-with-each-other-element | CC-MAIN-2016-50 | refinedweb | 258 | 77.77 |
Wed, 05/08/2002 - 05:26
Hi,
I'm not sure if some people of OpenCASCADE SA are reading this forum ;-), and if this question belong to this forum, but anyway :
Does somebody know if the OpenCASCADE SA is making a schedule plan for OpenCASCADE ?
According to the entries in the CVS tree, most of the input are debug of the existing version.
Can we expect something new in the future versions of OpenCASCADE ?
When will the next official version be available ?
What are the plan for OpenCASCADE in the near/far future ?
Thanks if somebody can answer those questions or give some expainations.
And by the way, if other users are also interessed by my questions, I encourage them replying to this message in the forum, just saying "I care" (or something like that).
Waiting for an answer,
Stephane
Wed, 05/08/2002 - 11:25
I care
Best regards,
Patrik Müller
Wed, 05/08/2002 - 11:38
I care
"When you make eyes in place of an eye, a hand in place of a hand, a foot in place of a foot, an image in place of an image, then you will enter." - logion
Shen Zhong
robertshen@21cn.com or robert_shen@hotmail.com
Wed, 05/08/2002 - 14:11
I think At least it is much better to correct the old bug and improve the performance of OCC than introduce immatural new feature and new bug for developer of OpenCascade.com, especially in AIS2D, boolean operation and Documentation about OCAF, except for improving the data exchange ability of OCC.
Wed, 05/08/2002 - 18:24
I didn't say that it is not important to solve the bugs and improve what exists, I just want to know if something else is planned.
Stephane
Wed, 05/08/2002 - 19:05
I care...
Genevieve
Tue, 05/14/2002 - 12:17
Dear OPEN CASCADE users,
For the past few months, I am in charge of the Open CASCADE product & components and Stephane's message gives me the opportunity to write to you about the evolution and future of the OPEN CASCADE libraries.
And what is this future?
- OPEN CASCADE Professional
At the beginning of autumn 2002, you will have access to a new release : OPEN CASCADE Professional, based on our customers and users' requests and comments. This version will provide you added values to improve and facilitate your OPEN CASCADE based developments.
To give you some examples of what advantages OPEN CASCADE Professional will technically give you:
* More robust libraries.
* More detailed documentation.
* XML output for Open CASCADE Application Framework (OCAF) attributes.
* Class Browser to easily navigate into the OPEN CASCADE structure.
* New development tools.
* New viewing tools.
Included in the Professional version, you will also have access to free e-Learning and access to our support hot-line during a limited time.
OPEN CASCADE Professional can be purchased from
In parallel, the downloadable version on will continue to be enriched on the base of the OPEN CASCADE certified versions.
- OPEN CASCADE Components
The OPEN CASCADE components, the non open-source classes, are going to be highly enriched.
Today, you have the possibility to access high-level data exchange components : DXF Import - Export, ACIS SAT Import - Export, PARASOLID-XT Import, Catia V4 / Open CASCADE and Euclid 3 / Open CASCADE.
From very soon and during the months to come, new high-level components, and not only related with Data Exchange, will be proposed.
Check our newsletters and our web site update to check for the good news to come.
- On Going Internal Projects
To give you some examples of our on going R&D important projects:
* Improvement of the OPEN CASCADE Boolean Operations. Our Research & Development team is doing a tremendous work to develop new algorithms. You will be surprised by the quality of the results.
* The OPEN CASCADE for Mesh project has been launched to develop all necessary tools to generate, visualize and edit a mesh from the OPEN CASCADE shapes.
And do not forget to have a look at the latest updates on the contributor's portal of, such as:
* the IGES and BREP viewer using VTK kernel.
* New version of Stephane's project : exoTK - Extension for OpenCASCADE (ToolKit).
With Best Regards,
Arnaud Magnier
Tue, 05/14/2002 - 14:30
Hi,
sounds interesting - but most of your publications are for the professional release.
So, what are publication plans for the downloadable version? Any new components?
Can you give further details for the mesh component (public/professional)?
Best regards,
Patrik Müller
Wed, 05/15/2002 - 01:40
Hi Arnaud,
First, thank you for your answer.
But I'm quite disapointed to see that you are releasing a "professional version".
As I've already seen this "business model" with other libraries, I'm afraid that the free OpenCASCADE version will be frozen, and that the main improvments will only be available if you are paying.
BTW, you wrote 2 points in the pro version which really belong to the free one :
> * More robust libraries.
> * More detailed documentation.
Do you really think that some users will use your library if it is not "robust" ?
And the documentation should not only be available in the pro version. Today, the doc is very poor. I have the chance to know very well OpenCASCADE, so I don't really need some documentation.
But I'm quite sure that it is very hard for the "new" users to make something with the released documentation.
And what do you mean with :
* Class Browser : it is almost the same as what was released on Unix with the previous versions of OCC ?
* Devt tools : WOK or something else ?
* Viewing tools : ? . If you mean improvment of the display and AIS packages, I think it should also belong to the OpenSource part. Once again, what will be the OpenSource part if the gap between both version makes a good product and a bad one ?
I hope you will consider those points.
I'm waiting for your answer,
Stephane
Wed, 05/15/2002 - 15:35
I totaly agree with you Stephane.
Francois.
François Lauzon, Ing. Stag.
Software Development Coordinator
DBM Reflex Inc.
1620 boul. Dagenais ouest
Laval, Québec
Wed, 05/15/2002 - 19:54
Me too.
Wed, 05/15/2002 - 22:14
It would seem to me that the company is trying to squeeze a litle extra money from programmers. There isn't really anything inherently wrong w/ trying to get money... So long as in return they allow the purchaser right to charge money for the products they make. Ideally I think things should work like this:
Everyone can get the same source code but:
For those that didn't pay: You can't charge for anything you do, you have to release anything you add onto the code or do w/ the code in source format (if you distribute it at all).
For those that did pay: They get a snapshot of the source and are allowed to modify it w/o giving anything back. They also get personalized tech support from the company, and the right to sell their product.
This would sort of be the best of both worlds. Companies that want the source for profit could buy it and use it for profit. People that just want to dink around or improve it in their spare time owe nothing to OpenCascade SA.
I know the catch in all this is that people that contribute to the project yet dont work for OpenCascade SA would end up w/ their code in commercial projects and not get compensated. However, OpenCascade has already held a contest w/ prizes. They could continue to do that to encourage additions (and of course all entries to the contest would be subject to addition to OpenCascade).
I know I've probably perturbed the open source zealots out there but one must realize that code communism (aka all code being open source and free) is a BAD idea just like political communism has proven to be.
Wed, 05/15/2002 - 23:38
1) Not every one likes the idea of contest. For example i tried explaining that i could not take more vacations and wanted cash compensation instead of a payed vacation. Whish was kindly rejected. Hence i did not participate
2) For me the best support comes from the real users. The bigger the user base the better support you get. Which is a catch 22 since you cannot get more user base with high entry learning curve.
Thu, 05/16/2002 - 00:20
1. Yes, I see your point about the contests... Not everyone would want the prize and thus the problem isn't really solved 100%. I'm not sure how it could ever be solved... The company could offer cash prizes instead of vacations... That would have some positive effect perhaps... Plenty of contests are for cash... The only catch w/ this is that a lot of users of OC seem to be French (just like the company) while I'm from the USA so i guess conversion rate issues would apply for some people. ;-)
2. Yes it is very helpful to talk to actual users of the product to aid in learning. Many companies, even commercial companies, have discussion boards for just that purpose. There is indeed a catch-22 as the learning curve will be steep until a sufficient user base is created. However, the few in the know can, maybe, create better documentation to get newbies started. I know writing documentation is nowhere near as desirable of a job as coding but someone needs to do it or else no one outside of the coders will know how to use anything.
All in all, I know that my idea needs a lot of work before it could pan out. Maybe it never will, but nonetheless, I do believe that something of the sort could be feasible.
Thu, 05/16/2002 - 01:20
You cannot ask the users to do the job which have to be done by the companie itself ! It's crazy !
As a user, I am not ready to write tons of articles, howtos, explainations, etc... I can do it, but I will not : It is not my job.
If a product is bad, it is not the user task to improve it. The users are using the product, they are not doing it. Of course, if I need something specific that doesn't exists or doesn't fit my needs, I will do it, and *perhaps* release it to the community ( if it is not sensitive informations or algorithms ).
It is the same with the bugs.
When I register a bug on the opencascade.org, I'm not waiting for a user to solve it.
For example, you can see the bugs I entered about problems in the OSD_Path class. These problems are really very easy to fix. I am able to do that, but I will not. I found a workaround and use it. The OpenCASCADE developpement team has to fix it in the next version. If i registered those bugs, is to improve the stability of the product. For me, working on problems like that bring me nothing, except perhaps a "thank you" from somebody ( but I don't think so ).
The OpenCASCADE cie is "paid" by some customers with support contract to develop a good product and to improve its robustness.
And about the contests, I think it is not a way to improve a product.
When I'm writing some code, algorithms, etc.. I own the copyrights of the code, of the idea. You cannot buy a copyright with a prize of a contest.
I participated to the developer chalenge and won a second prize. If the OpenCASCADE SA is integrating part of MY code done for this contest in a next release ( professionnal or not ) without asking me, they are stealing my work.
About the idea making the whole OpenCASCADE free, I think also it is not possible. I understand that some modules can be a sort of extension, and you have to pay for them. I'm thinking on the new DataExchange formats.
About the DX, there are 2 possibilities :
1/ OpenCASCADE SA developed them from scratch, and it is really a huge work, so I understand they sell them.
2/ OpenCASCADE SA are using some third party libraries which are not free, and perhaps with royalties. So they have to sell them.
The question is to see what's belong to an optional extension, which can be separatly sold, and what's belong to the kernel, which have to be free.
As I explaing in my answer to Arnaud Magnier, new parts like "More robust libraries" "More detailed documentation" "New development tools" "New viewing tools" belong to the kernel, so they have to be free, first because of the OpenSource *way of thinking*, and second because those points are not only extensions, but are a part of the OpenCASCADE core.
On another side, components like XML output for OCAF, advanced dataexchange, are extensions and they can be sold.
Stephane
Thu, 05/16/2002 - 15:52
I understand where you are coming from and in my opinion you are wrong (mostly) but that's the magic of debate... In fact I could be mistaken about things but here is my clarified take:
You call youself a user, yes, but you are a user who is a programmer. Think of an open source project such as Linux. Do the users of linux refuse to improve it? I should hope not! Linux has many paid programmers at various companies but yet it's userbase also improves it and writes documentation and code. Now, I've been in the OpenCascade scene for a very short time so I might be missing the mark here but... why wouldn't the user base want to improve it!!?!? Honestly? I realize that the company should be putting all of the things that you said into the freely available version. But, if they don't then someone else can do it anyway.
I'm not sure how the code checkins work. I saw that OpenCascade seems to have CVS but I do not know if outside programmers are allowed to check the tree out and make changes... If not then I guess I've got my answer about whether users can help improve OpenCascade. However, I'm pretty sure after reading through the license that people are allowed to modify the source code to OpenCascade if they want... theres just limiations on using it in closed source projects and what you can do w/ the code you've recieved and written. That is reasonable and it's basically how linux works.
BTW, I'm quite taken aback by your attitude... You mention several times things you could do to improve OpenCascade but yet every time you say you will not because it is 'not your job.' You are getting a LARGE amount of source code for FREE and when I suggest that maybe people would want to give back something to the nice company that is offering their code for free you said 'ain't my job!' You really aren't striking me as a person that holds the idea of open source with any esteem whatsoever. I'm sorry to seem so blunt but I'm absolutely awestruck to hear such a high standing member of the user community basically disregard the whole idea of open source (aka, to openly develop a product, to facilitate the elimination of bugs by peer review, to speed development, etc) Is it that you don't think it'd be worth your time to contribute to OpenCascade?
Am I the only one here that believes that OpenCascade deserves the attention and work of volunteers from the community? We've effectively been given a gift in the form of an open source set of libraries and I believe it would be good to give something back in return (and hopefully in the process improve the product.)
Thu, 05/16/2002 - 19:26
Hi Collin,
Basically I agree with what you wrote in your message.
I don't refuse to improve OpenCASCADE. I will do it if I create something which can be used. Ok, it is not released as code to be directly used with OpenCASCADE, but if you have a look into my code ( ), you will see that I introduced new things like import / export 3DStudio files or using a stripifier to improve the performances of the 3d display with shaded shapes.
This code is OpenSource.
What I mean with my previous post, and perhaps was not clear, is that the people of OpenCASCADE have to deliver a minimum of documentation.
I understand that you can have some samples which are helping a lot if you want to do something included in the samples.
For example, if you are using the Geometrical or Topological sample, you can have the code how to build the entities.
But those examples are only limited to the high-level components.
The Reference Manual ( html help with the documentation of all the classes and the methods ) is very poor.
If you want to work deeper, you have to read the cdl files, and a lot of them are not documented. Often, you have to go through the code itself which is also poorly documented.
This work has to be done by OpenCASCADE SA.
If I give something back, it will be new classes, perhaps tutorials, but not the documentation for the existing classes.
About contributing to OpenCASCADE via CVS, as you can read in OpenCASCADE.org under the CVS section : "Anyone can download or check-out the sources. However, only people with write permission - project leaders and their delegates - can check-in.".
So it is not possible to integrate the debug or new things directly into the OpenCASCADE source base. I think the OpenCASCADE people should think on a solution to be able to do that. It was the reason why I didn't fix the bugs I've found in OSD_Path.
But the problem is not in the contribution, but in the way OpenCASCADE SA is planning the future of the product with the professional vs free version.
Do you think that OpenCASCADE will get a big community of OpenSource programmers, if the free version is not stable, not robust or simply poor, and you have to buy the professional one to have a good working library ? I don't think so.
Keep in mind that improving or debugging some very complex algorithms in OpenCASCADE need a huge knowledge in geometrical or topological "science", and a huge amount of work.
Stephane
Thu, 05/16/2002 - 20:21
Thanks for your reply. Yes, that does clear things up.
Documentation is really best written by the people that wrote the code. Ideally the documentation is written FIRST and used as a specification to create the code. This ensures consistancy and allows the programmer to potentially map out all of the function definitions and interactions before a single line of code is written. It seems that nothing of the sort happened here.
It would be very beneficial for all involved if the CVS tree would be opened up for writes a bit more. Maybe the whole world shouldn't be allowed in but more people should. Has anyone looked into Bonzai and Tinderbox? They are two CVS tree utilities written (or maybe just used... dont really know who wrote them) by the Mozilla project. They keep the tree in working order (or at least try to detect if someone broke the build).
OpenCascade will definately not go far in this world if the free (certified) version laps behind the pro version greatly, has poor documentation, and crappy libraries. A few posts back what I was trying to get at was: The pro and free versions should be identical. The only difference in my opinion should be: The pro version gets you tech support from the company, the pro version allows you to sell your program, and the pro version allows you to modify OpenCascade and use it and not release your modifications. There's plenty of problems to work out w/ that but then at least the two versions would be functionally identical.
Thu, 05/16/2002 - 20:43
Hi Collin,
Just to say that I agree with your statement concerning the pro vs the free version.
Something like that will keep the product OpenSource, and the community will get the benefit of a stable product, and the product itself will get the input or improvement from the OpenSource community.
Stephane | https://dev.opencascade.org/content/opencascade-publication-plan-future | CC-MAIN-2021-17 | refinedweb | 3,443 | 70.73 |
Calling Application Basic Functions
Calling Application Basic Functions
Hi,!
I see the "MOVE" prefix on this post. Is that a good thing or a bad thing?
Would it be possible to find out where things are moved to?
(I figured out that it was moved to Help & Discussions instead of bugs where I posted it. But still wondering if the move tag could have told me that in the first place). Just some feedback for a future version.
Move just denoted that it was a discussion topic, not a bug.
Touch and Ext have slightly different syntaxes for invoking the method of an Application method since Touch has a newer MVC package. (You can assume that future versions of Ext will be closer to Touch).
The following assumes we have adding a method named "myMethod" to our Application and we are using the default namespace of "MyApp". Change these to be appropriate to your application.
In Touch:
In controllers, you can access the application instance by invoking this.getApplication().
Code:
this.getApplication().myMethod();
Code:
MyApp.app.myMethod();
In controllers, you can access the application instance by the property this.application.
Code:
this.application.myMethod();
Once you have a reference to the application instance you can invoke the method.Aaron Conran
@aconran
Sencha Architect Development Team
Thanks. I am using Ext and I am not inside a controller. Does that mean that I cannot access this function?
I'd probably do MyApp.app = this; within Application launch. That way you can access it via the global MyApp.app.Aaron Conran
@aconran
Sencha Architect Development Team | http://www.sencha.com/forum/showthread.php?194800-Calling-Application-Basic-Functions | CC-MAIN-2014-41 | refinedweb | 264 | 60.41 |
> Thanks for a clear explanation. Your fix would work fine for me. What's > important is that `accessible-keymaps' return the right result. I think > you're saying that it's not necessary for it to load the library to be able > to do that. My fix doesn't cause accessible-keymaps to return "the right result". E.g. if 2C-command contains a prefix key such as [f2 f1], it would return just (([f2] . 2C-command)) even, whereas after autoloading the map accessible-keyamps would return (([f2] keymap ...) ([f2 f1] keymap ...)) > - `accessible-keymaps' advertises that it does this, so it should (or else > the advertising should be changed). Well, if we want to nitpick, we can argue that the docstring is sufficiently vague to allow many different interpretations. So I don't find this argument very compelling. > -. I don't understand why you need accessible-keymaps at all, then. E.g. before C-x is entered, you don't need to know that there's another prefix on C-x v. Stefan | http://lists.gnu.org/archive/html/emacs-pretest-bug/2006-10/msg00060.html | CC-MAIN-2015-22 | refinedweb | 173 | 67.96 |
Integrates Jasmine JavaScript tests with the Django test framework in a simple but effective DRY way.
This app integrates Jasmine JavaScript tests with the Django test framework in a simple but effective DRY way. Using it you can easily write and run tests that integrates your frontend and backend in a manner that is much easier to maintain than selenium tests interacting with full web pages.
You can either run individual jasmine spec files and check the result from within your Django test suit or open an url from your devserver and run all specs at once, checking the result on the webpage.
Add 'djasmine' to your INSTALLED_APPS:
INSTALLED_APPS = [ ... 'djasmine', ]
Include the djasmine URLconf in your project urls.py like this:
url(r'^djasmine/', include('djasmine.urls')),
Add the following to your project settings:
import jasmine_core JASMINE_SPEC_ROOT = BASE_DIR + '/path/to/spec/files' STATICFILES_DIRS = [ jasmine_core.__path__[0], JASMINE_SPEC_ROOT, ]
Now you need to get your site’s JavasSript files included by the Djasmine runner view. You probably already have them written out in your 'base.html' template or similar. In order to keep DRY you don’t want to provide this list again in some test setup file, and with Djasmine you don’t have to. Instead break out the list of javascript tags into a special top-level template called 'javascripts.html' and include this in your 'base.html' (or similar). This template will also be picked up by the spec runner code. If you are using e g compressor preprocessing tags the template include approach allows you to use these also for the test running code.
For more specialized needs you can provide your own 'djasmine/specrunner.html' template.
Create your Django tests by using djasmine.testcase.JasmineRunnerTestCase as base class for your test cases. There is one required class property, webdriver, that should specify the Selenium WebDriver class you wish to use for the test, e g selenium.webdriver.firefox.webdriver.WebDriver.
Run and check result of a Jasmine spec file with the assertSpecPasses method, which takes one argument: the name of your spec file.
Example:
from djasmine.testcase import JasmineRunnerTestCase from selenium.webdriver.firefox.webdriver import WebDriver class MyIntegrationTest(JasmineRunnerTestCase): webdriver = WebDriver def test_all_works_nicely(self): self.assertSpecPasses('my_tests.spec.js') # Runs everything in this spec file and checks result ... (other checks of backend state possible here) ...
Download the file for your platform. If you're not sure which to choose, learn more about installing packages. | https://pypi.org/project/djasmine/ | CC-MAIN-2017-30 | refinedweb | 407 | 58.48 |
Pádraig Brady <address@hidden> writes: > Jim Meyering wrote: >> Pádraig Brady wrote: >> >>> Jim Meyering wrote: >>>> Eric Blake wrote: >>>>> According to Pádraig Brady on 10/5/2009 3:53 PM: >>>>>>>>> This is a new test, but FC5 is soooo old, >>>>>>>>> that I'm not sure it's worth worrying about. >>>>>>>> March 2006? >>>>>>> The failure is probably a function of the kernel. >>>>>>> Which is it? >>>>>> In summary this is what fails: >>>>>> >>>>>> $ touch a >>>>>> $ ln -s a symlink >>>>>> $ ln -L symlink hardlink >>>>>> ln: creating hard link `hardlink' => `symlink': Invalid argument >>>>>> >>>>>> `man linkat` says that AT_SYMLINK_FOLLOW is only supported since 2.6.18 >>>>>> and my FC5 system is 2.6.17 >>>>> This should fix it. I don't have access to FC5, but I tested the new code >>>>> path by priming the cache (gl_cv_func_linkat_follow=runtime ./configure) >>>>> along with a temporary setting of have_follow_really=-1 in linkat.c. I >>>>> also verified that the replacement is not picked up on cygwin 1.7, where >>>>> AT_SYMLINK_FOLLOW was implemented at the same time as linkat. >>>>> >>>>> The patch copies from areadlink.c, as well as link_follow earlier in >>>>> linkat.c, to create two new fd-relative helpers. For now, I didn't see >>>>> any reason to expose them, but areadlinkat may someday be worth making >>>>> into a full-blown module. >>>> Wow, that was quick. Thanks. >>>> I should have read this first. >>>> >>>> I was just reviewing the changes in gnulib and >>>> see a few that should be included in the imminent coreutils >>>> beta release, so will probably take this one, too. >>> Needs a couple of tweaks.. >>> >>> This needs to be added to linkat.c >>> (seems like it should be refactored somewhere?) >>> >>> #ifndef SIZE_MAX >>> # define SIZE_MAX ((size_t) -1) >>> #endif >>> #ifndef SSIZE_MAX >>> # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) >>> #endif >> >> This should do it: >> >>>From 6f6420cc9705dcfa545a28c674fddf5703e72c86 Mon Sep 17 00:00:00 2001 >> From: Jim Meyering <address@hidden> >> Date: Tue, 6 Oct 2009 11:11:39 +0200 >> Subject: [PATCH] linkat: avoid compilation failure >> >> * lib/linkat.c: Include <stdint.h> for use of SIZE_MAX. > > That works thanks. > > I suppose these should include stdint.h also? > > areadlink.c:# define SIZE_MAX ((size_t) -1) > areadlink-with-size.c:# define SIZE_MAX ((size_t) -1) > backupfile.c:# define SIZE_MAX ((size_t) -1) > fnmatch.c:# define SIZE_MAX ((size_t) -1) > quotearg.c:# define SIZE_MAX ((size_t) -1) > striconv.c:# define SIZE_MAX ((size_t) -1) Note that stdint.h may not be sufficient to get SIZE_MAX, quoting. */ However given that SIZE_MAX should be in stdint.h according to POSIX, maybe it makes more sense to make sure gnulib's stdint.h replacement is enabled when SIZE_MAX is not provided by the system's stdint.h? And then deprecate size_max.h in favor of stdint. > While these already include stdint.h so should probably not redefine > > fts.c:# define SIZE_MAX ((size_t) -1) > getdelim.c:# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) > getndelim2.c:# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) SSIZE_MAX should be provided by limit.h, see: The stdint.h documentation doesn't mention SSIZE_MAX: /Simon | http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00081.html | CC-MAIN-2014-52 | refinedweb | 484 | 78.45 |
A new release candidate is available.Changes since previous release candidate:
Binaries available here: ikvmbin-0.42.0.3.zipSources: ikvm-0.42.0.3.zip, openjdk6-b16-stripped.zip
In the weeks before PDC I've been working on compiling Eclipse with ikvmc. This works was triggered by Mainsoft's Eyal Alaluf who asked me to work on this and also provided a desperately needed starting point. I had wanted to do this for ages, but didn't feel like struggling with the Eclipse build system to figure out how to get started.
A couple of the changes in the most recent development snapshot are specifically related to this. In particular the ability for custom assembly class loaders to be called when the module initializer is run. This enables the statically compiled Eclipse OSGi bundles to be lazily activated on first use.
Instructions
Here are the steps needed to compile Eclipse 3.4.2 x86 on Windows:
md plugins-compiled
ikvm\bin\ikvmc @response0.txt
ikvm\bin\ikvmc @response1.txt
Source Code
The sources for eclipse-clr.exe are in this Visual Studio 2008 solution. It's pretty small and most of what it does is configure and hook OSGi to change the bundle loading and initialization. If you want to build eclipse-clr.exe, you first have to run ikvmc on response0.txt, then build eclipse-clr.exe (it depends on the OSGi assembly built with response0.txt) and after that you can run ikvmc on response1.txt (it depends on eclipse-clr.exe, because that contains the custom assembly class loader used for the bundles).
The response0.txt and response1.txt files were generated from the OSGi manifests and if there is interest I can publish the source to that as well, but is pretty hacky.
Performance
When compiled to native with ngen, Eclipse starts up faster than with JDK 1.6 on my systems. In theory the private working set should also be significantly less, allowing multiple Eclipse instances to use far less memory.
Disclaimer
This is just a technology demonstration, not production code and has not been extensively tested.
Jon Skeet recently blogged about the performance of [ThreadStatic] versus the new .NET 4.0 ThreadLocal<T>. I was surprised to see that ThreadLocal<T> was faster than [ThreadStatic], because ThreadLocal<T> uses [ThreadStatic] as the underlying primitive.
How do you go from a static field to a per instance field? It's simple, once you think of it. You (ab)use generic types. Here's a simplified ThreadLocal<T>:
public class ThreadLocal<T>{ HolderBase holder; static int count; static Type[] types = new Type[] { typeof(C1), typeof(C2), typeof(C3) }; abstract class HolderBase { internal abstract T Value { get; set; } } class C1 { } class C2 { } class C3 { } class Holder : HolderBase { [ThreadStatic] static T val; internal override T Value { get { return val; } set { val = value; } } } public ThreadLocal() { holder = MakeHolder(Interlocked.Increment(ref count) - 1); } HolderBase MakeHolder(int index) { Type t1 = types[index % 3]; Type t2 = types[(index / 3) % 3]; Type t3 = types[index / 9]; Type type = typeof(Holder<,,>).MakeGenericType(typeof(T), t1, t2, t3); return (HolderBase)Activator.CreateInstance(type); } public T Value { get { return holder.Value; } set { holder.Value = value; } }}
The real ThreadLocal<T> type in .NET 4.0 beta 2 is much more complex, because it has to deal with recycling the types and protecting against returning a value from a recycled type. It also uses a higher base counting system to number the types, the maximum number of types generated (per T) is 4096 in beta 2. After you allocate more than that, it falls back to using a holder type that uses Thread.SetData().
I'm not sure what to make of this. It's a clever trick, but I think it ultimately is too clever. I benchmarked a simpler approach using arrays (where each ThreadLocal<T> simply allocated an index in the [ThreadStatic] array) and it was a little bit faster and doesn't suffer from the downsides of creating a gazillion types (which probably take more memory and those types stay around until the AppDomain is destroyed).
Finally a tip for Microsoft, move the Cn types out of ThreadLocal, because currently they are also generic (due to the fact that C# automatically makes nested types generic based on the outer type's generic type parameters) and that is unnecessarily wasteful.
While the 0.42 release is still baking, a new development snapshot is available.
Changes:
Binaries available here: ikvmbin-0.43.3595.zip | http://weblog.ikvm.net/default.aspx?month=2009-11 | CC-MAIN-2018-05 | refinedweb | 749 | 57.37 |
ZF-7350: Make Zend_Loader_PluginLoader to prefix agnostic (namespaces)
Description
Zend_Loader_PluginLoader appends '_' to the prefixes added to it, preventing the use of namespaces classes as plugins. Making it prefix-agnostic allows it to load namespaced classes, by specification of a "My\View\Helper\" prefix.
Posted by Giorgio Sironi (giorgiosironi) on 2009-07-22T06:34:49.000+0000
Quick and dirty fix to allow the use of namespaced view helpers. This works only because since view helpers cannot be in subfolders and the basename is directly appended to the path. For other classes path calculation could be wrong.
Posted by Steven Rosato (ratius) on 2009-08-09T19:26:07.000+0000
The provided fix works well and does not seem to break the tests though that one must always append the \ at the end of the namespace prefix for exemple in resource loading in an ini file:
pluginPaths["My\Application\Resource\"] = "My/Application/Resource"
To optionnally provide the ending backslash strstr($prefix, '\') could be used but then again non subnamespaces would fail at that using
$pluginLoader->addPrefixPath('My', 'Path/To/My'); //My is a namespace
still the only quick solution remain but an end backslash must be provided.
$pluginLoader->addPrefixPath('My\', 'Path/To/My'); //My is a namespace
Don't know your thoughts on that maybe Giorgio's solution may prove the only one not breaking anything.
Posted by Steven Rosato (ratius) on 2009-08-09T19:29:28.000+0000
Edit (correction): though that one must always append the "\ \"
[second code snippet]:
and $pluginLoader->addPrefixPath('My\ \', 'Path/To/My'); //My is a namespace
Posted by Andy Thompson (at465) on 2010-02-07T11:46:58.000+0000
I also came across this issue as I'm starting to write my applications using proper namespaces. I tackled the issue using the same method. I can't see it having any problems considering \ has never been used as a class name character, and looking at the end character seems the most logical way to do this.
Since Zend_Loader has been modified to support PHP 5.3 namespaces in 1.10, I was hoping this could be implemented as a minor release?
Posted by Steven Rosato (ratius) on 2010-02-08T11:20:44.000+0000
I'm still watching and hoping for this as it is my only patch that I need to apply each time Zend upgrades. It does not break unit tests and I, too, think it should be implemented in a minor release.
Posted by Giorgio Sironi (giorgiosironi) on 2010-02-23T07:55:24.000+0000
Updated patch for Zend Framework 1.10.1; hope this will be integrated soon.
Posted by Matthew Weier O'Phinney (matthew) on 2010-02-23T09:24:53.000+0000
Giorgio -- any chance I can get a unit test from you as well?
Posted by Giorgio Sironi (giorgiosironi) on 2010-02-23T11:21:27.000+0000
zf-7350-3: patch to use against /trunk with unit test added to PluginLoaderTest and necessary changes to Zend_Loader_PluginLoader. It incorporates the previous ones.
Posted by Matthew Weier O'Phinney (matthew) on 2010-02-23T11:50:44.000+0000
Patch applied to trunk and 1.10 release branch. Modified slightly to add a conditional to skip the test when PHP version is < 5.3.0. | http://framework.zend.com/issues/browse/ZF-7350?focusedCommentId=38362&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel | CC-MAIN-2014-10 | refinedweb | 544 | 65.62 |
53 minutes ago, felix9 wrote
File Save Dialog is in fact, a quite complex thing, its basically an Explorer, so it will load all your shell extensions, including those badly written, and I suppose it will try to enumerate system namespaces, and go to your last saved location, if your last saved location is something unreliable, like an offline network drive, I suppose some unexpected behavior can happen.
+1 on this response by Felix.
I used to have exactly the same behavior but with IE when my work computer was on Windows 7 - every time I tried to download a file it would completely lock up on the 'save as' dialog box. Turned out to be some network folder it was attempting to access but couldn't, yet didn't time out for some reason.
My guess is you are experiencing something similar... | https://channel9.msdn.com/Forums/Coffeehouse/Win8-Snipping-tool-issues/485c3d5222854d918790a17101137bd9 | CC-MAIN-2015-32 | refinedweb | 143 | 51.31 |
A “wtf” at lunch today while reading this book. There is a section on the 2 types of blocks in Ruby’s methods, and a description of the “yield” method. Totally jacked; it’s basically like sending an anonymous function in ActionScript seperate from a method’s parameters. The function then in turn runs that block of code for every yield statement. The yield statement can also pass parameters to this code block. Why you’d do this is beyond me, but when I yield, I’ll be using yield… imagine that?
For example, here’s Ruby calling a method, passing a block that the yield will run inside of the method:
def method puts "start of method" yield("this'll be arg1", "this'll be arg2") yield("this'll be arg1", "this'll be arg2") puts "end of method" end method {|arg1, arg2| puts arg1 + ", " + arg2}
It’ll output (I think):
start of method
this’ll be arg1, this’ll be arg2
this’ll be arg1, this’ll be arg2
end of method
The equivalent in ActionScript 1 is:
function method ( someFunc ) { trace("start of function"); someFunc.call(this, "this'll be arg1", "this'll be arg2"); someFunc.call(this, "this'll be arg1", "this'll be arg2"); trace("end of function"); } method(function(arg1, arg2){ trace(arg1 + ", " + arg2); });
Which outputs:
start of function
this’ll be arg1, this’ll be arg2
this’ll be arg1, this’ll be arg2
end of function
The only difference is the ActionScript example sends it as an argument whereas in Ruby, it appears to be sent as a seperate entity from the methods invocation parameters.
Don’t get me started on the Archeologist degree one needs to read printf statements…
Anyway, weird stuff.
Hey there.
(disclaimer — I’m not a Ruby programmer)
You’re right. Ruby blocks are similar to AS closures. What I like about the Ruby block syntax is that it makes it easy to define things that feel like part of the language. And the yield statement can make it easier to retain state as you pass control from one block to another, which is great for iterators.
For example, let’s say you wanted to create an array class that has something like ‘foreach’ but only if the array value matches a certain value.
Sho
May 18th, 2006
Hmmm burning the midnight oil on ruby. Im loving it as a data source for flex2. But much like you I have found several things that make me go huh?
Campbell
May 18th, 2006
RoR is pretty hot theses days. That’s good since Ruby has a lot of advantages over others dynamicly typed programming languages (like PHP). However it’s still dynamicly typed. Did you have a look at haXe Remoting Proxys ? They are a good way to do typeful communications between the Flash Client and the Server.
Nicolas
May 21st, 2006
Yep, blogged haXe.
JesterXL
May 22nd, 2006
Blocks made me go ‘huh?’ at first, too. However, I know some Java programmers that use them quite often. There is a difference between a block and a closure, though. There are some great examples of their uses later on in the Agile book (2nd edition coming soon) and in the Recipes book.
Steven
May 22nd, 2006 | http://jessewarden.com/2006/05/ruby-chronicles-1-blocks-and-yield.html | crawl-001 | refinedweb | 547 | 71.24 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.