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
|
|---|---|---|---|---|---|
Web would turn up similar numbers of problems.
So. What’s so hard about this, and what can be done to improve the situation?
The problem
Well. Actually, “problems”. As I see it, there are three major issues facing frameworks on shared hosting.
First off, the new wave of popular frameworks all make a clean break from a traditional CGI-style model where the application is simply loaded and executed fresh on each and every request; this is a necessary change (reloading a framework like Rails or Django on every request would result in horrific performance), but one that causes headaches for web hosts.
Second, the deployment options are so varied as to be bewildering; even when there’s some sort of standard gateway protocol — as with WSGI in Python — there’s still plenty of room for disagreement on how to actually deploy an application. To run with the WSGI example (and pick on Python a bit just to show I’m not engaging in any favoritism here): I can write an application that speaks WSGI fairly easily, and WSGI applications are for the most part interchangeable. But on the server side, it’s not so clear: should the server learn to speak WSGI directly (à la
mod_wsgi)? Should there be an intermediary to bridge the gap, like
flup? If so, what protocol should the server and the intermediary use (
flup can speak FastCGI, SCGI and AJP, for example)?
Third, the new wave of frameworks are bringing languages like Ruby and Python onto shared hosting for the first time, and with that comes the problem of library support; there’s a whole new world of standard modules hosts need to be aware of and be ready to support if they want to get serious about these frameworks, because asking the typical shared-hosting customer to go out and compile database adapters or image-manipulation libraries (if your AUP even allows that) simply won’t work.
Go long.
But hosts have traditionally been reluctant to allow users to launch long-running processes of the type needed to efficiently serve a framework-based application; more than once in my freelancing days, I ran into hosts with automated process monitors which simply killed any user-owned process that stayed resident for more than about thirty seconds. Others have been known to kill anything not on an approved whitelist (read: Rails), which has led to the amusing phenomenon of people renaming their non-Rails FastCGI handlers to
dispatch.rb as a workaround.
This situation is slowly getting better, but a whole lot more progress is needed. Yes, a long-running process will chew up valuable memory even when it’s not actually serving a request, but that’s something that has to be accepted; hosts which don’t support this are going to be hosts that don’t get business (or word-of-mouth referrals) from framework users.
One obvious way to do it
One of the reasons behind PHP’s ubiquity is the fact that, for the longest time, the deployment pattern was simple and standard: install PHP and
mod_php, tell Apache to use that for anything ending in
.php and you’re pretty much done. These days there’s a bit of fragementation in the options —
mod_php versus FastCGI versus straight CGI — but they’re all well-documented, well-understood and easy to set up (and, from the perspective of an application author, they all work the same way: just upload a
.php file). What’s more, most Linux distributions can set up the whole thing for you with a single dip into the package manager.
Ruby and Python, right now, have nothing approaching this. Yes, Python has WSGI, but see above for why that doesn’t solve the problem. At most, there needs to be one standard stack per language, preferably of the form “install this Apache module”. For Python I think the most promising option is
mod_wsgi which, though it doesn’t let you do everything in
.htaccess, seems like it’d lend itself quite easily to a plugin for the popular hosting control panels. For Ruby I don’t know; I’m not familiar enough with the various options to be able to form an opinion.
This doesn’t mean that frameworks shouldn’t support multiple deployment options, but it does mean that, for whatever language you’re working in, there should be a standard option and the framework should support it.
import this
The other big reason behind PHP’s success is that it targets web development specifically, and comes with everything and the kitchen sink. The downside is that PHP’s standard function namespace is horrifically crowded, but at least there aren’t a whole lot of common cases where you have to go out and install a new library just to get something basic like database support.
Ruby and Python, on the other hand, are general-purpose modular languages; this means there are a number of modules which, though necessary for web application development, aren’t included in the standard library of either language. Database connectivity, for example, largely comes from third-party modules; Python only supports SQLite out of the box (and only in Python 2.5 and up), and as far as I know Ruby doesn’t ship modules for any of the “big three” open-source databases (SQLite, MySQL and PostgreSQL) in its standard library.
Some of this could be helped by changes to standard libraries or by more convenient packaging of some of the important third-party items, but if hosts want to get serious about frameworks they need to be ensuring the availability of any key modules that don’t come as part of the language; telling someone to go compile their own copy of, say,
MySQLdb for Python is a non-starter.
Work with me here
You’ll note that, of the three things I’ve outlined above, two lay a lot of responsibility on the hosting providers (though if you think that solving the “standard deployment” issue is going to be easy on the framework side, I’ve got a bridge in Brooklyn I’d like to sell you). That’s pretty much inevitable: when a new method of building web applications becomes popular, web hosting needs to change to keep up.
But by and large, this process needs to be a dialogue between hosts who want to offer solid framework support, and developers and users of frameworks who want to make the hosting experience as painless as possible. Neither side can afford to sit back and hope that the other will deal with the problem, and neither side alone has enough expertise or resources to solve all of the issues.
And there are certainly hosts out there which are doing their part: Joyent, with whom this site is happily hosted, pride themselves on Rails support and have also done a lot of largely-unsung work to ensure that Python frameworks will be easy to use on their shared offerings (to the point of contributing patches to key third-party modules so they’ll work on Joyent’s Solaris environment). WebFaction has literally gone all-out, with integrated support for popular frameworks right in their control panel (see their Django deployment screencast for an example).
Going forward, I think that’s going to be the only way to resolve the issues I’ve listed above: the hosts who want to provide a great framework experience will get together with the frameworks which want to provide a great hosting experience, and sit down and solve these issues. And if they’re looking for good solutions to the problems they’re having with frameworks, I’d love to see Dreamhost get in on that.
|
http://www.b-list.org/weblog/2008/jan/10/hosts/
|
CC-MAIN-2016-30
|
refinedweb
| 1,293
| 57.95
|
#include <wx/splitter.h>
This class manages up to two subwindows.
The current view can be split into two programmatically (perhaps from a menu command), and unsplit either programmatically or via the wxSplitterWindow user interface.
This class supports the following styles:
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros for events emitted by this class:
wxEVT_SPLITTER_SASH_POS_CHANGINGevent.
wxEVT_SPLITTER_SASH_POS_CHANGEDevent.
wxEVT_SPLITTER_UNSPLITevent.
wxEVT_SPLITTER_DOUBLECLICKEDevent.
Default constructor.
Constructor for creating the window.
Destroys the wxSplitterWindow and its children.
Creation function, for two-step construction.
See wxSplitterWindow() for details.
Returns the default sash size in pixels.
The size of the sash is its width for a vertically split window and its height for a horizontally split one. Its other direction is the same as the client size of the window in the corresponding direction.
The default sash size is platform-dependent because it conforms to the current platform look-and-feel and cannot be changed.
Returns the current minimum pane size (defaults to zero).
Returns the current sash gravity.
Returns the current sash position.
Returns the default sash size in pixels or 0 if it is invisible.
Gets the split mode.
Returns the left/top or only pane.
Returns the right/bottom pane.
Initializes the splitter window to have one pane.
The child window is shown if it is currently hidden.
Returns true if the sash is invisible even when the window is split, false otherwise.
Returns true if the window is split, false otherwise.
Application-overridable function called when the sash position is changed by user.
It may return false to prevent the change or true to allow it.
Application-overridable function called when the window is unsplit, either programmatically or using the wxSplitterWindow user interface.
This function replaces one of the windows managed by the wxSpl.
Sets the minimum pane size.
Sets the sash gravity.
Notice that when sash gravity for a newly created splitter window, it is often necessary to explicitly set the splitter size using SetSize() to ensure that is big enough for its initial sash position. Otherwise, i.e. if the window is created with the default tiny size and only resized to its correct size later, the initial sash position will be affected by the gravity and typically result in sash being at the rightmost position for the gravity of 1. See the example code creating wxSplitterWindow in the splitter sample for more details.
Sets whether the sash should be invisible, even when the window is split.
When the sash is invisible, it doesn't appear on the screen at all and, in particular, doesn't allow the user to resize the windows.
Sets the sash position.
Sets the split mode.
Initializes the top and bottom panes of the splitter window.
The child windows are shown if they are currently hidden.
Initializes the left and right panes of the splitter window.
The child windows are shown if they are currently hidden.
Unsplits the window..
|
https://docs.wxwidgets.org/3.1.2/classwx_splitter_window.html
|
CC-MAIN-2019-09
|
refinedweb
| 493
| 59.3
|
!
Step 1: Start a New Unity Project.!
Step 2: It's That Easy!
Before we forget go to file at the top and save scene. Call it whatever you want.
Download this free UFO model:...
Extract that folder and drag the whole thing into Unity.
Find the .obj file and drag that into the scene.
Click on the UFO and change the scale to .1 across the board (x,y,z).
Click on the ARCamera in the hierarchy and you will notice a bunch of white lines come up. These lines represent the field of view of the camera.
Drag the UFO inside this field of view and you have Markerless AR!
Click play and you will see the UFO in front of your face.
Step 3: Lets Make It a Little Smarter.
The problem with what we have so far is that the UFO is stuck to the camera and will never leave are field of view.
As long as your phone has a gyro we can click on ARCamera and change world center mode to device tracking.
Open Vuforia configuration again and make sure enable device pose tracking is checked on and change world correction mode to handheld.
Now it will look the same in Unity but when we build out to our mobile phone the UFO will stay in one place when we look around so it will go in and out of view.
The next problem is that we can never get closer to the object. No matter how much we walk the UFO will always stay a fixed distance away from our camera.
Next we will try to use the GPS location of the phone and as the user walks forward we will move the UFO closer to the Unity camera, creating the effect that we are walking closer to the UFO.
Step 4: Lets Add a Display for Text.
Before we add any code we need to create a UI t ext element for displaying the distance between where the user started the app and where they are currently. This is nice because it allows us to see how often the distance is getting updated for debugging purposes.
First right click in the hierarchy and create a new UI, text element.
Change the font color to white and resize it however you want.
Create a UI, image in the same fashion and color it however you want. Move it above the text in the hierarchy so it appears behind the text. You may want to modify its width and height so it looks a little better.
Click on the canvas object that was created and change the UI scale mode from constant pixel size to scale with screen size.
Click on the text object again and change horizontal overflow from wrap to overflow.
Finally, (with the text still selected) click on the drop down on the top right to change the tag. Add a tag and call it "distanceText" Now go back to the dropdown menu and distanceText should be there, make sure to select that.
Save the scene and lets add some code.
Step 5: Lets Add Some C#.
Select the UFO game object in the hierarchy and click add component off to the right. Add a new C# script and call it "AugmentedScript" just like in the picture above. Double click that new component and it will open up MonoDevelop. Delete everything in there and paste in the following:
using UnityEngine;
using System.Collections; using UnityEngine.UI;
public class AugmentedScript : MonoBehaviour {
private float originalLatitude; private float originalLongitude; private float currentLongitude; private float currentLatitude;
private GameObject distanceTextObject; private double distance;
private bool setOriginalValues = true;
private Vector3 targetPosition; private Vector3 originalPosition;
private float speed = .1f;
IEnumerator GetCoordinates() { //while true so this function keeps running once started. while (true) { // check if user has location service enabled if (!Input.location.isEnabledByUser) yield break;
// Start service before querying location Input.location.Start (1f,.1f);
//);
//if original value has not yet been set save coordinates of player on app start if (setOriginalValues) { originalLatitude = Input.location.lastData.latitude; originalLongitude = Input.location.lastData.longitude; setOriginalValues = false; }
//overwrite current lat and lon everytime currentLatitude = Input.location.lastData.latitude; currentLongitude = Input.location.lastData.longitude;
//calculate the distance between where the player was when the app started and where they are now. Calc (originalLatitude, originalLongitude, currentLatitude, currentLongitude);
} Input.location.Stop(); } }
//calculates distance between two sets of coordinates, taking into account the curvature of the earth. public void Calc(float lat1, float lon1, float lat2, float lon2) {
var R = 6378.137; // Radius of earth in KM var dLat = lat2 * Mathf.PI / 180 - lat1 * Mathf.PI / 180; var dLon = lon2 * Mathf.PI / 180 - lon1 * Mathf.PI / 180; float a = Mathf.Sin(dLat / 2) * Mathf.Sin(dLat / 2) + Mathf.Cos(lat1 * Mathf.PI / 180) * Mathf.Cos(lat2 * Mathf.PI / 180) * Mathf.Sin(dLon / 2) * Mathf.Sin(dLon / 2); var c = 2 * Mathf.Atan2(Mathf.Sqrt(a), Mathf.Sqrt(1 - a)); distance = R * c; distance = distance * 1000f; // meters //set the distance text on the canvas distanceTextObject.GetComponent ().text = "Distance: " + distance; //convert distance from double to float float distanceFloat = (float)distance; //set the target position of the ufo, this is where we lerp to in the update function targetPosition = originalPosition - new Vector3 (0, 0, distanceFloat * 12); //distance was multiplied by 12 so I didn't have to walk that far to get the UFO to show up closer
}
void Start(){ //get distance text reference distanceTextObject = GameObject.FindGameObjectWithTag ("distanceText"); //start GetCoordinate() function StartCoroutine ("GetCoordinates"); //initialize target and original position targetPosition = transform.position; originalPosition = transform.position;
}
void Update(){ //linearly interpolate from current position to target position transform.position = Vector3.Lerp(transform.position, targetPosition, speed); //rotate by 1 degree about the y axis every frame transform.eulerAngles += new Vector3 (0, 1f, 0);
} }
Step 6: Let Me Explain:
In the start function we start a coroutine called GetCoordinates(). This will continue to execute because everything inside GetCoordinates() is wrapped inside a while(true) block. Everything inside there will continue to get the users current latitude and longitude and compare it to the original latitude and longitude of the user when the app started.
There is a Calc() function that will take both sets of coordinates and give us back the user's distance in meters from the original location.
Now that we have the distance the user has walked we can move the UFO closer to the Unity camera by this same distance factor.
There is typically about a half a second delay between distance updates so that leaves a ton of room for improvement here. With this delay the UFO is only moving after the user has already moved. You could make some attempts to predict the next move of the user based on their previous move or even take it further by using accelerometer values to test if this user is actually moving before predicting their next move.
Step 7: We're Done!
Now we are ready to build this out to a mobile device and take it outside!
Go to file, build settings, and switch the platform to IOS or Android.
A couple notes before we do this:
-If you are building out for IOS you need to go to file, build settings, player settings and add a bundle identifier (com.YourCompanyName.YourAppName), and also add a GPS usage description.
-Also, if you are building out for IOS you will need to download Xcode and set up a free apple developer account.
-If you are going to build out to Android you need to go into the developer options on your phone and enable USB debugging.
-Make sure you have location services turned on!
Let me know if you have any questions in the comments and thanks for looking!!
10 Discussions
Question 5 months ago
Nice tutorial, thank you! but somehow i get the error:
Assets/AugmentedScript.cs(78,28): error CS0305: Using the generic method `UnityEngine.GameObject.GetComponent<T>()' requires `1' type argument(s)
any suggestions?
5 months ago
This Tutorial is incomplete - I think!As per the initial description, the UFO must be static at the position wherever it appears on First loading of the AR scene.But THe UFO is not fixed to the initial position and it follows the camera like a faithul puppy.
I know some Unity logic to make an object independant of camera.I think He is also talkin about the same.
fnd the WORLD_DISTACE_FROM_CAMERA_TO_OBJECT_INITIAL in awake or start function.when the camear moved find the WORLD_DISTACE_FROM_CAMERA_TO_OBJECT_RECENT.Then shift object transform position by the differnce of these two values.
But I am unable to try it for now as I am not fully introduced into Unity/Vuforia platforms.If any one of the exerienced programmers do it and share I am very happy to integrate it.
Thanks in Advance.
1 year ago
Let me tell you reason why doesn't change the distance.
Because you're in the building! If you in the building, GPS is doesn't works :)
1 year ago
Hm!
I think It is not a simple problem!I am asking you really a complicated thing.To check the result,I have finished even without sticking the first I possitioned the second at the tail of the pencil just balancing the mobile to put the first marker at the head of the pencil.
With lots of excuses to you,the measurements are differing every time:-( because the "Z" and distance from camera differs:-)
1 year ago
you are brilliant in finding solutions.I am a starter and i have a problem can you help me in solving a very basic and tricky riddle?
I took up a small project for finding distance between two points which I position them on consecutive two hits.Without knowing about raycast hit point I have achieved great result by simple click code.As I started with a marker/image target and there are some predefined gameobjects where I ave tested inside the application It worked well.
But when I came to reality as it has to do in marker less AR The logic si failing.I have followed all of your instructions:
1).PanelCamera with webcameratexture,
2).Cubeworld without its meshrenderer
- all are working perfect.
when I have started putting the start marker on my first touch,The predefined gameobject appearing in the AR world just where I touched As a case study,there was a pencil on my desk and startmarker is just appearing at the head of the pencil,
But It is not sticking to the head of the pencil and it is following the camera!If it sticks there next I will touch at its tail and with finding magnitude of these two positions I could easily find the distance in centimeters.Initial Test in application window I got it already!
P.S:Plaese pay attention to this problem and solve this riddle of sticking agameobject wherever it was instantiated Simply amaking it rigid body and applying gravity may not work because we need to make it random in all vertical/horizontal/lanscape/portrait modes and directions!
1 year ago
Same issue with Kdewitt.
The tutorial works fine, but the distance is not updated.
:(
Reply 1 year ago
Same problem here.
1 year ago
Thank you so much?
Question :
Can I place the UFU in specific geolocation ?
1 year ago
Cool!!!! And very well explained :-)
Reply 1 year ago
Thanks so much!
|
https://www.instructables.com/id/How-to-Markerless-GPS-Based-Augmented-Reality/
|
CC-MAIN-2019-04
|
refinedweb
| 1,902
| 65.52
|
From: David Abrahams (dave_at_[hidden])
Date: 2004-08-11 14:25:31
"Robert Ramey" <ramey_at_[hidden]> writes:
> David Abrahams wrote:
>
> "Robert Ramey" <ramey_at_[hidden]> writes:
>
>>> Now that I do, I'm strongly convinced that
>>> it's a really bad idea.
>
>>Give it a chance to sink in.
>
> Looks like I don't have much choice.
>
>> It's a good idea even if you ignore
>> export because it reduces the chance that a template's meaning will
>> change based on definitions that follow it, allows syntax checking
>> before instantiation, and adds rigor.
>
> That's the problem with it in my view. Before, I could keep things in my
> head by extending the "macro" concept to include types. Now I can't. Now
> the meaning of something depends upon the order it is included in the
> program
It already did depend on order:
// a.hpp
inline int f(int x) { return x + 1; }
// b.hpp
inline long g(long x) { return f(x); }
// c.hpp
inline long f(long x) { return x; }
// d.cpp
#include "a.hpp"
#include "b.hpp"
#include "c.hpp"
int main()
{
return g(0);
}
There are lots more examples.
> - an incredibly subtle side-effect.
I agree, but order dependency is already there. Let's get rid of the
inclusion model if you want to kill it.
FWIW I think ADL (which is *not* order dependent in templates) is a
much worse source of subtlety. See for more.
> Worse, the meaning of a template now can vary quite a bit depending
> upon the argument used to instantiate it.
But less-so with 2-phase lookup and proper use of typename. At least
a type can't become an object and utterly change the meaning of the
template.
> The whole thing reminds me of trying to write a memo with
> Microsoft word. It constantly "helps you out" without telling you so you
> can't really see what's going on without keeping the whole global
> environment in your head. So it diminishes transparency, verifiability, and
> opportunity to enforce rigor in coding requires increased dependence on
> testing to gain confidence on program correctness.
I'd like to see an example where that happens. In my experience,
2-phase lookup does the opposite.
> Sorry, I know we're going off topic, but I couldn't let the above
> pass without comment.
Likewise. Maybe you should take up the claim that 2-phase lookup
should be removed on the comp.std.c++ newsgroup?
>>> CW < 8
>>>
>>> I believe that these versions will pass 100 %
>
>>I wouldn't count on it. CW 7.x couldn't handle the "sizeof() trick",
>>so *lots* of basic TMP things (like is_convertible) fail there. Of
>>course, maybe you're sure that none of these things are used...?
>
> Good thing you didn't tell me that before - its now passing 100%
Are you really testing CW 7.x?
> It feels like I've used everything in mpl (of course I didn't - it
> just feels like I did). I use is_convertible in many places as well
> as just about all the type_traits.
>
> On the other hand, maybe its just that I don't have enough tests to
> make it fail.
If you really count on the result of is_convertible being true when
it should be, then no, you don't have enough tests.
FWIW, I dropped CW 7.x support in Boost.Python and the iterators
library when CW 9 came out and have not received a single complaint.
I think VC6 is arguably the only 2-version-old compiler that might
warrant continued support.
-- Dave Abrahams Boost Consulting
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/2004/08/70048.php
|
CC-MAIN-2020-50
|
refinedweb
| 621
| 76.01
|
I am developing a ASP.Net5 MVC6 website Using EF7.
I wanted to access DbContext from one of my classes which is not being called from Controller.
Is it possible to access from there? If yes then please guide me a little so that I can learn how to do it.
So far searched a lot from GitHub and stackoverflow. Very little information on this topic.
If i need to inject to my class then how should I do it?
public class CarAppContext : DbContext { public DbSet<Car> Cars { get; set; } public DbSet<BodyType> BodyTypes { get; set; } } public Class NotificationManager { CarAppContext ctx; public NotificationManager(CarAppContext AppCtx) { ctx = AppCtx; } public void SendNotification(Car HisCar, UserNotification HisNotification) { //need to check he has subscribed or not //ctx is null here } }
You could call
new CarAppContext().
But if you want to use Dependency Injection instead, you will need to make sure that
Not surprised you haven't found docs. As ASP.NET 5 is still in beta, our docs haven't been written yet. When its ready, there will be more posted here:
|
https://entityframeworkcore.com/knowledge-base/31749775/mvc6-access-dbcontext-from-classes-not-related-to-controller
|
CC-MAIN-2021-17
|
refinedweb
| 178
| 57.06
|
Scalars, Vectors, and Matrices
Scalars, vectors, and matrices are fundamental structures of linear algebra, and understanding them is integral to unlock the concepts of deep learning.
- A scalar is a singular quantity like a number.
- A vector is an array of numbers (scalar values).
- A matrix is a grid of information with rows and columns.
They can all be represented in Python using the NumPy library.
import numpy # Scalar code example x = 5 # Vector code example x = numpy.array([1, 2, 3, 4]) # Matrix code example x = numpy.array([1, 2, 3], [4, 5, 6], [7, 8, 9])
Matrix Addition
In matrix addition, corresponding matrix entries are added together.
Matrix Multiplication
In matrix multiplication, the number of rows of the first matrix must be equal to the number of columns of the second matrix. The dot product between each row and column of the matrix and placed as an entry into the resulting matrix as shown in the image.
Matrix Transpose
A matrix transpose switches the rows and columns of a matrix.
Vector Magnitude
To calculate the magnitude of a vector, use the following formula:
For example, if we have the following 3D vector:
To calculate the magnitude, we do the following:
We can also calculate the magnitude of a vector using the
np.linalg.norm() function from the NumPy library.
import numpy as np v = np.array([3, 6, -6]) np.linalg.norm(v) # equals 9
Basic Vector Operations
Vectors can be added and subtracted from each other when they are of the same dimension (same number of components). Doing so adds or subtracts corresponding elements, resulting in a new vector of the same dimension as the two being summed or subtracted. Any vector can also be multiplied by a scalar, which results in every element of that vector being multiplied by that scalar individually.
Using NumPy, we can add equally sized vectors and matrices together using built-in Python addition between NumPy arrays. We can also use built-in Python multiplication to perform scalar multiplication on NumPy arrays. The code example shows an example implementation of both of these.
import numpy as np # Matrix Addition A = np.array([[1,2],[3,4]]) B = np.array([[-4,-3],[-2,-1]]) A + B ''' This outputs [[ -3 -1] [1 3]] ''' # Scalar Multiplication a = np.array([1,2]) 4 * a ''' This outputs [4 8] '''
Dot Product
The dot product of two vectors measures how much one vector “goes into” the other vector by summing the products of the vectors’ corresponding components. The formula for this is:
To recall how to use this formula, consider the following two vectors:
To find the dot product between these two vectors, we do the following:
We can use NumPy to compute vector dot products by using the
np.dot() function. An example implementation is shown.
import numpy as np v = np.array([4,0,-1]) u = np.array([2,8,-2]) np.dot(v,u) # equals 10
Augmented Matrix
A linear system of equations can be represented in matrix form using an augmented matrix, which takes the form [A | b] if we have the equation Ax=b. Let’s say we have the following equations:
We can represent this with the following augmented matrix:
Inverse Matrix
The inverse of a matrix, A-1, is one where the following equation is true:
We can use Gauss-Jordan elimination to solve for the inverse of a square matrix by hand (if one exists). With NumPy, we can use
np.linalg.inv() to solve for the inverse of a square matrix. An example implementation is shown in the code block.
import numpy as np A = np.array([[1,2],[3,4]]) print(np.linalg.inv(A)) """ This outputs: [[-2. 1. ] [ 1.5 -0.5]] """
Identity Matrx
The identity matrix is a square matrix of elements equal to 0 except for the elements along the diagonal that are all equal to 1.
Any matrix multiplied by the identity matrix, either on the left or right side, will be equal to itself.
Using NumPy, we can create any n x n identity matrix using the
np.eye() function. It takes one argument which determines the size of the matrix. A code implementation example is shown.
# 4x4 identity matrix identity = np.eye(4) ''' In the output terminal, identity renders as: [[1. 0. 0. 0.] [0. 1. 0. 0.] [0. 0. 1. 0.] [0. 0. 0. 1.]] '''
Permutation Matrix
A permutation matrix is a square matrix that allows us to flip rows and columns of a separate matrix.
NumPy Vectors and Matrices
We can represent both vectors and matrices using NumPy arrays.
For example, the following creates a NumPy array representation of a vector:
v = np.array([1, 2, 3, 4, 5, 6])
We can also create a matrix, which is the equivalent of a two-dimensional NumPy array, using a nested Python list:
A = np.array([[1,2],[3,4]])
Matrices can also be created by combining existing vectors using the
np.column_stack() function:
v = np.array([-2,-2,-2,-2]) u = np.array([0,0,0,0]) w = np.array([3,3,3,3]) A = np.column_stack((v, u, w))
This outputs:
[[-2 0 3] [-2 0 3] [-2 0 3] [-2 0 3]]
|
https://www.codecademy.com/learn/learn-linear-algebra/modules/math-ds-linear-algebra/cheatsheet
|
CC-MAIN-2022-05
|
refinedweb
| 873
| 56.35
|
inter-operate with the Java APIs and compiles down into byte code which can then be executed on the JVM.
also read:. Due to this conversion the name=value pairs in the json document can be accessed by object.name notation where object represents the json object and name represents the name of the attribute.
The model bean in this case is defined as:
class GroovyUser{ def id def screenName def name def url def followersCount def friendsCount def favouritesCount def statusesCount GroovyUser(id, screenName, name, url, followersCount, friendsCount, favouritesCount, statusesCount){ this.id = id this.screenName = screenName this.name = name this.url = url this.followersCount = followersCount this.friendsCount = friendsCount this.favouritesCount = favouritesCount this.statusesCount = statusesCount } def String toString(){ return "Name: "+this.name+"n"+ "ScreenName:"+this.screenName+"n"+ "Followers: "+this.followersCount+"n"+ "Friends: "+this.friendsCount+"n"+ "Favourites: "+this.favouritesCount+"n"+ "Statuses: "+this.statusesCount+"n" } }
As Groovy can be used a scripting language, the following code need not be compiled instead one could directly run the code by:
$ groovy filename.groovy
You would have to download and install the required binaries and libraries for running the groovy programs. More can be found at the official site.
import groovy.json.JsonSlurper def jsonSlurper = new JsonSlurper(); /* Read the JSON from the file system */ def reader = new BufferedReader( new FileReader("/home/mohamed/twitterUser.json")) def parsedData = jsonSlurper.parse(reader) def usersList = new ArrayList<GroovyUser>() parsedData.each { aUser -> def user = new GroovyUser(aUser.id, aUser.screen_name, aUser.name, aUser.url, aUser.followers_count, aUser.friends_count, aUser.favourites_count, aUser.statuses_count) usersList.add(user) } usersList.each {aUser -> println aUser}
There are few new things to note here:
- As Groovy supports closures, we are making use of the methods like “each” which is provided by the Groovy API on collections. The each method would for each element in the collection, execute the block of code provided with the each method. Something like-myCollection.each{ aData -> println aData }
- Semi colons are optional
- Type details for the variables are optional, so you can see that the variables have been declared by using “def” keyword but no type is declared.
- Look at the tremendous decrease in the number of lines of code written above. Parsing Json in Groovy is such a pleasure.
On a closing note, the difference in the lines of code in Java and Groovy might tempt few of them to learn the syntax of the language. I am sure learning groovy is pretty easy as it has a short learning curve. Over the last few years there has been a transition to polyglot programming and with the advent of new languages which run on the JVM, they can inter-operate with an existing java application with no additional overhead.
We would over the coming days try to provide a few getting started like tutorials for Groovy and other JVM languages like Scala.
|
https://javabeat.net/parsing-json-using-groovy/
|
CC-MAIN-2021-39
|
refinedweb
| 472
| 58.08
|
Functionalities for detecting whether a line is in one of the stored line ranges (or in the context of a range). More...
#include <lineranges.h>
Functionalities for detecting whether a line is in one of the stored line ranges (or in the context of a range).
This also performs some optimization: ranges are stored in a set in ascending order; if we have ranges, e.g., 1-20, 50-70, 100-200, and we check whether 23 is in range, we first check if it's in 1-20, then, since it's not there, we check whether it's in 50-70; it is not, and since the range is 50-70 it makes no sense searching for it in other ranges. The next search will start from range 50-70, since we assume that line numbers are always increasing.
Adds a range to the set.
The argument can be:
Checks whether the passed element is in a range of this set.
If it's not in the range it might be in the surrounding context.
The next isInRange search will start from the first element of the set.
This should be called before searching for lines of a file, that we started to process.
|
http://www.gnu.org/software/src-highlite/api/classsrchilite_1_1LineRanges.html
|
CC-MAIN-2015-27
|
refinedweb
| 206
| 85.73
|
This is your resource to discuss support topics with your peers, and learn from each other.
12-29-2010 05:47 PM - edited 12-29-2010 05:50 PM
Here is an inwork copy of PageViewStack that allows pages to be animated in from any side. You will probably need to change it's package path to get it to compile into your project.
To use it, in your root Sprite:
public class MyApp extends Sprite { private var stack : PageViewStack; private var page1 : UIComponent = new UIComponent(); private var page2 : UIComponent = new UIComponent(); public function MyApp() { this.stack = new PageViewStack( this ); this.stack.addChild( this.page1 ); this.stack.addChild( this.page2 ); this.stage.nativeWindow.visible = true; } }
The pages (page1 and page2) would be typically derived classes from UIComponent. You can have any number of pages. The first page added will be shown by default. The PageViewStack does not get added to the display list, it is just a manager of the pages.
To set a page, say from page1 (current page) to page2:
this.stack.setPageIndex( 1, PageViewStack.RIGHT_LEFT );
To go back to page1 (index 0);
this.stack.setPageIndex( 0, PageViewStack.LEFT_RIGHT );
You can also got top/bottom and bottom/top.
The class also allows for left/right/top/bottom padding incase you have an application control bar somewhere. Once the PB provides some means of orientation changes, the class will take care of that automatically (but each page will still need to reposition the components).
You can also set the time of the transition. The default is 1.5 seconds.
This is still a work in progress. Any input is appreciated.
12-29-2010 09:49 PM
OK, so I am not really an expert on Adobe platforms yet I think I can add something to here.
1. Views, as far as I understand, are non existing in Flex 4 but are heavily integrated in 4.5 (hero) mobile app dev framework by adobe. Now, I am not sure, but it seems that qnx view are basically deep implementation of those components -- or maybe similar concept natively supported.
The idea is very simple though, you organize your UI into pages and flip those pages (views) as you go in and out along your program logic. Note that AFAIK, Adobe want people to depply integrate that into their app logic and specifically at the UI level, i.e. the under the hood omponents are desired to be in the main part of the app.
2. There are multiple solutions to the "multi-page/view/etc" app logic implementation currently available in Flex 4.
2.1. States: If you are familiar with them, states are basically differet views of the same app, but the easy part is that you can tell components to show up at which states and you can even set different styles for them which will automatically change as states are switched. Furthermore, states can be switched by just runing a line of code like: currentState=State1. They are INMHO ver similar to views (or the other way around) but Adobe insists that they are not, so let it be (they are in fact a bit different).
2.2 Using vavigator components, like Page stack, tab navigator, acardione, etc. which are just what the prev poster has schemed, they are built in and are quiet comprehensive. Look them up for detail with navigator components in flex and you would enjoy what they already offer.
I hope it helps you guys with your cool apps.
12-30-2010 05:47 AM - edited 12-30-2010 05:55 AM
(DELETED)
|
https://supportforums.blackberry.com/t5/Adobe-AIR-Development/Do-we-have-any-documentation-for-qnx-views-package/m-p/710529
|
CC-MAIN-2016-40
|
refinedweb
| 599
| 72.76
|
Deploy Boards.
To display the Deploy Boards for a specific environment you should:
Have a Kubernetes cluster up and running a Kubernetes label of
app: $CI_ENVIRONMENT_SLUGis applied to the deployments, replica sets, and pods, where
$CI_ENVIRONMENT_SLUGthe value of the CI variable. labeling. Each project will need to have a unique namespace in Kubernetes as well. The image below demonstrates how this is shown inside Kubernetes.
Once all of the above are set up and the pipeline has run at least once, navigate to the environments page under Operations > Environments.
Deploy Boards are visible by default. You can explicitly click the triangle next to their respective environment name in order to hide them. GitLab will then query Kubernetes for the state of each node (e.g., waiting, deploying, finished, unknown), and the Deploy Board status will finally appear.
GitLab will only display a Deploy Board for top-level environments. Foldered
environments like
review/* (usually used for Review Apps) won’t have a
Deploy Board attached to them.
Canary Deployments
A popular CI strategy, where a small portion of the fleet is updated to the new version of your application.
Read more about Canary Deployments.
|
https://docs.gitlab.com/ee/user/project/deploy_boards.html
|
CC-MAIN-2018-51
|
refinedweb
| 193
| 55.44
|
Eclisep 3.3 runtime options for STP.SC
This wiki is used to document all runtim options for STP service creation.
[Johnson Ma, Apr 16, 2007]
Contents
bootdelegation configuration
property
-Dorg.osgi.framework.bootdelegation=*
make sure you add this line at the end of the file (note on updating eclipse.ini on MacOS)
Why need to config bootdelegation property
Problem with try to upgrade to Eclipse 3.3
When i was trying to upgrade my dev env to Eclipse 3.3, i always got java.lang.LinkError for javax.xml.namespace.QName during run java2wsdl tool.
After tracking the class loading process, i found that QName was defined in two places: jre/lib/rt.jar and stax-api-1.0.1.jar (comes from Apache CXF plugin) And there are different versions. Both of them have been loaded to jvm during run j2w, which cased the QName link error. But why it loaded twice in Eclipse 3.3?
The reason
In the previous Eclipse release (including 3.2), it follow OSGI R3: A bundle classloader must delegate to the system classloader first.. In our stp case, that means, the QName in jre/lib/rt.jar is loaded everytime in Eclipse 3.2
However, Eclipse 3.3 release has changed to follow OSGI R4 spec. That means A bundle classloader must delegate to the system classloader last.. In our stp case, the stp.sc.cxf plugin load QName from stax-api-1.0.1.jar, which caused the java.lang.LinkError on javax.xml.namespace.QName
So we need to override the default boot delegation behavior by setting the property -Dorg.osgi.framework.bootdelegation=*
Fixed by sun
Here is the bug on sun website. It was 'fixed' However, i can't find any stax api jar without QName so far.
test options
To run the unit tests for STP.SC, please set following two properties:
- -Djaxws_kit_location
Points to the Apache CXF runtime installation directory
- -Dsca_kit_location
Points to the Apache Tuscany runtime installation directory
log options
link Setup loggin for STP.SC
mem options
-Xmx512m -XX:MaxPermSize=128M
|
http://wiki.eclipse.org/index.php?title=Eclisep_3.3_runtime_options_for_STP.SC&oldid=47229
|
CC-MAIN-2015-32
|
refinedweb
| 346
| 61.73
|
New features in Visual Basic.NET 2005
build on platform’s power and efficiency
Although Microsoft.NET languages have more or less the same facilities and power, one must be aware of the syntax and capabilities of a language to take full advantage of it. This article introduces new features of the upcoming Visual Basic.NET language that is part of Visual Studio.NET 2005.
Visual Basic is one of the most popular languages used in the software development industry. Its popularity comes from simplicity and efficiency. The new version of Visual Basic.NET builds upon these attributes and introduces the following useful new features:
- my namespace
- partial classes
- generics
- operator overloading
- using block
My namespace
The My namespace feature includes functions and properties to do a lot of complex things in a rapid manner. Think of this as shortcut syntax to get things done with less code. It groups commonly required information and functionalities for easier access. The examples below show how My namespace retrieves the current culture of the application compared to VB.NET 2003:
VB.NET 2003 Code:
VB.NET 2005 Code:
Even actions such as accessing various properties of the computer can be done easily and quickly with My namespace. The following code, for example, will return a boolean indicating the availability of the network:
Partial classes
Partial classes define a class in multiple files. This separation is useful when you want to have functionality of a class coded with different concerns and using inheritance might not be appropriate.
Partial classes are used in Visual Studio.NET 2005 for auto-generated code. When you create a windows form, for example, the Visual Studio.NET 2005 IDE creates a lot of auto-generated code. In previous versions, this code is wrapped in regions in the same source file as event-handling code. In Visual Studio.NET 2005, auto-generated code is separated from event-handling code by defining it in a separate source file as a partial class. Here’s an example of how a partial class can be defined:
The above definition defines a class with the keyword “Partial” indicating that the definition of the class is split into multiple source files.
Now we are providing more definition of our Person class in a separate source file, providing properties to expose our private fields.
Partial class can also be used to make your datasets more intelligent. The typed datasets you create in Visual Studio.NET have the partial class definition for the generated source. This enables you to add value to your typed dataset by providing functionality such as business logic by defining a partial class definition for the generated class.
Generics
Generics enable your program to adapt itself to different types. The concept of generics is used in the implementation of collections in the new framework. Let’s define a simple customer class as follows:
If we want to manipulate a collection of customer objects, a typical implementation in VB.NET 2003 would be:
The problem with this implementation is even though you wanted your collection to only handle customers, there is no way of enforcing this. To restrict your collection to handle only customers, you will need to implement a custom collection class by extending the facilities provided by the collection framework. But what if you want to implement different collections to handle different types of objects? You might end up with a lot of custom collections to handle different types of objects even though the functionality you require from these collections is the same.
This is where generics come in. They give you a way to implement a placeholder for the type and then specify what the type is. An ideal solution to the previous problem would be to provide the implementation of the collection with the type of the collection as a variable; when creating a collection we would specify what the collection should manipulate. That’s exactly the functionality of the collections provided by the System.Collections.Generic namespace in Visual Basic.NET 2005:
If you try to add a string or anything other than customer objects, the compiler will detect it as a syntax error. You can also define your own generic functionality to program to types that are not known in advance or to enable your program to work with multiple types.
The above class is defined by using the variable “T” as a placeholder. When you create an instance of GenericClass you replace the placeholder type with a real type. Once we do this, our Accept method will accept only arguments of the real type defined while instantiating GenericClass. For example:
Operator overloading
Operator overloading enables you to specify what operators such as + or – should do when invoked with objects of classes you define. For example :
The above class definition is a simple box with an area and weight as properties. We wanted to provide functionality to add two box objects and return a box with the area and weight as the total of added boxes. We have overloaded the meaning of the + operator to work with Box objects by defining how it should work. We could have defined a new method with a name to achieve this, but using operators for similar operations makes the code more readable and easy to use. To add two box objects, we simply use the + operator in a way similar to adding two numbers:
Using block
Some objects you create are very resource intensive. So a good practice is to release the resource as soon as you are finished with it. Generally when you create an object inside a method, the object will not be released until the method terminates. But what if you want an easy way to define an object as well as specify the scope of it inside a method? The using block helps you to achieve this:
In the above code, the scope of the defined con object will be limited within the using block and will be released as soon as it exits that block.
Rich and rapid
Visual Basic.NET is one of the popular languages in the .NET platform and future versions are making it richer without losing the rapid development approach for which it’s renowned. This article should help users take immediate advantage of new features that will be an integral part of Visual Studio.NET 2005 and the Microsoft.NET 2.0 platform.
Load comments
|
https://www.red-gate.com/simple-talk/development/dotnet-development/visual-basic-net-2005/
|
CC-MAIN-2022-05
|
refinedweb
| 1,074
| 54.42
|
commander
pattern matching against string based commands
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
Commander: A Haskell Library for parsing commands
This library aims to make it super easy to create and use nested commands with flags in the form of an object that is easy to traverse and run custom actions on, and easy to extend with handling for safe casting to values from their input strings.
As an example of usage (take a look in the examples folder for more) we can define commands as follows:
someCommands :: Command (IO ()) someCommands = commands $ do command "repeat" $ do help "Repeat a string n times" run $ \(Value str :: Value "value to repeat" String) (Flag n :: Flag '["n"] "times to repeat" Int) -> sequence_ $ replicate n (putStrLn str) command "calculate" $ do help "perform calculations" command "add" $ do help "add two numbers" run $ \(Value n1 :: Value "number 1" Int) (Value n2 :: Value "number 2" Int) (Flag verbose :: Flag '["v", "verbose"] "verbose mode" Bool) -> if verbose then putStrLn $ (show n1) ++ " + " ++ (show n2) ++ " = " ++ (show $ n1 + n2) else putStrLn (show $ n1 + n2) command "multiply" $ do help "multiply two numbers" run $ \(Value n1 :: Value "number 1" Int) (Value n2 :: Value "number 2" Int) -> putStrLn $ (show n1) ++ " x " ++ (show n2) ++ " = " ++ (show $ n1 * n2)
And this leads to
someCommands being a nested record of type
Command (IO ()) (where
IO () corresponds to the output from the functions you provide). This record can then be traversed and interacted with.
The novelty of this approach (compared to others I have seen, which is a non exhaustive list!) is the use of the functions input parameter types to cast-from-string and inject the appropriate values into the function safely at runtime, as well as to generate documentation. This means that we only declare the flags and values each command requires in one place, and do not execute any of the output unless all parameters are fully satisfied. These functions are then safely hidden away inside an existential type, and so we don't need any other type level magic or handling to work with the output.
Installation
Add this repository to your stack.yaml file under the packages folder, so we end up with something that looks a bit like:
` packages: - '.' - location: git: commit: abcdef123456789abcdef1234`
run
stack install.
import
Commanderinto your library.
you can run the example code by running
stack install :example1 && example1 assuming that the directory stack copies binaries to is present in your
PATH.
Documentation
if you clone this repository locally somewhere, you can use
stack haddock inside its folder in order to generate haddock documentation for it.
Disclaimer
This project is still under heavy development and could well change drastically!
|
https://www.stackage.org/package/commander
|
CC-MAIN-2017-17
|
refinedweb
| 470
| 53.75
|
getConstructor( )843798 Apr 18, 2010 5:21 PM
Hi,:
Here is a sample of the code:
LightOn class:
but they all extend of the class Event,but they all extend of the class Event,
LightOff lo = new LightOff(300);
Here is a sample of the code:
LightOn class
Event classEvent class
public class LightOff extends Event { public LightOff(long delayTime) { super(delayTime); } public void action() { //Enter hardware control code here } public String toString() { return "Light is off"; } }
And a call from main:And a call from main:
public abstract class Event implements Runnable { private long delay; //protected final long delayTime; public Event(long delayTime) { delay = delayTime; run(); } public void run() { try{ TimeUnit.MILLISECONDS.sleep(delay); }catch(InterruptedException e){ System.out.println(e + "Interrupted!"); } action(); System.out.println(this); } public abstract void action(); } ///:~
public static void main(String args[]){ String event = "LightOff"; int time = 300; Class eventClass = Class.forName(event); Constructor ctor = eventClass.getConstructor(Integer.class); //Right here I don't know what to call to get the LightOff class to start }
This content has been marked as final. Show 8 replies
1. Re: getConstructor( )EJP Apr 18, 2010 7:37 PM (in response to 843798)
Each of the classes must take an int argumentEach of the classes must take a long argument, to agree with the constructor for Event.
Class eventClass = Class.forName(event);Class<? extends Event> eventClass = (Class<? extends Event>)Class.forName(event);
Constructor ctor = eventClass.getConstructor(Integer.class);Constructor<? extends Event> ctor = eventClass.getConstructor(long.class);
//Right here I don't know what to call to get the LightOff class to startlong delay = 5555L; // or whatever
Event event = ctor.newInstance(delay);
2. Re: getConstructor( )baftos Apr 18, 2010 7:47 PM (in response to EJP)
ejp wrote:This should probably be
Constructor<? extends Event> ctor = eventClass.getConstructor(long.class);
Constructor<? extends Event> ctor = eventClass.getConstructor(Long.TYPE);
-
4. Re: getConstructor( )baftos Apr 18, 2010 10:46 PM (in response to EJP)Thanks and sorry for correcting what I thought was a typo.
I did not know this syntax is valid (since when? autoboxing?).
Now I know.
5. Re: getConstructor( )EJP Apr 18, 2010 11:10 PM (in response to baftos)Since 1.1 as far as I know. I was certainly using in the 1990s.
6. Re: getConstructor( )843798 Apr 19, 2010 4:53 PM (in response to EJP)Hmm,
This was working great, but now I am having a weird issue.
I moved the call to each Event object into it's own method and now when I compile the program I get this:
>
Note: GreenhouseControls.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
>
So if I recompile with -Xlint I get this:
>
GreenhouseControls.java:159: warning: [unchecked] unchecked cast
found : java.lang.Class<capture#532 of ?>
required: java.lang.Class<? extends tme3.Event>
Class<? extends Event> eventClass = (Class<? extends Event>)Class.forName(className);
>
There is an arrow pointing to the className in brackets on the last line.
className is a String for the class in which I am going to call, ex. LightOff
7. Re: getConstructor( )EJP Apr 19, 2010 6:21 PM (in response to 843798)That's because Class.forName() returns a Class<?>. Not much you can do about this except @SuppressWarnings("unchecked").
8. Re: getConstructor( )843798 Apr 20, 2010 3:21 AM (in response to EJP)There's a way to make the check explicit:
This way the check is actually done at that line (in the asSubclass() method) and you can avoid the ugly @SupressWarnings.
Class<? extends Event> eventClass = Class.forName(className).asSubclass(Event.class);
|
https://community.oracle.com/thread/1160690
|
CC-MAIN-2015-32
|
refinedweb
| 598
| 56.55
|
Created on 2012-05-25.06:32:49 by alex.gronholm, last changed 2014-05-22.00:13:57 by zyasoft.
This is required by the compileall module, which I need to make binary jars so I can test my ERP client on 2.7.
Renamed the issue.
I also committed the missing imp.get_magic() function, but I think I was too hasty. For one, the value should be unique to Jython. Second, there may be a good reason why the function is missing from Jython 2.5. It's highly likely that my commit needs to be reverted. However, I have no clue how to fix the compileall module then.
On further investigation I discovered that in 2.7, the compileall module reads the first 8 bytes of an existing target file and checks the magic number and the modification time. Python 2.5 does not do this. I don't know enough about class files to know if or how this applies to Jython.
compileall works when run like this within the jython27a2 REPL:
import compileall
compileall.compile_dir("src", force=1)
but it fails when run as a subprocess:
subprocess.call(['java', '-jar', jython_jar, '-m', 'compileall', src])
The reason is of course the force=1, it prevents compileall from trying to read in the magic number.
Therefore, -f will work, too:
subprocess.call(['java', '-jar', jython_jar, '-m', 'compileall', '-f', tmpdir])
Works fine now, in the ways I would assume compileall is actually used - by setuptools, pip, etc, etc - basically all the stuff we have been working on for a while. Or jython27 -m compileall
I assume this bug has just been sitting here unnoticed until now, certainly by me. Please respond if this is not the case.
|
http://bugs.jython.org/issue1896
|
CC-MAIN-2016-30
|
refinedweb
| 289
| 76.82
|
In this tutorial , we will be making a IoT Desk Traffic Light using a Dot One and a Wia button module and a few LEDS.
What you will need :
Once you have finished the tutorials above and learned all about the Dot One , you are all set to do this tutorial below.
Create a Code Project
#include <WiFi.h>
int item = 0;
// int track;
const int button = 17;
const int red = 25;
const int yellow = 27;
const int green = 32;
void setup() {
WiFi.begin();
delay(2500);
pinMode(button, INPUT_PULLDOWN);
pinMode(green, OUTPUT); //green
pinMode(yellow, OUTPUT); //yellow
pinMode(red, OUTPUT); //red
}
void loop() {
if (digitalRead(button) == HIGH ) {
item++;
delay(500);
}
switch (item) {
case 0:
digitalWrite(green, HIGH);
digitalWrite(yellow, LOW);
digitalWrite(red, LOW);
break;
case 1:
digitalWrite(green, LOW);
digitalWrite(red, HIGH);
digitalWrite(yellow, LOW);
break;
case 2:
digitalWrite(yellow, HIGH);
digitalWrite(red, LOW);
digitalWrite(green, LOW);
break;
case 3:
item = 0;
break;
}
}
You can then upload the above code to your Dot One by clicking the rocket icon and now once wired up the LED's should turn on one by one depending on button click
Now that we have successfully wrote the software for this tutorial , it's time to wire up the hardware to make the buttons turn on the LED's and behave as required.
Using 4 jumper wires connect the Dot One to the pins as specified (in above code) as shown below:
Once the connections are made, you are ready to connect the Micro USB cable and the Dot One to your computer.
Now, that we have it all wired up and coded to do as indicated, this gif represents what should be displayed once the Dot One is given power.
IOT desk traffic light is a discussion speed dial. You can join them for getting more information about it. It has tutorials available on site. Here you need to follow to learn more new techniques to complete their assignments. Make your account for posting articles and make a clear vision of it.
|
https://community.wia.io/d/99-iot-desk-traffic-light
|
CC-MAIN-2021-10
|
refinedweb
| 339
| 61.5
|
One 、find operation
MongoDB Use in find To query , By designation find The first parameter of can realize all and part of the query .
1、 Query all
Empty query document {} Will match the entire contents of the collection . If you do not specify a query document , The default is {}.
2、 Partial query
3、 Key screening
Key filtering is to return only the key values that you are interested in when querying , By designation find To achieve . This can save the amount of data transferred , It can also save the time and memory consumption of client decoding documents .
When inquiring , The value of the query document concerned by the database must be constant .
Two 、 Query criteria
1、 Comparison query
$lt,$lte,$gt,$gte,$ne and <,<=,>,>=,!= It's one-to-one , They can be combined to find a range of values .
2、 Relational query
$in Used to query multiple values of a key ,$nin Will return documents that do not match any of the criteria in the filter array . take $in And $not Combination can achieve $nin Same effect .
$or Used to do... On multiple keys or Inquire about .
3、 ... and 、 Specific types of queries
1、null Inquire about
null Not only can it match itself , It can also match documents where the key does not exist .
2、 Regular expressions
3、 Array query
$all: Matching arrays with multiple elements .
$size: Query an array of specified length .
$slice: Returns a subset of an array .
4、 Embedded document query
Four 、$where Inquire about
$where Query is MongoDB The advanced query section of , Can execute any JavaScript As part of the query , It is a supplement to other query methods .
$where The query needs to take each document from BSON Convert to JavaScript object , And then through $where To run , The process cannot take advantage of indexes , So query speed It's much slower than regular query . If it has to be used , You can use regular queries as prefilters , If you can use index, you can use index according to non $where Clause to filter , Finally using $where Tune the results . Another way is to simplify by mapping -MapReduce.
5、 ... and 、 The cursor
Cursors are very useful things ,MongoDB The database uses a cursor to return find The results of the implementation of . The client can control the final result effectively by using cursor , Like paging , Sort .
1、limit,skip and sort
limit: Limit the number of results , The limit is the upper limit .
skip: Skip the match to the front n A document , Then return to the remaining documents .skip Skipping too many documents can cause performance problems , It is suggested that .
sort: Sort documents by the specified key ,1 In ascending order ,-1 For the descending order .
2、 Advanced Query options
Packaging query : Use sort,limit or skip Further control of the final results .
Useful configuration options :
$maxscan:integer, Specify the maximum number of documents to be scanned by the query .
$min:document, The start condition of the query .
$max:document, The end condition of the query .
$hint:document, Specify which index the server uses for the query .
$explain:boolean, Get the details of query execution ( The index used , The number of results , Time consuming, etc ), Instead of actually executing the query .
$snapshot:boolean, Ensure that the result of the query is a consistent snapshot at the moment the query is executed , To avoid inconsistent reads .
Wrapping a query will wrap the query criteria into a larger query document , For example, when executing the following query :
db.foo.find({"name":"bar"}).sort("x":1)
shell The query will be sent from {"name":"bar"} convert to {"$query":{"name":"bar"},"$orderby":{"x":1}}, Not directly {"name":"bar"} Send to database as query document .
3、 Inside the cursor
Two ways to look at cursors : The client cursor and the database cursor represented by the client cursor ( Server side ).
On the server side , Cursors consume memory and other resources , So we need to release as soon as possible under reasonable circumstances . The server side causes cursor termination as follows :
1、 The cursor is automatically cleared when it completes the iteration of the matching result .
2、 When the client is out of scope , The driver sends special messages to the server , Let it destroy the cursor .
3、 Destroy over time , have access to immortal Function close cursor timeout , In this operation, the cursor must be closed after the iteration .
6、 ... and 、 summary
Use MongoDB We need to design the document structure reasonably , To meet certain specific needs . For example, randomly selecting documents , Use skip Skip a random document without adding a random key to it , Then use a random number to query the document , Random keys can also add indexes , More efficient . Reasonable choice , Reasonable design .
MongoDB Various query operation details of more related articles
- Django frame And ORM Query operation details
Django frame And ORM Query operation details Browse the catalog General operation ForeignKey operation ManyToManyField Aggregate query Group query F Query and Q Inquire about Business Django Terminal printing SQL sentence stay Py ...
- Python operation Mysql Database advanced —— Query operation details ( One )
As we have mentioned before, in Python3.x How to connect a Mysql database , And how to create a table for this database , Add, delete, and look up the data in the table . You must be right Mysql Databases and simple sql Have a certain understanding of the sentence , Actually sql Statement blog ...
- mongodb Study 04 Operation details (2)
Search for documents Filter to find db.collection.find(); Returns a subset of documents in a collection , Subset of Range from 0 Document to the entire collection ; db.collection.findOne(); Returns a filtered document ; ...
- mongodb Study 03 Operation details
Inserted into the document db.test.insert({"name":"jinks"}); Batch insert db.test.insert([{}, {}, {}]); A batch insert ...
- mongodb Study 05 Operation details (3)
Advanced Query options // Simple query var cursor = db.foo.find({"foo" : "bar"}) // Encapsulating queries var cursor = db.f ...
- Django And ORM Query operation details
Browse the catalog General operation ForeignKey operation ManyToManyField Aggregate query Group query F Query and Q Inquire about Business Django Terminal printing SQL sentence stay Python Call in script Django Environmental Science Other exercises ...
- hibernate( 7、 ... and ) hibernate In the inquiry way detailed explanation
preface Previous pair hibernate Queries in are always confused , I don't know what's in it . Because of the lack of summary . Before reading this article , What you should know is some query operations in the database , Multi table query, etc , If you don't understand , You can go and have a look first MySQL Count ...
- [Android Rookie zone ] SQLite Operation details --SQL grammar
The article is completely excerpted from : Peking blue bird [Android Rookie zone ] SQLite Operation details --SQL grammar : SQLite The library can solve ...
- windows phone 8.1 Development SQlite Detailed explanation of database operation
Original text : This article will share with you WP8.1 in SQlite Basic operation of database :( Finally, there is the source code of the whole example )( Hope to pass this ...
Random recommendation
- Double and double The difference between
1.Double yes java Defined classes , and double Is a predefined data type (8 One of the species )2.Double It's like being right double Type of packaging , There are many ways to do it String To double Transformation , And get all kinds of d ...
- Quartz Application of framework
This article will briefly introduce in the absence of Spring When .. How to use Quartz... Skip here Quartz Other introductions of . If you want to know more about Quartz, You can click to download Quartz Help document for . Quar ...
- Another little regular replace
var a = ""; var b = " ...
- var obj = {};var obj2 = [];var obj3;
<script> var obj = {}; console.log(obj); var obj2 = []; console.log(obj2); var obj3; console.l ...
- sql The batch 、 Gain from growth 、 Business 、 Big text processing
The batch Batch execution is required sql sentence ! demand : Save information in bulk ! Design : AdminDao Public void save(List<Admin list){ // Now in this way // loop // Protect ...
- Smart.coder Daily Scrum Meeting 08
Standing conference content : Improve the search function of small programs , I'm going to consider the function of automatic information input classification . 1. Standing meeting photos : 2. Mission board 3. Burnout figure
- ERP Regional management in China
Regional management Regional management mainly realizes the addition of regional data . edit . see . Enable . Disable and other functions , In addition, it also contains the encapsulation of region selection control . Business function point : Regional data view : The area list is displayed in a tree , Add provinces to the list . City . District . county . Township icon . Region selection control : choice ...
- use JavaScript Write a simple calculator
This article USES the js Realized a simple add . reduce . ride . Except the calculator . Here are css Part of the code : *{ padding:0; margin:0; color: #424242; } .outer{ width:300px; ...
- qml: Custom buttons -- Imitation QML Own control ;
import QtQuick 2.0 Rectangle { id: btn; width:; height:; radius:; border.color: "#A3A3A3"; ...
- Python Medium string Module learning
Code based , Believe there is python I can understand the basic : ? [python] view plain copy >>> import string >>> string.a ...
|
https://chenhaoxiang.cn/2021/06/20210604141428247k.html
|
CC-MAIN-2022-05
|
refinedweb
| 1,507
| 55.44
|
Hi, > I posted new ones. > - > (changes in page_cgroup) > (I'm not sure this gets Ack or Nack. but direction will not change.) > > Then, please tell me if you have new troubles with new ones. > Or if you have requests. > Major changes are > > - page_cgroup.h is added. > - lookup_page_cgroup(struct page*), lock_page_cgroup() etc.. is exported. > - All page_cgroup are allocated at boot. > - you can use atomic operation to modify page_cgroup->flags. Good new! > One concern from me to this bio_cgroup is that this increases size of > +#ifdef CONFIG_CGROUP_BIO > + struct list_head blist; /* for bio_cgroup page list */ > + struct bio_cgroup *bio_cgroup; > +#endif > struct page_cgroup...more 24bytes per 4096bytes. > Could you reduce this ? I think 8bytes per memcg is reasonable. > Can you move lru to bio itself ? I have a plan on getting rid of the blist after your work is done, whose design will depend on that all page_cgroups are preallocated. I also think the size of bio_cgroup can be reduced if making bio_cgroup contain a bio-cgroup ID instead of the pointer. Just wait! :) > This makes page_cgroup to be 64bytes from 40bytes and makes it larger > than mem_map.... > After bio_cgroup, page_cgroup, allocated at boot, size on my 48GB box > will jump up. > 480MB -> 760MB. > > Thanks, > -Kame
|
http://www.redhat.com/archives/dm-devel/2008-September/msg00195.html
|
CC-MAIN-2015-18
|
refinedweb
| 201
| 77.94
|
Nov 21 2016 11:43 AM
Nov 21 2016 11:43 AM
Looking for some insight on whether or not we will be able to add our Managed Paths in SharePoint Online? Unless I am missing something. Anyone?
Nov 21 2016 12:21 PM
Nov 21 2016 12:21 PM
Nov 21 2016 07:57 PM
Nov 21 2016 07:57 PM
Given MPs are Web Application-wide (all tenants on your farm would be impacted) and MPs impact performance, it's doubtful we'll see something like this ever in a multi-tenant scenario without some significant rearchitecture to SharePoint.
Nov 21 2016 10:15 PM
Nov 21 2016 10:15 PM
Nov 25 2016 12:46 PM
Nov 25 2016 12:46 PM
Aug 01 2018 10:45 AM
Aug 01 2018 10:45 AM
Hi, yes I was having this same issue myself, it's 2018 now, does anyone know if this issue has been resolved? I was spending ages online looking at the Admin Centers and thinking they look nothing like mine.
Mar 10 2019 01:37 PM
Mar 10 2019 01:37 PM
Adding new Managed paths are still not available in SPO. But there is now by default option to create sites under "/sites/" or under "/teams/". This will help to solve the common scenario of seperating out team sites from the rest. In SPO admin site there is option to select the default path to be used for while creating new team sites.
Apr 02 2019 01:02 AM
Apr 02 2019 01:02 AM
@Jason Hunt I don't think it will be available in the near future. As Trevor said, Managed Path are related to Web Application and your tenant is sharing his Web Application with lots of other tenants.
Jun 25 2019 04:59 PM
Jun 25 2019 04:59 PM
@Deleted
Technically that makes sense, but logically it does not to me. I wish we could re-map our paths so they represent the security characteristics of our sites. For example, something like:
/intranet/ (internal publishing sites with read-only for all & edit for assigned staff)
/personal/ (self-service sites such as Microsoft Teams, Planner sites etc)
/extranet/ (for internal/external authenticated collaboration)
/teams/ (for internal, organizational collaboration sites)
/sensitive/ (CJIS, HIPAA, legal docs, budget)
/anonymous/ (for publishing)
Should be made easy to provide clarity.
Jun 25 2019 05:12 PM
Jun 25 2019 05:12 PM
Jun 25 2019 05:29 PM
Jun 25 2019 05:29 PM
Thanks, I'll look into that as an option; I appreciate your tip.
I was thinking of namespaces that inherit certain properties, and are visible to people where they might expect to see what distinguishes one location from another.
Jun 25 2019 10:35 PM
Jun 25 2019 10:35 PM
Sure, I can understand the need here (and previously used it a lot for SP on premise), but as already said, I don't see it reasonable to have this new feature in SPO in the next months. The cloud having its limitation, we can't really have HNSC too :)
Moreover, using this kind of classification directly in the Url may point to misunderstanding too. We all know that users may change the security, break some rules/guidelines/governance and then location of your site wont really match its current configuration/usage.
If you really need to have such separation, you can still prefix all your site collections' Url with anything you want, like: int- (for intranet), per- (for personal), etc.
Dec 08 2019 11:56 AM
You can set the default Managed Path in the admin center.
But you can only choose /Team/ or /Sites/
We should pest MS to allow us more flexibility with this :)
May 23 2021 08:05 AM
|
https://techcommunity.microsoft.com/t5/sharepoint/managed-paths-in-sharepoint-online/td-p/31140
|
CC-MAIN-2022-40
|
refinedweb
| 634
| 61.09
|
The either standard 8-bit strings or Unicode strings. Translations instances can also install themselves in the built-in namespace as the function _().
If localedir is not given, then the default system locale directory is used.6.2 If languages is not given, then the following environment variables are searched: $LANGUAGE, $LC_ALL, $LC_MESSAGES, and $LANG. The first one returning a non-empty value is used for the languages variable. The environment variables can contain a colon separated list of languages, which will be split..
As seen below, you usually mark the strings in your application that are candidates for translation, by wrapping them in a call to the function _(), e.g.
print _('This string will be translated.')
For convenience, you want the _() function to be installed in Python's builtin namespace, so it is easily accessible in all modules of your application.
|
http://docs.python.org/release/2.0.1/lib/node145.html
|
CC-MAIN-2013-20
|
refinedweb
| 146
| 64.41
|
I vote for making the low level shader API public
I'd love to see MonoGame start dropping its strong ties to XNA, use its own namespace and start adding support for newer graphics APIs (DX11&12 mainly). Still being stuck on DX9 is a huge downside when wanting to develop 3D stuff.
There are some parts of MonoGame that do use a MonoGame.Framework namespace, and a namespace change has been discussed. The downside is that it would be a massive breaking change that would affect almost every source file in everyone's code.
MonoGame.Framework
There have been discussions and some movement on this. We have to come up with a feasible plan that caters for DirectX 12, Vulkan and Metal.
I gathered from other threads where that topic came up that you plan to do it eventually, and since there is no alternative other than not doing it at all, I was wondering why you guys keep postponing it
For the namespace issue: would it be possible to write a project converter?
Because I would also like MonoGame to move away from using the XNA namespace.
I would like that as well, I teach programming and MonoGame to high school students and some students always think that it's strange that the namespaces start with Microsoft when Microsoft is not affiliated with MonoGame.
We will add it to the list for consideration for the 4.0 release. Hopefully the changes to the dev's projects would simply be Replace in Files of "Microsoft.Xna.Framework" to "MonoGame.Framework", and rebuilding content. We would have to adapt our content loaders to cope with existing content that has the "Microsoft.Xna.Framework" typenames as well, since we cannot realistically expect everyone to rebuild all content, especially for released titles.
can I add to the wishlist NOT modifying the namespace?
The amount of files I'd have to change is really really big, not to mention I could no longer compile both projects with XNA and MonoGame. (I still find more easy to use the old XNA content and I just compile wiht MonoGame when releasing), would introduce incomptabilities between WP7 (where software still can be shipped) and also previous versions of MonoGame (in example, WP8 will probably soon be phased out, but I still have to produce binaries for it).
At some point MonoGame will no longer be just XNA. How we make that jump to our own namespaces will be tricky and possibly messy... but it has to happen eventually.
Still hoping to find some one line change we can do to have the C# compiler know Microsft.Framework.XNA means MonoGame.Framework.
Microsft.Framework.XNA
It's only under consideration for the 4.0 release, and we have to take into account that there are still devs using XNA today and sharing the code with MonoGame projects. I believe that one of the reasons MonoGame has succeeded where other XNA implementations fell by the wayside was that we used the Microsoft namespace. If Miguel de Icaza had decided to use a Mono namespace in the Mono implementation of the .NET Framework, I don't think it would still be around today.
So changing the namespace is a large change, and could potentially alienate some devs, so it is not something we will do without lots of careful thought about all the potential issues it could raise.
Couldn't we just have a compiler statement like
#if MG
namespace MonoGame
# else
namespace Microsoft.Xna
# endif
That way we can choose the framework we want to work with.
That might work for your project, but we're not going to ask everyone to do that in every source file in their project. And not all cases can be handled with a simple conditional compile statement like that.
If anyone wants to talk about the namespace rename further lets take that to the existing issue on GitHub:
Type forwarding might be able to help us with the namespace change. We can just forward the old MS types to the new MG ones.
I hesitate between New networking APIs with support for Steam/GameCenter/GooglePlay/etc.AndAutomatic live reloading of content in running gameConcerning the second one, did you mean something like datastreaming possibility as well with some threadsafe methods and members ? If so i choose this one.
Just a thought maybe you can get some ideas from were XNA 5.0 would be heading. If it had been made for c# instead of c++ and one up them.
the dx toolkit its walbourn and hargreaves at it again
It might be a great place to look to find a starting point for hull shaders and such.
New networking APIs with support for Steam/GameCenter/GooglePlay/etc.
Shader compiling for OSX and LinuxWe're starving over here
For now you you can compile shaders on a remote windows server using a content pipeline extension that @dellis1972 wrote (link). He has a server set up for this that you can use, which is pretty awesome Thanks dellis!
WebGL?
Not something I specifically would like, but notice some start in the source repo.
|
http://community.monogame.net/t/monogame-feature-wishlist/6850?page=3
|
CC-MAIN-2017-39
|
refinedweb
| 860
| 70.53
|
Oscommerce sort products attributes size ty
I need an Android app. I would like it designed and built.,
...change the default category product sorting to "Besteller". This means the most sold products at the top of the category and the less sold products at the end. I found a tutorial on how to do it, but I cannot do it myself: [kirjaudu nähdäksesi URL:n] There need to be changes in the backend as well as in the frontend
import search filter large json file . search edit export data in many ways xls pdf etc.. will provide sample of small file and example data inside it once we discuss. winner of this project who place best bid . thanks
Combine image sprites for a website from GX Metrix today now//:[kirjaudu nähdäksesi URL:n]
Need someone who can help with matching two different sheets in excel i.e. GDP growth rates for specific countries in specific years (in one sheet) and matching this with a new column ''GDP Growth'' in a sheet with premiums for M&A-transactions. you
In the 'Shop' page I need to change the two images for CANNOR and EPIDERMA. In the Epiderma shop page I need the pictures to all the same size.
I need you to write a research article.
Hi Freelancers, i require a employee db to be created on my sql for a small sized office. Further details will be shared when i award the deal. Regards
Hello i need somebody that creates an app to filter/sort matches on Tinder by distance. For Android or Pc. Output should be the name of the match. Ability to chat within the app not necessary. Maybe more functions requested on later projects....
Need help finishing a WP Theme developed with bootstrap4 - SASS
I need you to develop a graphic design for me. I would like this graphic to be developed in C++ using Glut.
I want to create Script for Sort phone numbers according to their operator any language type but just need to make this work
|
https://www.fi.freelancer.com/job-search/oscommerce-sort-products-attributes-size/
|
CC-MAIN-2018-43
|
refinedweb
| 342
| 73.58
|
In this section, you will learn how to create human face using Graphics. A Graphics provides contexts that allow an application to draw onto components that are realized on various devices, as well as onto off-screen images. The Graphics class provides several methods through which we have given different shapes to eyes, nose and mouth.
Here is the code:
import java.awt.*; import java.applet.*; public class HumanFace extends Applet { private int mouseX, mouseY; private boolean mouseclicked = false; public void init() { } public void paint(Graphics g) { g.drawOval(40, 40, 120, 150); g.drawOval(57, 75, 30, 30); g.drawOval(110, 75, 30, 30); g.fillOval(68, 81, 10, 10); g.fillOval(121, 81, 10, 10); g.drawLine(100, 100, 100, 117); g.fillRect(60, 139, 80, 10); if (mouseclicked) { g.clearRect(60, 139, 80, 10); g.drawArc(70, 100, 60, 60, 0, -180); mouseclicked = false; } } public boolean mouseDown(Event e, int x, int y) { mouseX = x; mouseY = y; mouseclicked = true; repaint(); return true; } }
applet.html:
|
http://www.roseindia.net/tutorial/java/swing/createHumanFace.html
|
CC-MAIN-2015-06
|
refinedweb
| 167
| 69.58
|
Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Being Included5:42 with Jason Seifer
One thing that’s really neat about the include method when using a module is that it gives us a way to hook in to that behavior and do something when a module is included in a class. We can use this to further extend the functionality in our modules. For example, when a module is included in a class, we could use that to run methods, write methods, or include other modules.
Code Samples
First, we modify our
Fetcher module to have an
included class method. This method defines an attribute on the class it is included in called
fetch_count.
module Fetcher def self.included(klass) attr_accessor :fetch_count end
The
fetch method is then modified to say how many times the fetch count has occurred. The
||= operator is called the conditional assignment operator. It conditionally sets the value of
@fetch_count to 0 if we haven't accessed it yet.
def fetch(item) @fetch_count ||= 0 @fetch_count += 1 puts "[#{@name}, Fetch count: #{@fetch_count}] I'll bring that #{item} right back!" end end class Dog include Fetcher def initialize(name) @name = name end end dog = Dog.new("Fido") dog.fetch("ball") dog.fetch("toy")
Now, when we create a new
Dog instance and run the
fetch method, we get the following output:
[Spot, Fetch count: 1] I'll bring that ball right back! [Spot, Fetch count: 2] I'll bring that toy right back!
This
fetch_count variable is specific to each
Dog instance:
dog2 = Dog.new("Spot") dog2.fetch("ball") dog2.fetch("toy")
So running that produces the following output:
[Fido, Fetch count: 1] I'll bring that ball right back! [Fido, Fetch count: 2] I'll bring that toy right back! [Spot, Fetch count: 1] I'll bring that ball right back! [Spot, Fetch count: 2] I'll bring that toy right back!
- 0:00
One thing that's really neat about the include method when using a module
- 0:04
is that it gives us a way to hook into that behavior and
- 0:08
do something when a module is included.
- 0:11
We can use this to further extend the functionality in our modules, for
- 0:16
example, when a module is included in a class we can use that to run methods,
- 0:22
write methods, or even include other modules.
- 0:26
Let's see how included works now using workspaces.
- 0:32
Okay, so here I am in a workspace and I've created a new file called included.rb.
- 0:38
And the content of included.rb,
- 0:41
are just from the fetcher.rb that we just had, and
- 0:46
all it includes is the fetcher module, the dog class,
- 0:51
and an initialization of a new dog instance right here called Fido.
- 0:57
And he is going to fetch a ball and a toy.
- 1:01
Let's just go ahead and run it and see what happens.
- 1:05
Okay, so let's go ahead and write the included method.
- 1:11
Now we write the included method by calling included and the word ends.
- 1:20
So it's just another method and once we give it the specific name called included.
- 1:26
It automatically runs for us.
- 1:28
However, this is going to be a little bit different then every method we've seen so
- 1:31
far because It is a class method.
- 1:36
So just like in the math module where every item that we ran
- 1:42
was a class method, with square root, cosine, and all that.
- 1:47
Same thing happens with the included method.
- 1:52
This runs on the class.
- 1:54
And it runs automatically when a module is included in a class.
- 1:59
So let me save the file and lets see what happens when we run it.
- 2:01
It's gonna give us an error and we'll see how to fix it.
- 2:05
So it says wrong number of arguments one through zero there's an argument error.
- 2:10
That means this method requires an argument.
- 2:16
Now the argument that goes into the included method
- 2:19
is the class in which the module is included into.
- 2:25
So in this case, when we include the Fetcher module in the dog class,
- 2:30
the dog class gets sent in as the argument to the included method.
- 2:35
Which means we have to account for that.
- 2:38
Now normally, we could name it something like class.
- 2:41
But that's a reserved word in Ruby.
- 2:44
So, conventionally, we can call it class or base or something like that.
- 2:48
But let's just stick with class right now, even though it's misspelled.
- 2:55
And for right now we'll just print something to the screen saying,
- 2:58
class has been included.
- 3:00
So I'm gonna save that and clear the screen on the bottom and run this again.
- 3:07
And we'll see dog has been included.
- 3:11
Okay, so this comes down here, and
- 3:14
as soon as this method is included, this code gets run.
- 3:19
Now because this method is run in the context of a class method,
- 3:24
we can call other class methods, inside of this method.
- 3:29
So that sound a little strange but you know how we write add or
- 3:33
accesor when we want to have some sort of attribute, like right here,
- 3:36
attr_accessor fetch_count.
- 3:41
That's actually a class method.
- 3:44
And since it is, we can move it out of there, and into the fetcher module.
- 3:53
Now, we have access to this variable called fetch_count.
- 3:59
So let's go ahead and print it out when we fetch an item.
- 4:08
And what we'll do first is say fetch_count,
- 4:12
we're gonna set that conditionally equal to 0.
- 4:17
And then increment it by one.
- 4:19
So what's gonna happen is as soon as this fetch method is called after
- 4:24
being mixed into whatever class, if fetch_count has not been accessed yet
- 4:30
we set it to zero and then increment it by one and then run this.
- 4:35
And say okay we're gonna display the count,
- 4:37
and we'll bring the item right back.
- 4:39
So now I'm gonna clear my screen, and we are going to run this again.
- 4:42
And we can see we have one and two which is the fetch count.
- 4:47
That's not very descriptive, so let's go ahead and write the name right here.
- 4:52
Name, Fetch count.
- 4:56
Okay, so now Fido will display his name each time we call this fetch method.
- 5:04
So all right, we have Fido, he's got a fetch count of one.
- 5:07
And then the second time it's run it got a fetch count of two.
- 5:13
And this is going to be specific to each instance, so we could create another one,
- 5:17
say dog2.fetch ball, dog2.fetch toy.
- 5:24
And if we were to save this the adder accessory is created individually for
- 5:29
each dog object.
- 5:32
So now we see Fido has a fetch count of one and Spot has a fetch count of two.
- 5:36
And again, if we had another class,
- 5:38
we could just mix in this fetcher module to that as well.
|
https://teamtreehouse.com/library/ruby-modules/include-and-extend/being-included
|
CC-MAIN-2018-05
|
refinedweb
| 1,316
| 80.82
|
Simple Made Easy
Recorded at:
- |
-
-
-
-
-
-
Read later
Reading List
- Download
- MP3
- |
- Android app
Summary
Rich Hickey emphasizes simplicity’s virtues over easiness’, showing that while many choose easiness they may end up with complexity, and the better way is to choose easiness along the simplicity path..
Strange Loop is a multi-disciplinary conference that aims to bring together the developers and thinkers building tomorrow's technology in fields such as emerging languages, alternative databases, concurrency, distributed systems, mobile development, and the web.
Sponsored Content
Key Takeaways
- We should aim for simplicity because simplicity is a prerequisite for reliability.
- Simple is often erroneously mistaken for easy. "Easy" means "to be at hand", "to be approachable". "Simple" is the opposite of "complex" which means "being intertwined", "being tied together". Simple != easy.
- What matters in software is:.
- The benefits of simplicity are: ease of understanding, ease of change, ease of debugging, flexibility.
- Complex constructs: State, Object, Methods, Syntax, Inheritance, Switch/matching, Vars, Imperative loops, Actors, ORM, Conditionals.
- Simple constructs: Values, Functions, Namespaces, Data, Polymorphism, Managed refs, Set functions, Queues, Declarative data manipulation, Rules, Consistency.
- Build simple systems by:
- Abstracting - design by answering questions related to what, who, when, where, why, and how.
- Choosing constructs that generate simple artifacts.
- Simplify by encapsulation.
Show notes
Simple vs. easy
- 1:09 "Simplicity is a prerequisite for reliability". - Edsger W. Dijkstra
- 1:23 We need to build simple systems if we want to build good systems.
- 1:27 There is not enough focus on building simple systems.
- 2:02 The roots of "simple" are "sim" and "plex", and means "one twist". The opposite, which would be complex, is "multiple twists" or "braided together".
- 2:30 The central point of the talk is seeing software as being folded together or not.
- 2:37 People usually interchange "simple" with "easy".
- 2:54 The latin origin of "easy" is the root of "adjacent", which means "to lie near" and "to be nearby".
- 3:28 Addressing multiple dimensions is important in software design.
- 3:34 Simple things are those which have one role. They fulfill one task, they have one objective, they cover one concept.
- 3:56 Simple things may be one dimension of a multi-dimensional problem they attempt to solve.
- 4:02 Simple things are focused, they do not address multiple issues.
- 4:12 Simple does not mean one of a kind. An interface does not have to have only one method to be simple. Cardinality does not matter here. What is important is not to have interleaving of issues.
- 4:49 Simplicity is objective, it can be probed.
- 5:16 The origin of "easy" implies "nearness". Something that is near can be easily touched or grabbed.
Simplicity vs. easiness in software development
- 5:58 In software development, easy means being near to our understanding, being in our skillset, being familiar.
- 6:20 Easy is overrated in the software industry. "Can I get this running in 5 seconds?" It does not matter if the result is a large ball of mud. All it matters is to be done quickly.
- 7:03 All that is new is somewhat unfamiliar. Do not avoid it even if it is harder to grasp or do at first.
- 7:14 People usually feel uncomfortably to say about something that it is beyond their capabilities.
- 8:17 Easy is a relative term. Something may be easy for someone and difficult for someone else.
- 8:44 Many times, developers say about some that is simple, but they mean easy, because they mean it is something they are familiar with.
- 9:05 The distinction between simple and easy is relevant when dealing with software constructs and artifacts.
- 9:36 The attributes of an artifact are how it runs, what's the performance, how it can be changed over time. These attributes are not the original construct (code).
- 10:06 People focus too much on the construct, on how easily they can write something or how easily is to replace one developer with another, considering just the familiarity of the tools used, not the simplicity or complexity of the code the new developer needs to deal with.
Why simplicity matters in software development
- 11:36 We should ask ourselves these questions:.
- 12:34 "We can only hope to make reliable those things we understand". And there is usually a tradeoff. When evolving a system, making it more extensible and dynamic, it may become harder to understand and decide if it is correct.
- 13:24 People can juggle only a few things at a time, a small number. The same with the number of things one can think of at one time. That becomes even harder when things are intertwined, because one cannot reason about them in isolation.
- 13:45 Intertwining raises complexity combinatorially.
- 14:35 To be able to change existing software one needs to understand it and decide how and where to apply changes. If one cannot reason about a program, he can make those decisions.
- 15:45 Q: What happened to every bug out there? A: it passed the type checker, and it passed all tests.
- 16:08 Having tests should not encourage someone to change code without being careful.
- 17:35 Only people running very short races can use their maximum speed from the beginning of the race. Some attempt to cheat life by firing the starting gun every 100 yards and call it a new sprint.
- 18:08 Ignored complexity will slow people down over time.
- 18:50 If one chooses easiness, things move fast but accumulated complexity will kill the project over time. If simplicity is chosen, the project starts slower because one has to think things over.
- 19:35 Easy things can be complex. There can be complex constructs that are succinctly described, familiar, available and easy to use. That is incidental complexity.
- 21:31 The benefits of simplicity are: ease of understanding, ease of change, ease of debugging, flexibility.
- 22:35 We can make things easier by bringing them at hand, by becoming familiar through learning.
- 23:19 We can’t suddenly change our brain to grasp something complex. We need to simplify complexity so we can handle it.
- 24:24 Because we are limited in how many balls we can juggle in the same time, we need to decide how much incidental complexity vs. problem complexity we want.
- 27:35 "LISP programmers know the value of everything and the cost of nothing."
- 28:08 Programmers like to emphasize only the benefits of a new new tool or method, but they rarely mention the downsides or the tradeoffs.
- 28:50 Complex: state, objects, methods, vars, inheritance, switch, matching, syntax, imperative loops, actors, ORM, conditionals, inconsistency. Simpler: values, functions, namespaces, managed refs, polymorphism, data, set functions, queues, declarative data manipulation, rules, consistency.
- 31:36 "Complect" means to interleave, to entwine, to braid. Complect results in bad software.
- 33:08 Complect means to braid together. Compose means to place together. Composing modular components is not simple if the modules are highly interconnected.
- 34:30 Simplicity enables partitioning (horizontal separation between components) and stratification (vertical separation).
- 35:40 State is easy but introduces complexity because it intertwines value and time. State intertwines everything it touches directly or indirectly, and it is not mitigated by modules and encapsulation.
- 38:00 vars or refs do not make state simpler.
Constructs that generate complex artifacts
- 39:27 The following constructs are complex because they intertwine ...:
- State - everything it touches
- Object - state, identity, value
- Methods - function and state, namespaces
- Syntax - meaning, order
- Inheritance - types
- Switch/matching - multiple who/what pairs
- Vars - value, time
- Imperative loops - what/who
- Actors - what/who
- ORM - OMG
Conditionals - the rest of the program
- 42:58 One can better write sophisticated systems with simpler tools that let one focus on the system rather the constructs of the language or tool.
Constructs that generate simpler artifacts
- 43:50 The following constructs are simpler:
- Values - use final, persistent collections
- Functions - use stateless methods
- Namespaces - use a language with good support for namespaces
- Data - use maps, arrays, sets, XML, JSON, etc.
- Polymorphism - through protocols, type classes
- Managed refs - Clojure, Haskell
- Set functions - via libraries
- Queues - via libraries
- Declarative data manipulation - via SQL, LINQ, Datalog
- Rules - via libraries or natively in Prolog
Consistency - through transactions or values
- 47:22 One needs to learn to live with environmental complexity: CPU, memory, inherent complexity related to implementation (GC, for example), etc.
- 49:05 Programming is not about typing on a computer keyboard, it is about thinking.
How to build simple systems
- 49:17 Build simple systems by:
- Choosing constructs that generate simple artifacts
- Abstracting - design by answering questions related to what, who, when, where, why, and how
- "I don't know; I don't want to know." - simplify by encapsulation.
- 50:38 Answering What
- What do we want to accomplish?
- Use the constructs available - interfaces, protocols, type classes - to create sets of functions, and make them abstractions.
- Give them names.
- They are specifications, not implementations.
- Make them small.
- Use polymorphism to keep them small.
- Create interfaces at this point not implementations, to avoid introducing complexity.
- Let how is to be done to be solved later by yourself or someone else.
- 52:40 Answering Who
- Define the data or entities your abstractions are going to use.
- When building larger components, pass the subcomponents as arguments. Do not hardwire them into their parents.
- Build with more components rather than fewer.
- Do not complicate a component by getting into the details of a subcomponent.
- Do not complicate an entity with the details of another entity.
- 53:46 Answering How
- This is where implementation details are fleshed out.
- Use the polymorphism defined earlier as much as possible.
- Isolate an implementation as much as possible to avoid tying it up with others.
- 54:40 Answering When, Where
- Avoid introducing complexity by tying things together.
- Avoid connecting objects directly by using queues.
- 55:32 Answering Why
- Avoid introducing complexity when implementing policies and rules.
- Rules tend to increase complexity through constructs such as conditionals, flow control, etc.
- Try using a declarative or a rule system to keep things simple.
- 56:06 Information is simple. Keep it simple. Don’t use an object to handle information. That’s not what objects were meant for. We need to create generic constructs that manipulate information. You build them once and reuse them. Objects raise complexity in that area.
- 57:00 If you have a map, use a map construct. Don’t create an object for it. Leave data as data. Do not tie data logic to its representation. Avoid ORM.
- 57:20 Choose simple tools. Write simple stuff. Simplify other people’s work by disentangle it.
- 58:10 Simplicity is a choice. We have a culture of complexity. Avoid tools (languages, constructs, etc.) that generate complex outputs. Simple != easy. Look for complexity and avoid it. Reliability tools - testing, refactoring, type systems - are good but secondary. They do not enforce simplicity. They are just a safety net.
- 59:53 Make simplicity easy by:
- Using constructs that generate simple artifacts.
- What matters are the artifacts not the authoring tools.
- Simplify the problem space before starting.
- Use abstractions aiming to simplification. Design a bit upfront.
- 1:01:15 "Simplicity is the ultimate sophistication." - Leonardo da Vinci.
Languages, tools and projects mentioned
People mentioned
- Alan Perlis
- Constantin Brancusi
- Grady Booch
- Edsger W. Dijkstra
- Erik Meijer
- Gerald Jay Sussman
- Leonardo da Vinci
See more presentations with show notes...
Citations
by
keynan pratt
Is there any scientific basis for this inference? Can you point me to the literature?
Thanks
How to watch this?
by
Owls Rutherford
x
by
remco greve
Pseudointellectualism
by
It's Me Yo
That crap about the starting pistol, about rebuilding stuff that has been done already may well be applicable to the author's projects, to the author's experiences. But I would posit this: how about you've just been working in bad company, and in a bad company. Because I do t experience the same stuff you do. The key difference is that just because I have experienced it one way, it doesbt mean I am going to pretend that my personal experience is the norm, or should be a basis for a new religion. I can look at it objectively and think to myself: well it looks like this stuff works and this stuff probably doesn't work... in this particular situation.
The thing that irks me with a lot of Medium posts and talks like this is that it's usually a relatively young protagonist who has a limited amount of experience to draw on but insists (not thinks, not hypothesises) but insists they have the answers. These kind of arrogant statements produce a revolution one in every hundred. That's not to say discussion isn't valuable, but of there were less arrogance and more objectivity we would spend less time chasing false idols and more time making progress.
Re: Pseudointellectualism
by
Shalok Shalom
How is Rich Hickey, one of the most respected and quoted programmers on earth, a relatively young protagonist who has a limited amount of experience to draw on?
And how is this based on his bad experience without any evidence?
Did you even watched the whole video?
Transcript of this talk is available
by
Andy Fingerhut
Hello stranger!You need to Register an InfoQ account or Login or login to post comments. But there's so much more behind being registered.
Get the most out of the InfoQ experience.
Tell us what you think
|
https://www.infoq.com/presentations/Simple-Made-Easy
|
CC-MAIN-2018-39
|
refinedweb
| 2,252
| 58.48
|
)
gulpfile.js (partial)
gulp.task("build", function(){ return browserify({ entries: ["./src/js/index.js"], extensions: [".js", ".jsx"] }) .transform(babelify.configure({ presets : ["es2015", "react"] })) .bundle() .pipe(source("bundle.js")) .pipe(gulp.dest("./build")) ; });
We will then create index.html in html folder with following content.
html/index.html
<!DOCTYLE html> <html> <head> <title>Babel + ReactJS Test</title> </head> <body> <div id="main"/> <script src="bundle.js"></script> </body> </html>
We will embed a ReactJS component in the main div above. Now we will create index.js in js folder which will create a ReactJS component and add it to the main div.
js/index.js
import React from "react"; import ReactDOM from "react-dom"; import MainView from "./views/MainView" var mainView = React.createElement(MainView,{name:"Stranger"}, null); ReactDOM.render(mainView, document.getElementById("main"));
Note that MainView is passed name attribute with “Stranger” value. Let’s now create the ReactJS Component, MainView in views folder.
views/MainView.jsx
import React from "react"; export default class MainView extends React.Component { constructor (props) { super(props); this.state = { name : props.name } } onSetName() { this.setState({ name : this.refs.nameTxt.value }) } render() { return <div> Hello {this.state.name} ! <br/> Enter Name : <input type="text" ref="nameTxt" /> <button type="button" onClick={this.onSetName}>Set Name</button> </div> } }
Note that when you write ReactJS component in ES6, you do not override setState method, – you create this.state object in the constructor, if you want to initialize the component state. In the above example, we add name to state and initialize it with the name attribute/property passed to the component. Recall that in the index.js, we have passed name=”Stranger” to the MainView component.
In the render method we create a greeting string, using name stored in the state and also create a text box and a button to set name. onClick handler of the button is set to onSetName method of the component. So if you type something in the text box and click Set Name button then you would expect greeting to change with the content of the text box. However if you run this example (run gulp and browse to) and try to set name, you will see that greeting is not updated with the name. In the JS console you would see following error :
Uncaught TypeError: Cannot read property ‘setState’ of null
The reason is that ReactJS component is compiled to a new JS object with method names as keys and method body as values – here the code generated for our MainView component :
var MainView = function (_React$Component) { _inherits(MainView, _React$Component); function MainView(props) { _classCallCheck(this, MainView); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(MainView).call(this, props)); _this.state = { name: props.name }; return _this; } _createClass(MainView, [{ key: "onSetName", value: function onSetName() { this.setState({ name: this.refs.nameTxt.value }); } }, { key: "render", value: function render() { return _react2.default.createElement( "div", null, "Hello ", this.state.name, " !", _react2.default.createElement("br", null), "Enter Name : ", _react2.default.createElement("input", { type: "text", ref: "nameTxt" }), _react2.default.createElement( "button", { type: "button", onClick: this.onSetName }, "Set Name" ) ); } }]); return MainView; }(_react2.default.Component);
As you can see, setName method becomes value of a field setName in the object passed to _createClass method. ‘this’ scope in this event handler method is n0t the same as ‘this’ scope for the component. If you write ReactJS code in ES5, then the compiler does auto-binding of user defined component methods to the component, but it does not do so when the code is written in ES6. So we need to manually do this auto-binding. One way to do this is to specifically bind user defined methods to the component in the constructor –
constructor (props) { super(props); this.state = { name : props.name } this.onSetName = this.onSetName.bind(this); }
But this is not a very good solution, because you will have to do this for all user defined functions in your component.
Other solution is to use fat arrow, =>, functions of ES6. When you declare function using fat arrow, the function does not create its own ‘this’ scope, but uses the active ‘this’ scope at that point. So we could write setName event handler in our component as –
onSetName = () => { this.setState({ name : this.refs.nameTxt.value }) }
But this code won’t compile in ES6 (try gulp command to build the application), because ES6 does not support property assignment in classes. This is supported in ES7. The good news is that there is a Babel preset (Stage-0 preset) that can translate this code to ES5. So install the preset
npm install babel-preset-stage-0 --save-dev
You also need to add this preset to babelify in the build task to gulpfile.js
.transform(babelify.configure({ presets : ["es2015", "react", "stage-0"] }))
Remember to remove binding code we added in the constructor, if you are going to use the above Babel preset.
With stage-0 preset added, our code should compile and run as expected.
-Ram Kulkarni
|
http://ramkulkarni.com/blog/using-reactjs-with-babel-and-es6-2/
|
CC-MAIN-2020-40
|
refinedweb
| 820
| 50.73
|
Scheme has procedures that are first-class values. Java does not. However, we can simulate procedure values, by overriding of virtual methods.
class Procedure { ...; public abstract Object applyN (Object[] args); public abstract Object apply0(); ...; public abstract Object apply4 (Object arg1, ..., Object arg4); }
We represent Scheme procedures using sub-classes of
the abstract class
Procedure.
To call (apply) a procedure with no arguments,
you invoke its
apply0 method; to invoke a
procedure, passing it a single argument, you use its
apply1 method; and so on using
apply4 if
you have 4 arguments. Alternatively, you can bundle
up all the arguments into an array, and use the
applyN
method. If you have more than 4 arguments, you
have to use
applyN.
Notice that all
Procedure sub-classes have to
implement all 6 methods, at least to the extent of
throwing an exception if it is passed the wrong number of
arguments. However, there are utility classes
Procedure0 to
Procedure4 and
ProcedureN:
class Procedure1 extends Procedure { public Object applyN(Object[] args) { if (args.length != 1) throw new WrongArguments(); return apply1(args[0]); } public Object apply0() { throw new WrongArguments();} public abstract Object apply1 (Object arg1); public Object apply2 (Object arg1, Object arg2) { throw new WrongArguments();} ...; }
Primitive procedures can be written in Java as sub-classes of these helper classes. For example:
public class force extends Procedure1 { public Object apply1 (Object arg1) throws Throwable { if (arg1 instanceof Promise) return ((Promise)arg1).force (); return arg1; } }
The Kawa compiler used to compile each user-defined procedure
into a separate class just like the
force
function above. Thus a one-argument function would be compiled to a
class that extends
Procedure1,
and that the body of the function compiled to the body
of an
apply1 method. This has the problem
that compiling a Scheme file generates a lot of classes.
This is wasteful both at run-time and in terms of size of compiled files,
since each class has some overhead (including its own constant pool).
Early versions of Kawa were written before Sun added reflection to Java in JDK 1.1. Now, we can use reflection to call methods (and thus functions) not known at compile-time. However, invoking a function using reflection is a lot slower than normal method calls, so that is not a good solution. The next sections will discuss what Kawa does instead.
Each Scheme function defined in a module is compiled to one or more Java methods. If it's a named top-level function, the name of the method will match the name of the Scheme function. (If the Scheme name is not a valid Java name, it has to be mangled.) An anonymous lambda expression, or a non-toplevel named function, gets a generated method name. A function with a fixed number of parameters is compiled to a method with the same number of parameters:
(define (fun1 x y) (list x y))
Assuming the above is in
mod1.scm,
the generated bytecode is equivalent to this method:
public static Object fun1 (Object x, Object y) { return MakeList(x, y); }
The method can be an instance method or a static method, depending on compilation options. Here we'll assume it is static.
To compile a call to a known function in the same module, it is easy for Kawa to generate static method invocation. In certain cases, Kawa can search for a method whose name matches the function, and invoke that method.
If the function has parameter type specifiers, they get mapped to the corresponding Java argument and return types:
(define (safe-cons x (y :: <list>)) :: <pair> (cons x y))
The above compiles to:
public static gnu.lists.Pair safeCons (Object x, gnu.lists.LList y) { return Cons(x, y); }
A function with optional parameters is compiled to a set of overloaded methods. Consider:
(define (pr x #!optional (y (random))) (+ x y))
This gets compiled to two overloaded method, one for each length of the actual argument list.
public static Object pr (Object x) { return pr(x, random()); public static Object pr (Object x, Object y) { return Plus(x, y));
If there is a rest-parameter list that get compiled to either
an
Object[] or
LList parameter.
The method name gets an extra
$V
to indicate that the function takes a variable number of parameters,
and that extra parameters should be passed as a list or array to
the last method parameter.
For example this Scheme function:
(define (rapply fun . args) (apply fun args))
This get compiled to:
public static Object rapply$V(Object fun, LList args) { return apply(fun, args); }
You can declare in Scheme that the rest parameter has type
<Object[]>, in which case the
method rest parameter is
Object[].
Kawa compiles a Scheme module (a source file, or a standard-alone
expression) to a Java class, usually one that
extends
ModuleBody.
class ModuleBody { ... }
Top-level forms (including top-level definitions) are
treated as if they were nested inside a dummy procedure.
For example assume a Scheme module
mod1.scm:
(define (f x) ...) (define (g x) ...) (do-some-stuff)
This gets compiled to
class mod1 extends ModuleBody implements Runnable { public Object f(Object x) { ... } public Object g(Object x) { ... } public Procedure f = ???; /* explained later */ public Procedure g = ???; public void run() { define_global("f", f); define_global("g", g); do_some_stuff(); } }
When a file is
loaded, an instance of the
compiled class is created, and the
run is invoked.
This add the top-level definitions to the global environments,
and runs any top-level expressions.
Alternatively, using the
--module-static command-line flag
generates a static module:
class mod1 extends ModuleBody { public static Object f(Object x) { ... } public static Object g(Object x) { ... } public static Procedure f = ???; public static Procedure g = ???; static { define_global ("f", f); define_global ("g", g); do_some_stuff(); } }
In this case the top-level actons (including definitions) are performed during class initialization.
A Java method represents the actions of a Scheme function,
and calling a known Scheme function is easily implemented
by invoking the method. However, Scheme has “first-class”
functions, so we need to be able “wrap” the Java
method as an
Object that can be passed around,
and called from code where the compiler that doesn't know which
function will get called at run-time.
One solution is to use Java reflection, but that has high overhead.
Another solution (used in older versions of Kawa) is to compile each Scheme
function to its own class that extends
Procedure,
with an
applyN method that evaluates the function body;
this incurs the overhead of a class for each function.
The solution (as with all other problems in Computer Science [David Wheeler])
is to add an extra level of indirection. Every function in a module
gets a unique integer selector.
The utility
ModuleMethod class
is a
Procedure that has a method selector
code plus a reference to the
ModuleBody context:
class ModuleMethod extends Procedure { ModuleBody module; int selector; String name; public Object apply1(Object arg1) { return module.apply1(this, arg1); } public ModuleMethod(ModuleBody body, int selector, String name) { ... } } class ModuleBody { public Object apply1(Object x) { throw Error(); } }
The compiler generates a
switch statement to map
selector indexes to actual methods. Thus the previous
example generates (in static mode):
class mod1 extends ModuleBody { public static f(Object x) { ... } public static g(Object x) { ... } public static Procedure f = new ModuleMethod(this, 1, "f"); public static Procedure g = new ModuleMethod(this, 2, "g"); static { define_global ("f", f); define_global ("g", g); do_some_stuff(); } public Object apply1(ModuleMethod proc, Object x) { switch (proc.selector) { case 1: return f(x); case 2: return g(x); default: return super.apply1(proc, this); } } }
The symbol
g resolves to the
Procedure value of
mod1.g.
Invoking its
apply1 method calls the
method in
ModuleMethod, which calls the
2-argument
apply1 method in
mod1.
This switches on the selector 2, so we end up calling the
g
method. This is more expensive than calling
g directly,
but far less expensive than using reflection.
When a language combines first-class nested functions with lexical scoping
(as Scheme does), then we have the problem that an inner function
can reference a variable from an other scope, even when that
outer scope has exited.
In this simple example we say that the inner function
f2
“captures” the variable
a
from the outer function
f1:
(define (f1 a) (define (f2 b) (list a b)) (cons a f2))
The standard solution uses a
“closure” to represent a function together with the
environment of captured variables.
Kawa does this by using the same
ModuleBody
mechanism used above for first-class functions.
class foo extends ModuleBody { public Procedure f1 = new ModuleMethod(this, 1, "f1"); public Object f1 (Object a) { foo$frame1 frame = new foo$frame1(); frame.a = a; return cons(frame.a, frame.f2); } public Object apply1(ModuleMethod proc, Object x) { switch (proc.selector) { case 1: return f1(x); default: return super.apply1(proc, this); } }
This is as dicussed earlier, except for the
body of the
f1 functions.
It create a new “inner module” or “frame”.
The parameter
a is copied to a field
in the frame, and any references to the parameter
are replaced by a reference to the field.
The inner module is implemented by this class:
public class foo$frame1 extends ModuleBody { Object a; public Procedure f2 = new ModuleMethod(this, 1, "f2"); public Object f2 (Object b) { return list(this.a, b); } public Object apply1(ModuleMethod proc, Object x) { switch (proc.selector) { case 1: return f2(x); default: return super.apply1(proc, this); } }
This mechanism again requires an extra indirection when an inner function
is called.
We also require a distinct frame class for each scope that has one
or more variables captured by some inner scopes. At run-time, we
need to allocate the frame instance plus
ModuleMethod
instances for each inner function (that does capture an outer variable),
when we enter the scope for the frame.
It should be possible to use general-purpose (sharable) frame classes
for the common case that only a few variables are captured; however,
I have to investigated that optimization.
Aside: The original Java language definition did not support nested functions. However, it did have objects and classes, and it turns out the objects and first-class functions are similar in power, since a closure can be represented using an object and vice versa. The “inner classes” added to Java in JDK 1.1 are an object-oriented form of first-class functions. The Java compiler translates the nested classes into plain objects and non-nested classes, very much like Kawa represents nested Scheme functions.
This section documents how Kawa implemented closures years ago. It is included for historical interest.
Kawa used to implement a closure as a
Procedure object
with a “static link” field that points to the inherited
environment. Older versions of Kawa represented the environment
as an array. The most recent version uses the
Procedure
instance itself as the environment.
Let us look at how this works, starting with a
very simple example:
(define (f1 a) (define (f2 b) (list a b)) (cons a f2))
This gets compiled to the bytecode equivalent of:
class F1 extends Procedure1 { public Object apply1(Object a) { // body of f1 F2 heapFrame = new F2(); heapFrame.a = a; return Cons.apply2(heapFrame.a, heapFrame); } } class F2 extends Procedure1 { // F2 closureEnv = this; Object a; public Object apply1(Object b) { // body of f2 return List.apply2(this.a, b); } }
Note that the instance of
F2 that
represents the
f2 procedure contains both
the code (the
apply1 methods), and
the captured instance variable
a as a Java field.
Note also that the parent function
f1 must
in general use the same field instance when accessing
a,
in case one or the other function assigned to
a
using a
set!.
Next, a slightly more complex problem:
(define (f3 a) (define (f4 b) (cons a b)) (define (f5 c) (cons a c)) (cons a f5))
In this case all three functions refers to
a.
However, they must all agree on a single location, in case one of
the functions does a
set! on the variable.
We pick
f4 as the home of
a (for the
simple but arbitrary reason that the compiler sees it first).
class F3 extends Procedure1 { public Object apply1(Object a) { // body of f3 F4 heapFrame = new F4(); heapFrame.a = a; return Cons.apply2(heapFrame.a, new F5(heapFrame)); } } class F4 extends Procedure1 { // F4 closureEnv = this; Object a; public Object apply1(Object b) { // body of f4 return Cons.apply2(this.a, b); } } class F5 extends Procedure1 { F4 closureEnv; public F5 (F4 closureEnv) { this.closureEnv = closureEnv; } public Object apply1(Object c) { // body of f5 return Cons.apply2(closureEnv.a, c); } }
If a variables is captured through multiple levels of nested functions, the generated code need to follow a chain of static links, as shown by the following function.
(define (f6 a) (define (f7 b) (define (f8 c) (define (f9 d) (list a b c d)) (list a b c f9)) (list a b f8)) (list a f7))
That gets compiled into bytecodes equivalent to the following.
class F6 extends Procedure1 { public Object apply1(Object a) { // body of f6 F7 heapFrame = new F7(); heapFrame.a = a; return List.apply2(heapFrame.a, heapFrame); } } class F7 extends Procedure1 { Object a; public Object apply1(Object b) { // body of f7 F8 heapFrame = new F8(this); heapFrame.b = b; return List.apply3(this.a, heapFrame.b, heapFrame); } } class F8 extends Procedure1 { Object b; F7 staticLink; public F8(F7 staticLink) { this.staticLink = staticLink; } public Object apply1(Object c) { // body of f8 F9 heapFrame = new F9(this); heapFrame.c = c; return List.apply4(staticLink.a, this.b, heapFrame.c, heapFrame); } } class F9 extends Procedure1 { Object c; F8 staticLink; public F9(F8 staticLink) { this.staticLink = staticLink; } public Object apply1(Object d) { // body of f9 return List.apply4 (staticLink.staticLink.a, staticLink.b, this.c, d); } }
Handling tail-recursion is another complication.
The basic idea is to divide the procedure prologue
into the actions before the loop head label, and those after.
(Note that allocating a
heapFrame has to be
done after the head label.)
Handling inlining also requires care.
Kawa has various hooks for inlining procedures. This can allow substantial speedups, at the cost of some generality and strict standards-compliance, since it prevents re-assigning the inlined procedures. Most of these hooks work by having the compiler notice that a name in function call position is not lexically bound, yet it is declared in the (compile-time) global scope.
The most powerful and low-level mechanism works by having the
compiler note that the procedure implements the
Inlineable interface.
That means it implements the specical
compile method,
which the compiler calls at code generation time; it can generate
whatever bytecode it wants. This is a way for special procedues
to generate exotic bytecode instructions. This hook is only
available for builtin procedures written in Java.
Another mechanism uses the Java reflective facilities.
If the compiler notices that the class of the procedure
provides a static method with the right name (
apply),
and the right number of parameters, then it generates a direct call
to that static method. This is not inlining
per se, but it does by-pass the
(currently significant) overhead of looking up the name in the global
symbol-table, casting the value to a procedure, and then making a
virtual function call. Also, because the procedure is replaced
by a call to a statically known method, that call could actually be
inlined by a Java bytecode optimizer. Another advantage of calling
a known static method is that the parameter and return types can
be more specific than plain
Object, or even
be unboxed primitive types. This can avoid many type conversions.
The Kawa compiler generates a suitable
apply
method for all fixed-arity procedures that do not require a closure,
so this optimization is applicable to a great many procedures.
Finally, Kawa has preliminary support for true inlining,
where a procedure that is only called in one place except for tail-calls,
is inlined at the call-site. I plan to add an analysis pass to
detect when this optimization is applicable. For now, there is a
special case to handle the
do special looping form,
and these are now always implemented in the natural way (as inlined
loops). The “named
let” cannot always
be implemented as an inlined loop, so implementing that equally
efficiently will need the planned analysis phase.
This is describing a work in progress.
To handle general tail-calls, and to be able to select between overloaded methods, we split a function call into two separate operations:
The
match operation is given the
actual parameters, and matches them against the formal parameters.
If the right number and types of arguments were given,
a non-negative integer return code specifies success;
otherwise a negative return code specifies a mis-match.
On success the arguments are saved in the argument save area of
the
CallContext.
The
apply operation
performs the actual work (function body) of the called function.
It gets the actual parameters from the
CallContext,
where
match previously saved it.
|
http://www.gnu.org/software/kawa/internals/procedures.html
|
crawl-002
|
refinedweb
| 2,842
| 53.71
|
Kevin Altis wrote: > framework.widgie.Button [that is, Button is a class in module widgie] [refactors] > framework directory > __init__.py > various module files for the framework > widgie directory > __init__.py > basewidgie.py > button.py [and then] > framework.widgie.button.Button [but wants that referenced as framework.widgie.Button] You have to hack widgie/__init__.py so that Button (and siblings) are top-level attributes. Just be aware that when the programmer has a problem with Button and goes looking for the code, it's not going to be where he expects to find it. > In addition, it would be nice have __init__.py automatically load all > the files in the widgie directory rather than having to hard-code each > filename. Hopefully I'm explaining the problem correctly. Any > suggestions or solutions? No you don't. You don't want button automatically loaded - you want it to disappear! Even without that namespace hackery, doing an "automatic load" of submodules is a generally a poor idea - it makes for a very expensive import. Perhaps the programmer only wanted one submodule, yet he pays for all of them. -- Gordon
|
https://mail.python.org/pipermail/python-list/2001-December/117216.html
|
CC-MAIN-2019-30
|
refinedweb
| 186
| 60.92
|
I have create a File watcher using org.apache.commons.io.monitor.FileAlterationMonitor. The file changes are captured correctly. But I want to stop the monitor task using a separate method. Its not working. The source code is as below. import java.io
I am running the following code package test.commons; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; public class Try_FileUtilsWrite { public static void main(String[] args) throws IOException { System.out.pr
I had a problem with reading /proc/%d/stat files using my Java method copyFiles() (source code below). I have found workaround using similar readProc() method. Now I am wondering what was the problem. Output files were created, but each file had 0 by
I am calling a C++ Method via JNI which creates two files. A text log file and a pdf file in a given directory. I want to delete these files (if they exist) before executing the JNI method. I am using Apache commons.io (FileUtils.forceDelete(File fil
my code is given below . public static void main(String[] args) { // TODO code application logic here File pcounter_log = new File("c:\development\temp\test.log"); try { TailerListener listener = new PCTailListener(); Tailer tailer = new Tailer(pcoun
Is there a library for NIO ByteChannel providing similar utilities to what google-guava and commons-io provide for streams? E.g. I'd like to have several ReadableByteChannels concatenated in one or have a view of a channel limited to a particular siz
I'm having an issue where org.apache.commons.io.FileUtils.copyFile(File, File) is producing slightly different files. When I compare these files with bsdiff or in an editor, I can tell they're different. Certain bytes are being copied as question mar
How can I use the library to download a file and print out bytes saved? I tried using import static org.apache.commons.io.FileUtils.copyURLToFile; public static void Download() { URL dl = null; File fl = null; try { fl = new File(System.getProperty("
Hello I'm trying to copy file to another directory with commons fileUtils. I tried this FileUtils.copyFile(getOutputFile(), new File("RESULT/final_result.txt"); The new final_result.txt file contains only the first line of my output file, what did I
Hey everyone I'm trying to get a List of directories. I'm using FileUtils listFiles(). I want to do something like this: listFiles(File,IOFileFilter,false). My real questions is how I can implement the accept() from the IOFileFilter so I can check if
I want to collect a list of all files under a directory, in particular including subdirectories. I like not doing things myself, so I'm using FileUtils.listFiles from Apache Commons IO. So I have something like: import java.io.File; import java.util.
|
http://www.dskims.com/tag/apache-commons-io/
|
CC-MAIN-2018-22
|
refinedweb
| 467
| 52.26
|
Rene Rivera <grafik.list at redshift-software.com> writes: > [2003-06-18] David Abrahams wrote: > >> >>Moving this to the C++-sig as it's a more appropriate forum... >> >>"dalwan01" <dalwan01 at student.umu.se> writes: >> >>>> Daniel Wallin <dalwan01 at student.umu.se> writes: >>>> >>>> >. > > I must be atipical. I make heavy, nested, use of namespaces in my C++ code. > So having an easy way to represent that would be nice. > >>> *. > > It's not global state. Unlike Python Lua can handle multiple "instances" of > an interpreter by keeping all the interpreter state in one object. Python can handle multiple interpreter instances too, but hardly anyone does that. In any case, it still seems to me to be a handle to global state. > So having a single global var for that is not an option. Why not? I don't get it. Normally any module's initialization code will be operating on a single interpreter, right? Why not store its identity in a global variable? > It needs to get passed around explicitly or implicitly. I imagine > Lua is not the only interpreter that does this. So it's something to > consider carefully as we'll run into it again (I fact if I remember > correctly Java JNI does the same thing). :(. >>>. > > It's a somewhat different audience that uses Lua. The kind of audience that > looks at the assembly generated to make sure it's efficient. People like > game developers, embeded developers, etc. <politically incorrect sweeping generalization> That audience tends to be superstitious about cycles, rather than measuring, and I think this concern is almost always misplaced when applied at the boundary between interpreted and compiled languages. The whole point of binding C++ into an interpreter, when you're concerned with performance, is to capture a large chunk of high-performance execution behind a single function call in the interpreter. I would think that once you are willing to use a language like lua you're not going to be that parsimonious with the execution of lua code adjacent to the call into C++, and it's easy for an extra instruction or two in the interpreter to swamp the cost of dynamic type conversion. Furthermore, purely compile-time lookups can have costs in code size, which is another important concern for this audience. </politically incorrect sweeping generalization> > so having a choice between compile time and runtime they, and I, > would choose compile time. But perhaps the important thing about > this is to consider how to support both models. I know it can be a hard sell to that group, but I'd want to see some convincing numbers before deciding to support both models. Boost.Python used to use static converter lookups, but the advantages of doing it dynamically are so huge that I'm highly reluctant to complicate the codebase by supporting both without scientific justification. Oh, and BTW: I think people have vastly overestimated the amount of avoidable dynamic lookup, and the amount of code actually executed in the dynamic converter lookup. There is no map indexing or anything like that, except at the time the module is loaded, when references to converter registry for each type are initialized. The converter registry for a given type generally contains only one converter (in each direction), so there is no cost for searching for an appropriate converter. When C++ classes are extracted from wrapped class objects, a *static* procedure for finding the C++ class is tried before consulting the registry. Finally, if you care about derived <==> base class conversions (and I think you do), there will always be some dynamic type manipulation and/or RTTI, leading to some dynamic dispatching, because that's the only way to implement it. I am not trying to be difficult here. If there are significant technical advantages to purely-static converter lookups, I will be the first to support the idea. In all, however, I believe it's not an accident that Boost.Python evolved from purely-static to a model which supports dynamic conversions, not just because of usability concerns, but also because of correctness and real efficiency. So, let's keep the conversation open, and try to hammer on it until we reach consensus. -- Dave Abrahams Boost Consulting
|
https://mail.python.org/pipermail/cplusplus-sig/2003-June/004103.html
|
CC-MAIN-2014-15
|
refinedweb
| 704
| 54.83
|
Hello all,
I have defined 3 classes with their attributes including their unique ID. The relationship between these objcts are hirarchical. For example, I have school, class, and students. At the begining of the simulation I create the school and number of classes and put students in the classes and store the list of school's and classes students in a list. At some points in time I am gadering all the students at the school level and sorting them out. This is happening at the school object the school and put them in the same or different classes based on one of their attributes (lets say thier social behaviors). Most of the students should be assigned to their former class (because of some sort of bound that they have created) but some are gonna change class.
Here is the skech of my 3 classes:
public class School { private ArrayList<Student> SchoolList = new ArrayList<Student>(); .//Some other related attributes . . } public class ClassRoom{ private int classSize; private int ClassID; private ArrayList<Student> classList = new ArrayList<Student>(); . . . } public class Student{ private int StID; privar int ClassID; .//Other attributes . }
My probelem is puting the sorted list of students from my schoolList to their classList in such a way that they maintain their old class unless they have to change it.
I guess, in short my problem is how to link the class Id and students in such a way that I can find them later.
PS: This supposed to be a quick project then i don't want to go to relational DBs and stuff. Also, I do have a classList and I can compare that with the new list of students to check if they are the same but this makes the program runs so slow that makes it out of the question.
I hope it made sense.
Thank you for any advice.
|
https://www.daniweb.com/programming/software-development/threads/456667/design-issue-in-linking-objects
|
CC-MAIN-2017-51
|
refinedweb
| 311
| 78.69
|
Given an array and an integer K. We need to find the maximum of every segment of length K which has no duplicates in that segment.
Examples:
Input : a[] = {1, 2, 2, 3, 3}, K = 3. Output : 1 3 2 For segment (1, 2, 2), Maximum = 1. For segment (2, 2, 3), Maximum = 3. For segment (2, 3, 3), Maximum = 2. Input : a[] = {3, 3, 3, 4, 4, 2}, K = 4. Output : 4 Nothing 3
A simple solution is to run two loops. For every subarray find all distinct elements and print maximum unique element.
An efficient solution is to use sliding window technique. We maintain two structures in every window.
1) A hash table to store counts of all elements in current window.
2) A self balancing BST (implemented using set in C++ STL and TreeSet in Java). The idea is to quickly find maximum element and update maximum element.
We process first K-1 elements and store their counts in hash table. We also store unique elements in set. Now we one by one process last element of every window. If current element is unique, we add it to set. We also increase its count. After processing last element, we print maximum from set. Before starting next iteration, we remove first element of previous window.
C++
Python3
# Python3 code to calculate maximum unique
# element of every segment of array
def find_max(A, N, K):
# Storing counts of first K-1 elements
# Also storing distinct elements.
Count = dict()
for i in range(K – 1):
Count[A[i]] = Count.get(A[i], 0) + 1
Myset = dict()
for x in Count:
if (Count[x] == 1):
Myset[x] = 1
# Before every iteration of this loop,
# we maintain that K-1 elements of current
# window are processed.
for i in range(K – 1, N):
# Process K-th element of current window
Count[A[i]] = Count.get(A[i], 0) + 1
if (Count[A[i]] == 1):
Myset[A[i]] = 1
else:
del Myset[A[i]]
# If there are no distinct
# elements in current window
if (len(Myset) == 0):
print(“Nothing”)
# Set is ordered and last element
# of set gives us maximum element.
else:
maxm = -10**9
for i in Myset:
maxm = max(i, maxm)
print(maxm)
# Remove first element of current
# window before next iteration.
x = A[i – K + 1]
if x in Count.keys():
Count[x] -= 1
if (Count[x] == 1):
Myset[x] = 1
if (Count[x] == 0):
del Myset[x]
# Driver code
a = [1, 2, 2, 3, 3 ]
n = len(a)
k = 3
find_max(a, n, k)
# This code is contributed
# by mohit kumar
Output:
1 3 2
Time Complexity : O(N Log K)
|
https://tutorialspoint.dev/data-structure/binary-search-tree/maximum-unique-element-every-subarray-size-k
|
CC-MAIN-2021-17
|
refinedweb
| 442
| 65.83
|
Auto arg
cmd.auto_arg controls auto-completion of command arguments in PyMOL's command line. It is an array of dictionaries. When Pymol's console attempts to auto-complete the n-th argument of command abc, it will look at
cmd.auto_arg[n]['abc'] (n starts from 0). This is a list with three elements. For arguments which do not have an entry in cmd.auto_arg, the default is to auto-complete file names.
- The first element is a lambda function which returns an Shortcut object. Shortcut object wraps the list of candidate strings, given to its constructor.
- The second element is a string, which describs the argument.
- The third element is a string, which will be added after autocompletion (postfix).
PYTHON EXAMPLE
cmd.auto_arg[0]['test']=[lambda: cmd.Shortcut(['abc','bcd']), '1st argument', ', ']
This code defines the auto-completion list for the first argument of command test. When you type 'test ' and press TAB, PyMOL will show you two candidates as:
parser: matching 1st argument: abc bcd
If you type 'a' and press TAB again, PyMOL will complete it to "test abc, ". Note that ', ' is added.
Pre-defined lambdas
In most cases, you just want to complete from object names or setting lists. Then you don't have to write your own lambda function. Just use cmd.object_sc for choosing from objects.
cmd.auto_arg[0]['test'] = [ cmd.object_sc, 'object', '']
Or even simpler, borrow from one of the core commands:
# "extract" also uses cmd.object_sc in its first argument cmd.auto_arg[0]['test'] = cmd.auto_arg[0]['extract']
Use cmd.selection_sc for setting names (like 'line_width'), cmd.map_sc for maps and cmd.repres_sc for representations ('sticks', 'lines', etc).
More Examples
The first argument of the save command auto-completes to filenames by default. If you want for example filenames and object names to auto-complete, use this (from pymol-users mailing list):
import glob names_filenames_sc = lambda: cmd.Shortcut(cmd.get_names() + glob.glob('*')) cmd.auto_arg[0]['save'] = [names_filenames_sc, 'filename or object name', '']
|
http://pymolwiki.org/index.php/Auto_arg
|
CC-MAIN-2016-36
|
refinedweb
| 330
| 61.53
|
Building Examples That Use a Demo Method and a TextBlock Control
This topic explains how to build and run Silverlight reference and conceptual examples that have the following characteristics:
They demonstrate types and members that are not part of the user interface of a Silverlight-based application, such as the Dictionary<TKey, TValue> and Thread classes.
They have a static Demo method that runs the example code.
They write their output to a TextBlock control.
Building the Silverlight examples consists of the following steps:
Create a Silverlight-based application by using a project template.
Modify the MainPage.xaml file.
Modify the MainPage.xaml.cs or MainPage.xaml.vb file.
Add a new file that contains the example code.
Build and run the application.
To create a Silverlight project in Visual Studio 2008
Start Visual Studio 2008.
On the File menu, point to New, and then click Project.
In the Project Types pane of the New Project dialog box, click Visual C# or Visual Basic.
In the Templates list, click Silverlight Application.
Type the application name, enter its location, and then click OK.
In the Add Silverlight Application dialog box, click Dynamically generate an HTML test page to host Silverlight within this project, and then click OK.
To modify the MainPage.xaml file
Open the default MainPage.xaml file for your Silverlight project.
Change the width of the default UserControl to 1024 or larger, and change its height to 768 or larger, to accommodate the output from the typical example.
Insert the following TextBlock control into the default Grid control.
The following code shows the modified MainPage.xaml file.
<UserControl x: <Grid x: <TextBlock x: </Grid> </UserControl>
To modify the code file for page.xaml
Open the MainPage.xaml.cs or MainPage.xaml.vb file for your application.
After the InitializeComponent statement in the MainPage() constructor, add a call to the static (Shared in Visual Basic) Example.Demo method. Pass the TextBlock control to the method.
The following code shows the modified MainPage.xaml.cs file:
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace SilverlightApplication { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); Example.Demo(outputBlock); } } }
The following code shows the modified MainPage.xaml.vb file:
To add a new file that contains example code to your Silverlight project
Copy the example code from a Silverlight topic.
In Solution Explorer, right-click on the project's name, point to Add, and then click New Item to add a new file to the project.
In the Add New Item dialog box, click Code File from the Templates list, name the file Example.cs or Example.vb, and then click the Add button.
Open the Example.cs or Example.vb file.
Paste the example code into the new code file.
The following code demonstrates Example.cs:
The following code demonstrates Example.vb:
You are now ready to build and run the example.
|
http://msdn.microsoft.com/es-es/library/cc296251(v=vs.95).aspx
|
CC-MAIN-2014-15
|
refinedweb
| 512
| 53.78
|
Opened 6 years ago
Closed 6 years ago
Last modified 5 months ago
#907 closed task (fixed)
refactor the window attributes and signal code
Description (last modified by )
As it's a bit of a mess...
In particular:
- keep in mind #41..
- try to reduce the duplication between the window models, WM and the server's view
- cleaner abstraction of the "window model" interface
- remove redundant attributes (
is_ORvs "override-redirect" property,
is_shadow, etc..)
- move some wm-state attributes so OR windows can use them (at least focus?)
- more consistent property change code
- fixup geometry issues (and try to get rid of the ownership election stuff)
- make it less dependent on gtk2 whilst we're at it
- maybe move all
_handle_XXXXmethods to a util class?
- generalize
NET_WM_ALLOWED_ACTIONS?
- maybe consider the eventual move to GTK3? meh, if so we will need to replace
add_event_receiver/
remove_event_receiverwith a
WeakKeyDictionary
- maybe a new form of
_internal_set_propertycan check if the value has actually changed? (no need to send a
notify()if it hasn't)
List of API calls to deal with:
get_default_window_icon
_guess_window_type
do_get_property_can_focusjust update the "can-focus" property instead
x11_get_server_time- rewrite in Cython
read_initial_propertiesand X11 properties, it's a mess
call_setup()is inconsistent, it's called for OR and tray, but we call it for "normal" windows
WM_PROTOCOLS->
XGetWMProtocols
WM_CLIENT_MACHINE->
XGetWMClientMachine
attention-requested: shouldn't we clear this when "urgency" is not in the wm_hints?
set_active- maybe this should be a method on WM instead?
Attachments (4)
Change History (11)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Changed 6 years ago by
Changed 6 years ago by
much cleaner patch
comment:3 Changed 6 years ago by
Huge changeset in r9822 - see commit message.
If needed, it should be possible to revert those changes easily enough for testing.. so far.
Still TODO:
WM_STATEand withdrawn windows - we only handle "iconic" (should we forward "withdrawn" to client? and emulate it as a destroy + new for older clients?)
- geometry (big!) - see also #846, #988 and many others
- "attention-request"
- maybe too many messages are now handled in the window base class (not relevant to OR windows?)
- should use "managed_connect" more
- seem to be getting double notifications for a single notify() call!?
- "can-focus" is not used?
- #846
- #881?
comment:4 Changed 6 years ago by
comment:5 Changed 6 years ago by
Note: on centos 7.x, we get tons of warnings like these:
/usr/lib64/python2.7/site-packages/gobject/__init__.py:115: Warning: Attempt to add property xpra+x11+gtk2+models+or_window+OverrideRedirectWindowModel::size-hints after class was initialised type_register(cls, namespace.get('__gtype_name__')) /usr/lib64/python2.7/site-packages/gobject/__init__.py:115: Warning: Attempt to add property xpra+x11+gtk2+models+or_window+OverrideRedirectWindowModel::frame after class was initialised type_register(cls, namespace.get('__gtype_name__'))
Which is caused by this bug: (hopefully will be backported to centos 7.x soon).
AFAICT, it is not possible to workaround this warning with pygobject (see the two attempts at subclassing attached below).
Changed 6 years ago by
example triggering the centos 7 warning
Changed 6 years ago by
another example triggering the centos 7 warning
comment:6 Changed 6 years ago by
Lots more work on this done as part of #990 - this will do for this release.
comment:7 Changed 5 months ago by
this ticket has been moved to:
better patch
|
https://www.xpra.org/trac/ticket/907
|
CC-MAIN-2021-25
|
refinedweb
| 561
| 50.36
|
Latest version of Android N has stream package but when i'm trying to use it is saying min Sdk version which i should use is 24 (N) and my min SDK is 16.
I enabled JackOptions with which Lambda expressions , Method References are working fine ( even for versions less than N minsdk) but still has problem is only with Stream package . The link below says lambda, method references are available to 23 n lower also but no clarity on Stream package.
So i want to understand that Steam package i cannot use in my project ( minsdk 16) ? Or am I missing something .
All sdk components are updated .
compileSdkVersion 24
buildToolsVersion "24.0.2"
minSdkVersion 16
targetSdkVersion 24 (23 doesn't matter )
Please suggest me what i should do . Also i saw streamsupport which is working fine but i don't want to add a new dependency.
Is Android N Stream API backported to lower versions?
No, it is not, at least in terms of literally using
java and
javax packages, such as
java.util.stream. No classes get backported to their original Java packages, as otherwise there are namespace collisions on newer devices.
To date, Google has not released some sort of workalike classes for
java.util.stream, etc., as a library, where those classes happen to use a separate Java package.
|
https://codedump.io/share/S9FiiKHB1umf/1/is-android-n-stream-api-backported-to-lower-versions
|
CC-MAIN-2017-43
|
refinedweb
| 223
| 64.41
|
Hi there,
Running a python Jupyter notebook I can render beautiful offline plot.ly charts. However, when I publish the notebook to a dashboard, those charts are no longer visible.
I can seem to publish the charts as individual insights using a static insight but I really like the idea of keeping it within the published notebook.
For example - try this in a notebook (assuming you have plotly installed in your python environment). It should work and show a pretty contour plot. Not publish that notebook on a dashboard. Neither the dashboard rendering or insight rendering show the graph - just a blank.
import dataiku
import plotly.graph_objs as go
import numpy as np
import plotly.offline as py
py.init_notebook_mode(connected=True)
x = np.random.randn(1000)
y = np.random.randn(1000)
fig = go.FigureWidget(
data=[
{'x': x, 'y': y, 'type': 'histogram2dcontour'}
]
)
py.iplot(fig, filename='histogram')
Screen grab of the notebook running -
Not quite so exciting screen grab of the insight...
Any ideas?
Many thanks
Theo
©Dataiku 2012-2018 - Privacy Policy
|
https://answers.dataiku.com/3327/offline-does-render-published-notebook-dashboard-insight
|
CC-MAIN-2019-35
|
refinedweb
| 172
| 61.63
|
A common thing that people want to do in their XNA games is to store data like high scores, game options, or even game states. There are a number of ways of accomplishing this. I have used many myself but my favorite is now to use XML serialization and XNA's Storage. The problem with straight XML serialization though is that it isn't secure. It is easy for the player to edit an XML file. There are ways to encrypt/decrypt the data to make it more secure. The discussion I want to start is how do my fellow XNAer's save data related to games?
Discussion: Saving DataPage 1 of 1
5 Replies - 4802 Views - Last Post: 21 November 2011 - 02:15 PM
#1
Discussion: Saving Data
Posted 19 November 2011 - 04:10 PM
Replies To: Discussion: Saving Data
#2
Re: Discussion: Saving Data
Posted 19 November 2011 - 04:20 PM
I've used XNA storage with a serialized structure in my first Blockable game attempt and that is mostly for setting up the level data, but the only problem I've found is the lack of changing the storage location as it wants to use the default system for a Windows Storage Container which is in the Game Saves in My Games.
So being able to store serialized data in the content project would be my preference.
So being able to store serialized data in the content project would be my preference.
#3
Re: Discussion: Saving Data
Posted 20 November 2011 - 06:26 AM
If you want it to look more secure you can change the extension of the xml files after they are written, just change them to any extension. They will still open as xml files without trouble. The only trouble is someone with a bit of knowledge could just think to change it to xml, edit it and change the extension back.
#4
Re: Discussion: Saving Data
Posted 20 November 2011 - 04:02 PM
That is an idea but like you said it is easy to get around. Anybody serious about cracking your game would be using hex editors and such and would see the XML file for what it is right away. I've considered encoding/decoding strings using simple Boolean logic like XORing with a specific mask. It is very simple to implement but also easy to crack. Securing game data, in XNA or any platform, can be a challenge to overcome.
#5
Re: Discussion: Saving Data
Posted 21 November 2011 - 12:29 PM
I prefer to serialize my save data as well. However, rather than serialize the data to an xml file, I like to use a binary file, using the BinaryFormatter class found in the System.Runtime.Serialization.Formatters.Binary namespace.
The process is very similar to xml serialization, but since the file isn't human readable, it's a bit more difficult to edit (not impossible, though).
The process is very similar to xml serialization, but since the file isn't human readable, it's a bit more difficult to edit (not impossible, though).
#6
Re: Discussion: Saving Data
Posted 21 November 2011 - 02:15 PM
That is also a good alternative when it comes to saving data. Combined with some sort of encryption scheme it would definitely make things more secure. Thanks for adding that to this conversation.
Page 1 of 1
|
http://www.dreamincode.net/forums/topic/256392-discussion-saving-data/page__p__1491965
|
CC-MAIN-2016-18
|
refinedweb
| 564
| 58.82
|
if (self.getPythonVersion != 2.7):
os.execute('python27 ' + os.cwd + 'script.py')
exit()
if sys.version_info[:2] > (2, 7):
code = subprocess.call(['python27', sys.argv[0] ])
raise SystemExit(code)
Nope, this isn't possible for the simple reason that a user could have python3.x installed and not have python2.x installed.
If you know that they have python2.7 installed, then you can use something like your work-around above, however, in that case, you'll have to make sure that you can support both python3.x and python2.x in the same source (which is generally a non-trivial task)
You can detect the python version via
sys.version_info and I think you can swap out the process using something in the
os.exec* family of functions...
e.g.:
import os, sys if sys.version_info[:2] > (2, 7): os.execve('python27', sys.argv, os.environ)
Here's another variant that you can try (it'll create a new process instead of replacing the old one however):
import sys, subprocess if sys.version_info[:2] > (2, 7): code = subprocess.call(['python27'] + sys.argv) raise SystemExit(code) print(sys.version_info)
|
https://codedump.io/share/HDTuhOxw8la1/1/is-there-a-way-to-force-a-python-program-to-run-in-version-27
|
CC-MAIN-2017-13
|
refinedweb
| 189
| 69.89
|
Qt components and Symbian blank screen
Hi,
The latest version of my apps MusicCircles and MusicCircles Lite were approved by Ovi QC, and I've got reports from users that it launches with a blank screen. I'm pretty sure this is due to Qt-components not being installed in their system. Of course, smart installer should make sure of this, but I found 2 things:
First my .pro file had:
CONFIG += qtquickcomponents
instead of:
CONFIG += qt-components
I'm not really sure where that came from, and I believe earlier versions did work for people (at least I got no reports...). Any one seen this, should it work with either or only the second?
Is it possible that older versions of the SDK used qtquickcomponents instead of qt-components, or maybe that's a harmattan thing?
Also, to fill this post with more questions... Why wasn't this picked up by Ovi QC? (judging by the comments there seem to be many apps with this problem in the ovi store...)
Cheers,
Andrés
In my app =, the problem is that the symbian components run on symbian^3 PR1.2 or more, in the oldest symbian^3 appears a black screen, the solution is that the user update their phone to the new version of the symbian (Personally,I dont know why Nokia doesnt upgrade their phones equally all )
Thanks for the information!
The strange thing is that the user is on Belle...
It´s very, very,very strange, because nokia try the apps in nokia 500, 600, 700, 701 and this phones have belle, if they have a black screen your app not pass the ovi QC, if pass works ok in belle. Is not the user will have an unofficial version of belle? (sorry my english is a little bad)
Yes, that's what I would have thought.
But maybe it's related to not having qt-components installed (I get a black screen if I uninstall qt-components). So maybe qt-components weren't installed on his system, and smart installer was not installing them.
I have uploaded a new version which should make smart installer check for qt-components properly.
I haven't tested on the ovi store, but I've solved the problem on my symbian phone if I follow the instructions here:
For some reason the smart installer has to be forced into downloading qt components. I think this is a bug, where can it be filed?
Shouted victory too soon... The smart installer does install something this time, but no luck running the app...
After a reboot, the app is working!
I think this is probably due to me being on linux so I'm using a somewhat older symbian toolchain, so I still have the bug reported here:
I really wish the Qt SDK included the symbian toolchain for linux!
I think I finally found the problem...
On Symbian Belle, Qt uses version 4.7.4 whcih includes Qt components version 1.1. This version does not allow using:
import Qt.labs.components.native 1.0
anymore.
I haven't fully tested from the ovi store yet, but I'm pretty certain this is the problem. Just wanted to write here in case people are banging their heads against walls like me...
|
https://forum.qt.io/topic/11215/qt-components-and-symbian-blank-screen
|
CC-MAIN-2017-47
|
refinedweb
| 549
| 70.94
|
Provided by: libperl-critic-perl_1.134-1_all
NAME
Perl::Critic::Exception::Fatal::PolicyDefinition - A bug in a policy.
DESCRIPTION
A bug in a policy was found, e.g. it didn't implement a method that it should have.
INTERFACE SUPPORT
This is considered to be a public class. Any changes to its interface will go through a deprecation cycle.
METHODS
Only inherited ones.
AUTHOR
Elliot Shank <perl@galumph.com>
Copyright (c) 2007-2011 Elliot Shank. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.28.1 Perl::Critic::Exception::Fatal::PolicyDefinition(3pm)
|
http://manpages.ubuntu.com/manpages/eoan/man3/Perl::Critic::Exception::Fatal::PolicyDefinition.3pm.html
|
CC-MAIN-2020-29
|
refinedweb
| 122
| 53.68
|
- Form layout doesn't resize as expected
- enable() does not work for button
- Nested groupings inside a grid
- Fill form with JSON data
- Grouping Example
- Encode store data into a String
- the menu's shortcut key position
- AllowBlank: True all TextField
- ScrollTop of TreePanel
- single combobox on many panels
- preRender a big dataview
- Scrollable panel
- Problem with store.load()
- MultiSelect with ItemSelector
- Hiding a chart tip programmatically
- load 60 000 rows in datagrid
- ComboBox/Store behavior
- Scrolling Issue since 3.0.0
- question about two trees
- Multidimensional JSON from PHP
- How add tab content dynamicly?
- [SOLVED] Error with getSize(), getHeight(), when component not rendered
- send formPanel values via ajax
- Dynamically change regex in textfield problem
- Merging cells in a grid
- Problem with FileUploadField and form reset
- Ext.menu.Adapter issues
- Combobox don't display displayField but valueField
- creating a subset datastore?
- Radiogroup - Only one button checked at a time?
- Datejs and Spinner not compatible
- Problem with character escaping
- Dont work DD to node
- Add a Panel to Tab dynamically
- modal dialog screen and return value
- How to reset form values after cliking back button
- Tabpanel assign item dynamically HELP!
- retriving subdata from the existing record data
- How to have a 50% width for a combobox ?
- Can't save data if there is a : ' (quote) in the input field
- [3.0.0] RowExpander possible bug when GridPanel gets destroyed.
- Multiple stores for the same grid
- window.scrollTo problem
- formatting datefield output on submit
- How to scroll all the way down on Panel in code?
- Bug in Ext.form.Radio setValue?
- Card layout broken in my tab panel.
- Tab Header Background Color
- Arrow image not showing on ComboBox
- words in <> cann't see in Ext.grid.EditorGridPanel?
- Filtering the GridPanel
- Header( HTML ) and Toolbar in North Region of a Viewport
- htmlEditor initialize out of the way
- Problem with bbar of a DataView inside a TabPanel
- problem with minWidth/Height and maxWith/Height in resizable Object
- 3 chart questions
- place an object in a panel to coordinates X and Y
- add element on top of a container
- get/create all url with params from FormPanel
- Problem with toolbarlayout and datefield
- piechart - Refresh data issue - bug?
- Ajax.request with auto-update
- Viewport with toolbar
- [Solved] Exclude value by submitting form
- bbar css
- KeyMap Help
- Get grid from ActiveTab()
- Viewport and Button
- Tabs
- ManagedIframePanel not working in Ext 3.0
- Script work only on chrone why??
- Toolbar with a lot of items
- Charting with ExtJS
- Flash movie in ext.panel sticks to mouse on mouse click
- assign form field to a variable
- Connection problem with ScriptTagProxy !
- Autosize TextField depending on contents?
- checkboxselectionmodel on grid state-issues
- DataView, DragZone, multiselect and the mac
- Arrow image not showing on ComboBox - Need help!!!
- user managment via ajax
- Print option in API docs?
- ComboBox Id-Value Problem
- Ext.ux.Plugin.RemoteComponent load bad the Form layout
- Suspending render event to load some data
- Radio group work like a checkbox
- StackedColumnChart X Axis Some Labels Don't Show
- Animate Toolbar Prob - Slide out one slide in another
- Nested "<form..." breaks Ext on FF
- Combo box store refresh
- using form.Action.Submit with a RowEditor?
- How do I get column name from rowselection in an ExtJS grid?
- [Solved] Treepanel & Folders List
- Comboboxed again...
- Harnessing a POST's response
- [SOLVED] AutoSizeColumns on initial load
- [SOLVED] Styling a muli-lines row ?
- remove only child items with autoDestroy=true
- CheckboxSelectionModel (Ext 3.0)
- Same DataStore for Grid with "normal" and grouping view
- Handling data store with nested array members
- File Upload
- to add custom attribute
- How to increase the height of the datagrid row
- Combobox rendering madness
- Ext.DomQuery.selectNode()
- change css attribute !!!
- [Solved] Rights system
- ct is null what i do wrong here
- ok got more odd problem with the script
- Problems with grid and JsonStore - Help needed
- remove item from toolbar
- Use ArrayStore with filter
- RowExpander XTemplate doesn't shows JSON data
- Login System
- FileUploadField Issue
- MultiSelect and DataStore
- Help with grid (cube)
- How to: Style Grid Row (background color)
- Problem with addButton
- Editable Combobox display and value
- Drag/Drop causes to drag beyond the viewport in IE
- getting the row data using rowIndex
- Shared comboboxes, even if not destroyed (beforedestroy return false), not init!
- Ext.extend - I'm stuck.
- Problem Loading data to store
- FormPanel - Submit Button and link on same line
- Adding HTML dynamically to a Panel
- Always fails when browsed from some computers, but works on others.
- Failer load xml data into combo
- Help with ItemSelector
- this.mainBody is undefined
- Need help passing result of Ajax GET to an item in a panel
- Inherited class does not keep in-defined properties. They're set to null
- Disabling user selection of tab on tabpanel
- Combobox with ajax image
- Problem creating scrollable single row dataview of images
- Changing Background Color in IE
- Testing an Editable Grid with Selenium
- filter then query?
- ToolTip on a link, still shows while you're inside it, hides when you mouse out
- TreeGrid?
- Help me:Ext.form.ComboBox fail to load data
- Refreshing Windows in Web Desktop
- question about treepanel with checkbox
- Fitting grid and form in a panel
- Tree panel problem (maybe a bug)
- Errors in ext-all-debug.js
- Combobox size problem when centered
- what should I do, to upgrade 2.2.1 to 3.0
- Store shows incorrect data
- Remove Item from Edit Grid
- Firefox Combobox problem
- Ext.data.Store load with namespaced parameters
- blue border on clicking components
- strange values by using DirectSubmit
- {FIX}hoiw do sumit and rest button
- context menu in extjs
- added row doesn't group in groupingview
- Dynamic items array in panel with single item instances
- set property dynamically
- add item into combo box aftert is loaded xml file
- Date custom Renderer problem
- Send a form with PUT
- How to get the ID of a grid when i click a button present in the tbar of the grid??
- BaseParams & JSonWriter
- Datastore set Filter before loading
- Reload a Datastore
- Ext.data.DataWriter Example + C# Problem
- Need to get Vertical scrollbar in viewport
- Grid not showing JSON data
- Click in one grid row causes row in other grid to select
- DataWriter and callback function
- about panel in card layout
- unable to populate the values from the extjs to the controller
- Click Event on Ext.Panel
- Grid with contextmenu and rowcontextmenu
- complex layout: get width and height of center region
- Focu line of the grid
- How to set body css class of panel?
- combobox valueField
- enroute a file
- Column -> ColumnModel - How does this code work?
- addListener problem
- Defining a JSon Reader to parse JSonMap
- problem with DropTarget
- Trying to load a form with data
- [3.0] this.grid is undefined
- Gui Desig 3 help
- is there a bug in expander plugin and tabpanel?
- FormPanel in a TabPanel, bad layout in active TabItem
- cardLayout/TabPanel adding significant time to rendering
- help with file upload
- [solved?]Tree load and expand
- problem with status bar
- Can I apply pre-configured configs to an existing Ext class?
- Ext layout/templating best practice
- [SOLVED]Conditional Template always true
- Need Help: Parsing XML from File vs Ajax Response
- Ext.ux.grid.RowExpander expand issue
- tbar font style
- Reload the Gridpanel!
- textfield formatting
- How to get "items" back after setting html of Panel?
- TreePanel - load all nodes at once?
- Ext.XTemplate conditional logic
- Layout error causes gridPanel to not appear
- Problem with Ext.Window and ToolBar.. I think :S
- Questions about focus.
- TreePanel, reload and save state
- What is wrong with json format ?
- How can create the startmenu using data from background in the desktop example
- Dynamically adding fields to Ext.DataStore?
- Set a Filter be Reloading a Store
- How to write grid data into JSONObject.
- How to load extjs datagrid in beteen a JSP page.
- [SOLVED] How select data in Ext.data.Store and to feed it in a formPanel ?
- Charts in card layout
- [INFOREQ][3.0.0] PagingToolbar displayMsg not updating when store is filtered.
- Get the selected value in the list view
- Running Extjs javascript locally (no server) ??
- Ajax request
- How to get a parent's height?
- Best Practices for High Frequency AJAX Polling
- How to create pre-determined groups in a grid
- ExtJS authorization best practice
- Cookie Values get escaped during POST request?
- HttpProxy - Use Post for all Requests
- How to replace window.open using "URL content-based" with Ext JS?
- Problem with Objects :(
- Need to create extJs Combo in extJs window
- BorderLayout collapseMode: 'mini'
- [ext3.0.0] Render Formpanel into Panel
- How to capture ENTER and ESC key to submit form
- EXTJS and Classic ASP
- Dynamic adding node in Tree panel
- Control the spacing between 'filedLabel' and radio button icon for 'xtype:radio'
- Problem with vtype validation + AJAX
- region collapsed by start
- Button with wider image and left align text
- Fire event when region is open
- Just an opinion: How to manage huge post requests?
- prevent DOS attack of submiting ajax forms
- Upgrading to ExtJS3.0: Problem with getComponentId
- table/div 100% height in ExtJS panels?
- Ext Chart - add series on the fly
- problem about filtering tree
- Horizontal scroll bar not working in grid
- Simple Id problem
|
https://www.sencha.com/forum/archive/index.php/f-40-p-12.html?s=0104a4645e2ae33571c718f910ebdea6
|
CC-MAIN-2020-05
|
refinedweb
| 1,514
| 52.9
|
Host configuration for Domain Name System (DNS) name queries typically consists of specifying one or more IPv4 or IPv6 addresses of DNS servers that service the queries on network interfaces. This configuration is typically done automatically for computers running Windows Vista or Windows Server 2008 through the use of the Dynamic Host Configuration Protocol (DHCP) or DHCP for IPv6 (DHCPv6). For computers running Windows Vista or Windows Server 2008, all DNS name queries for the entire DNS namespace go to the DNS servers configured through the network interfaces, hereafter known as interface-configured DNS servers.
Some technologies require special handling for name queries for specific portions of the DNS namespace. If the DNS name matches specified portions of the namespace, apply the special handling. If the DNS name does not match the specified portions of the namespace, perform a normal DNS query with interface-configured DNS servers. To address this need, Windows 7 and Windows Server 2008 R2 include the Name Resolution Policy Table (NRPT).
The NRPT contains rules configured by an administrator for either names or namespaces and the settings for the required special handling. When performing a DNS name resolution, the DNS Client service compares the requested name against each rule in the NRPT before sending a DNS name query. Queries and responses that match an NRPT rule get the specified special handling applied. Queries and responses that do not match an NRPT rule are processed normally; that is, the DNS Client service sends the name queries to interface-configured DNS servers.
In Windows 7 and Windows Server 2008 R2, DirectAccess and DNS Security Extensions (DNSSEC) require special handling for DNS name queries. When on the Internet, DirectAccess clients send DNS queries for intranet resources to the DNS servers specified in the NRPT. When resolving specific names or names within specific namespaces, typically high-value and secure intranet resources, the DNS Client service can use DNSSEC to ensure that the resolved name has been verified by the DNS server.
You can configure the NRPT with Group Policy through the Windows Registry (HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DnsClient\DnsPolicyConfig), or, for DirectAccess-based rules, by using the DirectAccess Setup wizard. There are no command-line interfaces for configuring the NRPT. For DNSSEC-based rules, Group Policy is the preferred method of configuration. For DirectAccess-based rules, the DirectAccess Setup wizard is the preferred method of configuration.
To configure the NRPT through Group Policy, use the Group Policy add-in at Computer Configuration\Policies\Windows Settings\Name Resolution Policy for the appropriate Group Policy object. Figure 1 shows an example.
Figure 1 The NRPT in Group Policy
From this Group Policy add-in, you can create a new NRPT rule and edit or delete existing rules. For each rule, you must specify the portion of the namespace to which it applies, whether the special handling for the rule is associated with a specific certification authority (CA), whether the rule is for DNSSEC and its associated settings, and whether the rule is for DirectAccess and its associated settings. There are also advanced global settings that apply to all Windows 7 and Windows Server 2008 R2-based DNS clients.
When specifying the namespace to which the rule applies, you can select Suffix, FQDN, Subnet (IPv4), Subnet (IPv6), Prefix, or Any. To specify DNS names that end with a specific multi-part string, select Suffix and type the suffix name. For example, for all DNS names that end in contoso.com, select Suffix and type contoso.com. To specify DNS names that begin with a specific single-part string, select Prefix and type the prefix name. For example, for all DNS names that begin with “secsvr,” select Prefix and type secsvr.
To specify all DNS names, select Any. A DirectAccess-based NRPT rule for Any is used only if the Computer Configuration\Policies\Administrative Templates\Network\Network Connections\Route all traffic through the internal network Group Policy setting is enabled for DirectAccess force tunneling. If a name matches multiple rules, the rule with the highest precedence is applied, and the order of precedence is FQDN, prefix, suffix, and then Any.
To specify DNS names for reverse resolution for an IPv4 subnet, select Subnet (IPv4) and type the IPv4 subnet prefix using network prefix length notation. For example, for all DNS names that end with 17.168.192.in-addr.arpa, select Subnet (IPv4) and type 192.168.17.0/24. To specify DNS names for reverse resolution for an IPv6 subnet, select Subnet (IPv6) and type the IPv6 subnet prefix. For example, for all DNS names that end with 1.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa, select Subnet (IPv6) and type 2001:db8:0:1::/64.
When you enable DNSSEC for a rule, you can specify whether the DNS Client service must ensure that the queried name response is verified by the DNS server and whether you want to use Internet Protocol security (IPsec) to protect DNS name query exchanges. For IPsec protection, you can specify No encryption (integrity only), Low: 3DES, AES (128, 192, 256), Medium: AES (128, 192, 256), and High: AES (192, 256). DES is the Data Encryption Standard and AES is the Advanced Encryption Standard.
When you enable DirectAccess for a rule, you can specify the IPv6 addresses of the set of intranet DNS servers to resolve names for DirectAccess clients when they are on the Internet; whether you want to use a Web proxy; and whether you want to use IPsec to protect DNS name query exchanges. You can specify the same set of options for IPsec protection.
You can view the configured set of NRPT rules on a computer running Windows 7 or Windows Server 2008 R2 with the netsh namespace show policy command. You can view the active set of NRPT rules with the netsh namespace show effectivepolicy command.
When you click Advanced Global Policy Settings, the NRPT Group Policy add-in displays the default Configure Advanced Global Policy Settings dialog box. Figure 2 shows an example.
Figure 2 The Configure Advanced Global Policy Settings dialog box
In Network Location Dependency, you can configure DirectAccess clients to use the network location server and intranet detection to determine when they are connected to the intranet; to always use DirectAccess-based NRPT rules; or to never use DirectAccess-based NRPT rules.
In Query Failure, you can enable query failure options and then configure whether to use local name resolution (Link-Local Multicast Name Resolution [LLMNR] and NetBIOS broadcasts) only if the DNS name query response indicates that the name does not exist; to use local name resolution if the name does not exist or the DNS servers are unreachable when located on a network with private IPv4 addresses; or to use local name resolution for any type of name resolution failure or error.
In Query Resolution, you can enable query resolution options and specify either to resolve names to IPv6 addresses or to resolve names to both IPv6 and IPv4 addresses.
You can use the netsh dns show state command to display the current configuration of these settings.
To minimize the number of NRPT rules, you want to specify namespaces that encompass as much of the relevant namespace as possible. However, you also might need to specify that individual names or namespaces within those namespaces be exempted from special handling. For these cases, you must configure an NRPT exemption. For example, you want to use DNSSEC for all DNS names within the secure.corp.contoso.com namespace, except for the DNS name waystation.secure.corp.contoso.com.
An NRPT exemption is a rule that specifies no special handling. For DNSSEC, the rule enables DNSSEC but does not require validation or IPsec protection. For DirectAccess, the rule enables DirectAccess but does not specify a set of intranet DNS servers, a Web proxy, or IPsec protection. DNS names for NRPT exemption rules are processed using interface-configured DNS servers.
An example of a required NRPT exemption is the FQDN rule for the DirectAccess network location server, which DirectAccess clients use to determine whether they are connected to the intranet. To send DNS name queries to intranet servers, the NRPT for DirectAccess clients have a suffix rule for the namespace of the intranet—for example, corp.contoso.com—with the IPv6 addresses of intranet DNS servers. The network location server is typically within the same namespace, for example, nls.corp.contoso.com. However, depending on your IPv6 infrastructure, the intranet DNS servers might not be reachable at the specified IPv6 addresses, but are reachable using the interface-configured IPv4 addresses.
Without an exemption rule, the DirectAccess client connected to the intranet attempts to resolve the name of the network location server over IPv6. Because the intranet DNS servers are not reachable, the DirectAccess client cannot reach the network location server and determines that it is on the Internet rather than the intranet. In this state, the DirectAccess client cannot reach intranet resources by name. Therefore, an exemption rule for the network location server (nls.corp.contoso.com) must be present so that intranet detection can conclude successfully. The DirectAccess Setup wizard automatically creates NRPT rules for the intranet name space and the exemption for the network location server.
Here is how the name resolution process works for Windows 7 and Windows Server 2008 R2:
The NRPT in Windows 7 and Windows Server 2008 R2 allow you to specify the special handling for DNS name queries required for DNSSEC and DirectAccess in the form of rules, with the ability to specify namespaces, prefixes, FQDNs, and exemptions.
The Contoso Corporation uses the DNS namespace contoso.com for Internet DNS names and corp.contoso.com for intranet DNS names. The network location server uniform resource locator (URL) is and the DirectAccess server has been configured with the DNS server IPv4 address of 10.0.0.1 on its intranet interface. Based on this configuration, the DirectAccess Setup wizard creates two NRPT rules enabled for DirectAccess:
Here is an example of how these rules display on a DirectAccess client with the netsh namespace show policy command:
Settings for nls.corp.contoso.com
----------------------------------------------------------------------
Certification authority : DC=com, DC=contoso, DC=corp,
CN=corp-DC1-CA
DNSSEC (Validation) : disabled
DNSSEC (IPsec) : disabled
DirectAccess (DNS Servers) :DirectAccess
(IPsec) : disabled
DirectAccess (Proxy Settings) :Bypass proxy Settings for .corp.contoso.com
----------------------------------------------------------------------
Certification authority :DC=com, DC=contoso, DC=corp,
CN=corp-DC1-CADNSSEC
(Validation) : disabledDNSSEC
(IPsec) : disabledDirectAccess
(DNS Servers) : 2002:836b:2:1:0:5efe:10.0.0.1DirectAccess
(IPsec) : disabledDirectAccess
(Proxy Settings) : Bypass proxy.
|
https://technet.microsoft.com/en-us/magazine/ff394369.aspx
|
CC-MAIN-2015-18
|
refinedweb
| 1,767
| 50.77
|
<configuration> <system.web> <compilation debug="true" targetFramework="4.0" defaultLanguage="c#" /> </system.web> </configuration>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; namespace IasobergDataDrivenWebsite { public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } private void bnLogin_Click(object sender, EventArgs e) { Response.Redirect("Home.aspx"); } } }
<%@ Page </asp:Content> <asp:Content <p> username <asp:TextBox</asp:TextBox> </p> <p> password <asp:TextBox</asp:TextBox> </p> <p> <asp:Button </p> <Click event for bnLogin is missing in "Default.aspx " . Please add the OnClick event to btnLogin . Please check the below Code. OnClick="bnLogin_Click"
Open in new window
That code was contained in the Default.aspx.cs code yet I entered it in the Default.aspx as you suggested:
Open in new windowand I got this error:
Thanks for your assistance!
Bette
Open in new window
Note: Both Tapan's change in the mark up and code above are needed for the click to work.
Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.
since, your button ID is "Button1" then OnClick event should be "Button1_Click" in Default.aspx .
Please replace OnClick="bnLogin_Click" to OnClick="Button1_Click"
code for the Default.aspx.cs should be
private void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Home.as
}
code for the Default.aspx should be:
Open in new window
code for the Default.aspx.cs should be:
Open in new window
Experts Exchange Solution brought to you by
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.Start your 7-day free trial
Sorry for delay -- I was out of town.
I had been troubleshooting so much that I failed to rename Button1 to my original name of bnLogin -- thanks for picking that up -- nevertheless, your code still does not work. I copied and pasted it into my Default.aspx and Default.aspx.cs pages (see pics below) and this time I got build errors.
Any ideas?
thanks for your help :-)
There is no need to change the event name as long as both mark up and code are using the same name.
(which had no build errors) and substituted your code of "protected" for private.
This time all appeared OK except my original problem of not redirecting to Home.aspx. I put 2 breakpoints -- the code ran through the first one yet stopped before it got to the second.
You can see I had your code change. The next images are the outputs -- perhaps that will help troubleshoot.
set breakpoints
Open in new window
The thing is, Tapan suggested the bnLogin_Click in the earlier post yet failed to tell me to replace the "Private" with the "Protected" -- your new suggestion.
I will have to split the solution between the two of you since Tapan got the bn_Login_Click first and you got the "Protected."
Thank you both VERY VERY much!!!!
Now I am going to see if I can attach this code to my database. If I cannot, look for my new question -- both of you are very helpful!!
Thanks again!!
Bette
|
https://www.experts-exchange.com/questions/28693451/private-void-bnLogin-Click-object-sender-EventArgs-e-does-not-work-in-Visual-Studio-2010.html
|
CC-MAIN-2018-51
|
refinedweb
| 554
| 68.26
|
5.4: Setting Up the Buttons
- Page ID
- 14695
def main(): global FPSCLOCK, DISPLAYSURF, BASICFONT, RESET_SURF, RESET_RECT, NEW_SURF, NEW_RECT, SOLVE_SURF, SOLVE_RECT pygame.init() FPSCLOCK = pygame.time.Clock() DISPLAYSURF = pygame.display.set_mode((WINDOWWIDTH, WINDOWHEIGHT)) pygame.display.set_caption('Slide Puzzle') BASICFONT = pygame.font.Font('freesansbold.ttf', BASICFONTSIZE) # Store the option buttons and their rectangles in OPTIONS. RESET_SURF, RESET_RECT = makeText('Reset', TEXTCOLOR, TILECOLOR, WINDOWWIDTH - 120, WINDOWHEIGHT - 90) NEW_SURF, NEW_RECT = makeText('New Game', TEXTCOLOR, TILECOLOR, WINDOWWIDTH - 120, WINDOWHEIGHT - 60) SOLVE_SURF, SOLVE_RECT = makeText('Solve', TEXTCOLOR, TILECOLOR, WINDOWWIDTH - 120, WINDOWHEIGHT - 30) mainBoard, solutionSeq = generateNewPuzzle(80) SOLVEDBOARD = getStartingBoard() # a solved board is the same as the board in a start state.
Just like in the last chapter, the functions called from the
main() function calls will be explained later in the chapter. For now, you just need to know what they do and what values they return. You don’t need to know how they work.
The first part of the
main() function will handle creating the window, Clock object, and Font object. The
makeText() function is defined later in the program, but for now you just need to know that it returns a
pygame.Surface object and
pygame.Rect object which can be used to make clickable buttons. The Slide Puzzle game will have three buttons: a "Reset" button that will undo any moves the player has made, a "New" button that will create a new slide puzzle, and a "Solve" button that will solve the puzzle for the player.
We will need to have two board data structures for this program. One board will represent the current game state. The other board will have its tiles in the "solved" state, meaning that all the tiles are lined up in order. When the current game state’s board is exactly the same as the solved board, then we know the player has won. (We won’t ever change this second one. It’ll just be there to compare the current game state board to.)
The
generateNewPuzzle() will create a board data structure that started off in the ordered, solved state and then had 80 random slide moves performed on it (because we passed the integer
80 to it. If we want the board to be even more jumbled, then we can pass a larger integer to it). This will make the board into a randomly jumbled state that the player will have to solve (which will be stored in a variable named
mainBoard). The
generateNewBoard() also returns a list of all the random moves that were performed on it (which will be stored in a variable named
solutionSeq).
|
https://eng.libretexts.org/Bookshelves/Computer_Science/Programming_Languages/Book%3A_Making_Games_with_Python_and_Pygame_(Sweigart)/05%3A_Slide_Puzzle/5.04%3A_Setting_Up_the_Buttons
|
CC-MAIN-2022-21
|
refinedweb
| 432
| 71.85
|
This is the age of AI. Hence, you want to automate a certain business process, let’s say, for instance, email classification. So, you have built a Machine Learning model. The metrics look great and business users are happy. Now what?
You decide that it’s time to go live with the model. Hence, you get the infrastructure ready and deploy your machine learning model. It has an endpoint that receives email messages to be scored against your model. In the beginning, everyone is happy, since automation has kicked in. But shortly, you receive complaints about the misclassification. Over time, the numbers grow and you wonder what may have gone wrong. What is causing the drift from the expected performance? Most probably, it is ‘Drift’ in Machine Learning Models.
Concept vs Data Drift
They made machine learning algorithms to model uncertainties of the actual world. Thus, they change. They call this dynamic nature of ML models is Drift. Drift in Machine Learning occurs in two forms: concept drift and data drift.
Concept drift happens when a new business scenario emerges, which was non-existent in the model building process. It is likely that users change their behaviour over time, thus causing new patterns to emerge. In simple words, the relationship between X and y changes. An example of this could be users using their credit cards excessively in the face of a black swan event like COVID-19. In the email classification example, a new category may come up.
As far as Data drift is concerned, it results from changing Features, which is typically unseen in the Modeling Phase. For instance, in the email classification example, people may use synonyms of a word from the dictionary. In simpler term, here X changes. This may happen because of either a non-stationary environment or, in a big data scenario, the training data is not representative of the population.
Data Drift in Azure Machine Learning
Having learnt what is Data Drift and Concept Drift, wouldn’t it be great if we can detect the same? Fortunately, with the democratization of Machine Learning, we have tools at our disposal to ease our life. One of them is Azure Machine Learning. So, how useful is Azure Machine Learning in detecting Drift? We found no way to detect concept drift. However, we have a way to detect data drift.
Setting up
We assume you are familiar with Azure Machine Learning. If not, refer to this link. Azure Machine Learning is Microsoft Azure’s flagship ML as a service platform for training, deployment, orchestration, monitoring Machine Learning models. In this article, we will focus on the monitoring aspect of ML.
One feature of Azure Machine Learning is the Azure ML SDK, which is a custom python library by Microsoft. It comprises a library called azureml-datadrift.
But, before that, let’s perform some housekeeping. Assuming that you have created an AML workspace, first create a compute. You can either use a CLI or the Azure ML studio. To create your compute, refer to this link.
After creating the compute, click on Jupyter. It will open a Jupyter environment.
Next, create your folder and open a terminal to clone this git repository. For detailed instructions, refer to this link.
Creating baseline dataset
Once you are ready with the setup, navigate to the folder in which you have cloned the above repository and open notebook 17 – Monitor Data Drift.
The first step checks for the azureml-datadrift library.
!pip show azureml-datadrift
Next, connect to the Azure ML workspace using the following script.
from azureml.core import Workspace # Load the workspace from the saved config file ws = Workspace.from_config() print('Ready to work with', ws.name)
Now, comes the important step of creating a dataset. A dataset is like a data view created from a datastore. A datastore is a linked service or a connection to any data source like Azure Blob store, Azure SQL DB, Azure Data Lake store, etc. To read more about it, read this link on datastores.
We can create datasets using either code or studio. We will use the former.
Here, the toy data diabetes is in the data folder of the cloned repository. We will create a dataset using this data.
The next script will create a data set using the two files. First, it will upload the data to the workspace blob store and create a view on top of it.
from azureml.core import Datastore, Dataset # Upload the baseline data default_ds = ws.get_default_datastore() default_ds.upload_files(files=['./data/diabetes.csv', './data/diabetes2.csv'], target_path='diabetes-baseline', overwrite=True, show_progress=True) # Create and register the baseline dataset print('Registering baseline dataset...') baseline_data_set = Dataset.Tabular.from_delimited_files(path=(default_ds, 'diabetes-baseline/*.csv')) baseline_data_set = baseline_data_set. register(workspace=ws, name='diabetes baseline', description='diabetes baseline data', tags = {'format':'CSV'}, create_new_version=True) print('Baseline dataset registered!')
This creates our baseline dataset.
Creating Target dataset
For simulation, we will create a target dataset and add certain drift to the data week over week for the past 7 weeks. Fundamentally, you create a time series dataset using this method. Below is the code to do the same.
import datetime as dt import pandas as pd print('Generating simulated data...') # Load the smaller of the two data files data = pd.read_csv('data/diabetes2.csv') # We'll generate data for the past 6 weeks weeknos = reversed(range(6)) file_paths = [] for weekno in weeknos: # Get the date X weeks ago data_date = dt.date.today() - dt.timedelta(weeks=weekno) # Modify data to create some drift data['Pregnancies'] = data['Pregnancies'] + 1 data['Age'] = round(data['Age'] * 1.2).astype(int) data['BMI'] = data['BMI'] * 1.1 # Save the file with the date encoded in the filename file_path = 'data/diabetes_{}.csv'.format(data_date.strftime("%Y-%m-%d")) data.to_csv(file_path) file_paths.append(file_path) # Upload the files path_on_datastore = 'diabetes-target' default_ds.upload_files(files=file_paths, target_path=path_on_datastore, overwrite=True, show_progress=True) # Use the folder partition format to define a dataset with a 'date' timestamp column partition_format = path_on_datastore + '/diabetes_{date:yyyy-MM-dd}.csv' target_data_set = Dataset.Tabular.from_delimited_files(path=(default_ds, path_on_datastore + '/*.csv'), partition_format=partition_format) # Register the target dataset print('Registering target dataset...') target_data_set = target_data_set.with_timestamp_columns('date').register(workspace=ws, name='diabetes target', description='diabetes target data', tags = {'format':'CSV'}, create_new_version=True) print('Target dataset registered!')
To check how the target dataset looks like, convert it into Pandas Dataframe.
df = target_data_set.to_pandas_dataframe()
Creating a Data Drift Monitor
Before creating a Data Drift Monitor, create a compute cluster and connect to it using the following code:
from azureml.core.compute import ComputeTarget, AmlCompute from azureml.core.compute_target import ComputeTargetException cluster_name = "<your-cluster-name>" try: # Check for existing compute target training) training_cluster = ComputeTarget.create(ws, cluster_name, compute_config) training_cluster.wait_for_completion(show_output=True) except Exception as ex: print(ex)
Next, create a data drift monitor. This specifies the baseline and target dataset to be compared along with properties like frequency of monitoring, compute cluster, feature list, etc.
from azureml.datadrift import DataDriftDetector # set up feature list features = ['Pregnancies', 'Age', 'BMI'] # set up data drift detector monitor = DataDriftDetector.create_from_datasets(ws, 'mslearn-diabates-drift', baseline_data_set, target_data_set, compute_target=cluster_name, frequency='Week', feature_list=features, drift_threshold=.3, latency=24) monitor
Backfill the Data Drift Monitor
Now, in order to analyze data drift trends over time, you need to find a backfill job from your data drift monitor. This backfill job run will analyze how data has drifted over a time frame. The backfill function takes start date and end date as parameters and uses the time series data created above to generate the drift analysis.
from azureml.widgets import RunDetails backfill = monitor.backfill(dt.datetime.now() - dt.timedelta(weeks=6), dt.datetime.now()) RunDetails(backfill).show() backfill.wait_for_completion()
Finally, after running the backfill job, Analyze the data drift:
drift_metrics = backfill.get_metrics() for metric in drift_metrics: print(metric, drift_metrics[metric])
However, you can view a graphical representation of the backfill run in Azure ML studio.
Conclusion
Hope you find this article helpful. This is only for information. We do not claim any guarantees whatsoever.
Also read: The Azure Machine Learning Designer
Note. All the code has been sourced from the Github link mentioned in the article.
|
https://www.data4v.com/how-to-detect-data-drift-in-azure-machine-learning/
|
CC-MAIN-2022-05
|
refinedweb
| 1,357
| 50.63
|
The ability to watch the progress of a program's execution line by line is important, but debugging would be much harder if we were not also able to examine the program's state. Visual Studio .NET therefore provides us with a range of tools for examining a process's memory. We can access global variables, the stack (which contains local variables and parameters of the currently executing method and its callers), and raw memory.
Several windows can be used to display variables and expressions while single-stepping through code in the debugger. They all work in more or less the same way, displaying the name, value, and type of a number of expressions. They are all dockable tool windows. They all keep their value displays up-to-date as you single-step through the code, highlighting any changed values in red. The only difference between these various windows is the exact selection of expressions displayed.
A watch window is a grid into which you can type arbitrary expressions. These will be evaluated whenever code is halted in the debugger and updated as you single-step. All expressions are evaluated with respect to the scope of the current line of code.
Figure 3-20 shows a watch window with two expressions. (New expressions are added by typing into the Name column in the blank line at the bottom of the grid.) The first expression, this, illustrates that the watch window allows objects to be expanded so that the individual fields can be shown. The second expression, ((Button) sender).Text, illustrates that we are not restricted to simple variable namesthis is a snippet of C# that performs a cast on a variable and then retrieves a property.
Remember that in .NET, properties are really functions, so the implication is that expressions in watch windows are able to cause code to be executed. This is indeed the case, and you can even include method calls inside the expressions that you want to be evaluated. You should exercise caution when doing thisin particular, you don't want the presence of your watch window expression to have side effects that modify the program's operation.
The watch window in Figure 3-20 is labeled Watch 1. You can have up to four watch windows open. These can be opened from the Debug Windows Watch menu. Expressions will stay in the windows until you delete them; they persist across debug sessions. If you write an expression that makes sense in only a particular scope, Visual Studio .NET will display an error message in that line of the watch window, but this is easily ignored. It doesn't do anything disruptive like opening an error dialog, so it is common practice to leave useful but context-specific expressions in place and to ignore the errors when debugging in a different context.
Watch windows are not read-onlyyou can change the values of watched expressions. (The expressions must be writable, of course; you can't meaningfully change the value of an expression that calls a method.) This allows you to modify the values of parameters and local variables, which may be useful for experimenting with the behavior of the code you are debugging. This can be especially useful for checking the behavior of error-handling code when it is difficult to generate the error conditions by normal program execution. (Of course, this is no substitute for good unit testing, but it is a useful extra tool to have available.)
Watch windows require you to type in the expressions that you want to evaluate. The Autos, Locals, and This windows are essentially watch windows that provide a useful sets of expressions without the need for you to type anything.
The This window (Debug Windows This) is fairly self-explanatory. (At least it is for C++ and C# developers; for Visual Basic .NET programmers, the Me window might have been a better name.) It is simply a watch window with a single fixed expression, the this (or Me) reference. The Locals window is also straightforward. It is a watch window that shows all local variables and parameters currently in scope.
Although the This and Locals windows are useful, they can often provide information overload. Complex code may have so many locals and object members that you will continually be scrolling these windows to find the values you care about for the current line of code. The Autos window attempts to alleviate this.
The Autos window guesses which expressions in the current line of code would be useful for you to see. It seems to use a heuristic that includes any variables that are used on this line or its immediate neighbors and any variables explicitly modified by the last line that executed. (Implicit side effects are not shown, since these could be arbitrarily extensive if the previous line made any function calls.)
Figure 3-21 shows a typical selection of variables from the Autos window. Both the count and total variables were modified on the previous line, so it has shown these. (It has colored them red, to draw attention to the fact that they have just changed.) It also shows the expressions that will be used on the line about to be executed.
The Autos window is extremely useful. It shows all of the expressions you need to see most of the time. This, in conjunction with the fact that you can evaluate any expression visible in a source code window merely by hovering the mouse over it, means that you will rarely need anything else. (Sometimes the Autos heuristic doesn't guess at all the things you need, in which case watch windows are very useful, but most of the time you will need only Autos.)
The ability to evaluate expressions while debugging is very powerful. Unfortunately, in some situations expressions cannot be usedthe debugger requires a certain amount of symbolic information[3] in order to perform expression evaluation. Sometimes you will find yourself in a situation with no such information available, either because you needed to attach a debugger to a release build or because an error occurred in a third-party or OS component for which source code and symbols are simply unavailable.
[3] Symbolic information is data about named items such as functions, variables, and parameters. Compilers usually discard such information in release buildsexecutable code deals with raw data and has no need for the symbolic names used to represent the data in source code.
This makes life much harder, but it is still possible to debug code in these circumstances. You must drop back to the old-fashioned techniques of assembly-level debugging, but that is better than nothing. To make sense of single-stepping through assembly language, you will need to examine the contents of the CPU's registers. Visual Studio .NET has a window for precisely this purpose, the Registers window. It can be displayed with Debug Windows Registers (Ctrl-Alt-G). It simply displays the current values of all of the CPU's registers, as Figure 3-22 shows. Old-time developers will appreciate the retro feel of this window (although probably not as much as they will appreciate not having to use it most of the time).
There is a popular reason for wanting to look at register values even when full symbolic information is available to the debugger. If you are debugging some classic unmanaged (non-.NET) Win32 code that has less than thorough error handling, you will often find that the author of the code did not store the return code of an API that you suspect may have failed. The fact that she did not store it in a variable does not, however, prevent you from finding out what it was: you can rely on the fact that the EAX register is used to hold the return value of most methods. So if you suspect that an unchecked error is the cause of your complaints, simply examine the EAX register immediately after the call.
In fact, you don't need to use the Registers window at all to do this. If you are running in native mode (i.e., not .NET), you can simply type EAX into a watch window. Better than that, you can type EAX,hr. This informs the watch window that the value should be interpreted as an error code. Visual Studio .NET will then look up the error number to see if it is either a well-known COM HRESULT, or a standard system error code, and will display some explanatory text for the error. Another useful trick is that you can type @hr, hr, which will display the value returned by the GetLastError API, along with a text explanation when available. These tricks are not available when debugging .NET applications, but since .NET uses exceptions for most error handling, these kinds of problems tend not to arise so often.
A program's state consists of more than just the location of the next line to be executed and the values of local and global variables. How it got to its current position is also important. Very often when debugging some code, the most interesting questions are not of the form "what is happening here?" but more along the lines of "how did we get to this state in the first place?" Unfortunately, Visual Studio .NET cannot provide you with a complete history of every step of your program's execution, but it can tell you which method called the current method and which called that and so on all the way back up to the start of the thread. It can even take you to the source code location of every call and show the local variables in scope for each call in the chain.
This information is visible in the Call Stack window. This can be displayed with Debug Windows Call Stack (Ctrl-Alt-C). Figure 3-23 shows an example. You can examine the code for any entry on the call stack by double-clicking on it. Visual Studio .NET will take you to the next line that will execute when the code returns to the function in question (i.e., it will highlight the line after the call currently in progress). The lines shown in gray are those for which Visual Studio .NET does not have source code informationif you attempt to show the source code by double-clicking on these, you will instead be shown disassembly for that location. The example here is fairly typical for a Windows Forms applicationmost of the code is inside the Windows Forms Framework, with the application's main method visible at one end and an event handler at the other.
Native Win32 applications don't always display such a complete call stack when symbols are not available. .NET programs run in a managed environment that knows about which methods are called and what types are in use. In Win32, this is not guaranteed, so be prepared for the call stack to be absent, uninformative, or even misleading when it delves into areas outside of your own codeoptimized code often doesn't provide all of the information the debugger needs, so Visual Studio .NET is not always able to interpret the entire call stack correctly. (Although be aware that you can download debugging symbols for most Windows system DLLs from Microsoft's web site, which can considerably improve the readability of native call stacks.)
As well as double-clicking on entries in the call stack to go to the listed functions, you can select a line in the call stack and press F9 to set a breakpoint. This will create a breakpoint that is positioned so that it gets hit when execution returns to the selected function.
Just as you will not always have access to source for the code you wish to debug, you may not always have the symbolic information you require to view state using expressions. And just as Visual Studio .NET can drop back to disassembly when the source code is not present, it can also provide you with access to raw memory when you cannot use expressions.
Memory windows simply provide a hexadecimal dump of the memory at the address of your choice. As with watch windows, you can have up to four memory windows open, which can be displayed using Debug Windows Memory.
Figure 3-24 shows a memory window. By default, Visual Studio .NET will display as many bytes as will fit across the window. However, it is often useful to fix the column size to something more regular since this can make it easier to see patterns in the data. So the drop-down list labeled Columns can be used to set an explicit width. It provides a list of various powers of two (2, 4, 8, 16, etc.), which are popular choices, but you can type in any value you like.
By default, memory will be shown in 1-byte units. However, it is often useful to group the display into larger units. The window's context menu allows you to group numbers into 2-byte or 4-byte integers. (Since Intel's processors are little-endian, this is useful, because it saves you from reversing the order of the bytes in your head.) It also allows you to make the window interpret the data as 32-bit or 64-bit floating point numbers.
Next to the Address field is a tool button with two small arrows. This button is relevant only if you type an expression (instead of a constant) into the Address field. If the button is not pressed (the default), any expression you type into the Address field will be evaluated just once when you type it. (In fact, the expression will be replaced with its value when you press Return.) If the button is clicked, however, the expression you typed in will remain in the Address field and will be reevaluated each time the debugger halts at a breakpoint or each time you step over a line of code. So if you type in the name of a pointer variable, the window will always display whatever memory the pointer points to, even if the pointer changes.
The various windows Visual Studio .NET supplies for observing your program's state are very useful, but they all suffer from two limitations. First, you can use them only when the program is suspended in the debuggertheir contents all vanish when the program is running freely. Second, they cannot show you any historical informationthey can show you only the current status.
The Output window does not suffer from either of these restrictions. It is visible during normal execution and can even be viewed after the program has terminated. And once items have been shown in the Output window, they remain there until you clear the window explicitly (or start a new debugging session). The price of this is that the Output window is a little less sophisticated than the other windows we have seen so farit can show only text. But its ability to function without needing to halt execution makes it an invaluable debugging tool.
Figure 3-25 shows the Output window. Visual Studio .NET itself sends certain messages to this window. For example, here you can see the messages it displays when DLLs are loaded by the program.
The final line shown in Figure 3-25 is a custom message generated by the author of the program by including the following code at some appropriate point in the code:
Debug.WriteLine(string.Format("Button1 clicked - count: {0}", count));
This C# code uses the Debug class in the System.Diagnostics namespace. Calls to this API will be compiled into only debug builds. The Trace class allows you to generate output in release builds. So this code will generate debug output in all builds:
Trace.WriteLine(string.Format("Button1 clicked - count: {0}", count));
Note that, unlike the Console.WriteLine method, Debug.WriteLine does not support string formatting with variable length argument lists. If you need to place dynamic information in your output, you must use the String class's Format method as shown here.
Classic Win32 applications can send messages to this window too, using the OutputDebugString API. You would normally use this API indirectly through macros such as MFC's TRACE or ATL's ATLTRACE. As with the .NET Debug class, these macros generate output only in debug builds.
The Modules window allows you to see which modules (DLLs and EXEs) have been loaded in the current debug session. It also allows you to see which of them Visual Studio .NET has found debug symbols for and to control where it looks for symbol files.
You can display the Modules window with Debug Window Modules (Ctrl-Alt-U). As Figure 3-26 shows, the window displays a considerable amount of information for each loaded module. It shows the filename, the address at which it has been loaded, the file path, the order in which the modules were loaded in this particular process, the version and timestamp of each module, and the process in which the module is loaded (this is used in multiprocess debugging). It also shows whether debug symbols have been loaded for the DLL.
If you are debugging code from just one project, you will probably not need to use the Modules window much, but if your program uses multiple components from many projects, this window is extremely useful. It enables you to find out exactly which components got loaded. (For complex build environments, it is not always trivial to work out exactly where a component will be loaded from, so the ability to find out exactly which one is running is important.)
A common problem that occurs in debugging large componentized applications is that Visual Studio .NET might not be able to locate the debug information it requires for all components automatically. Fortunately, the Modules window enables you to tell Visual Studio .NET where the symbols areif you right-click on a module and select Reload Symbols..., you will be shown a dialog that lets you choose the .pdb file that contains the symbols. You can even do this with modules for which Visual Studio .NET has already loaded symbolsthis is useful because under certain circumstances, the wrong symbols may get loaded.
|
http://etutorials.org/Programming/Mastering+visual+studio+.net/Chapter+3.+Debugging/3.3+Observing+State/
|
CC-MAIN-2018-13
|
refinedweb
| 3,063
| 62.17
|
import pygame
#Colors, Allways you need colors!!!!
BLACK = ( 0, 0, 0)
GREEN = ( 0, 255, 0)
WHITE = ( 255, 255, 255)
RED = ( 255, 0, 0)
ORANGE = ( 255, 115, 0)
YELLOW = ( 242, 255, 0)
BROWN = ( 115, 87, 39)
PURPLE = ( 298, 0, 247)
GRAY = ( 168, 168, 168)
PINK = ( 255, 0, 234)
BLUE = ( 0, 0 , 255)
pygame.init()
# Screen
screen = pygame.display.set_mode([700,500])
#Name of thewindow
pygame.display.set_caption("Trial to make PONG")
# Any variables!
x_speed = 0
y_speed = 0
x_coord = 10
y_coord = 250
x = 670
y = 250
other_speed = 0
other_speed2 = 0
rect_x = 50
rect_y = 50
rect_change_x = 5
rect_change_y = 5
clock = pygame.time.Clock()
#Sounds,maybe needed?
#Main Loop__________
done = False
while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
# User pressed down on a key
elif event.type == pygame.KEYDOWN:
# Figure out if it was an arrow key. If so
# adjust speed.
if event.key == pygame.K_UP:
y_speed = -5
elif event.key == pygame.K_DOWN:
y_speed = 5
elif event.key == pygame.K_w:
other_speed2 = -5
elif event.key == pygame.K_s:
other_speed2 =
elif event.key == pygame.K_w or event.key == pygame.K_s:
other_speed2 = 0
# Move the object according to the speed vector.
x_coord += x_speed
y_coord += y_speed
x += x_speed
y += other_speed2
screen.fill(BLACK)
pygame.draw.rect(screen,BLUE,[x_coord,y_coord,20,60])
pygame.draw.rect(screen,YELLOW,[x,y,20,60])
if x > 650 or x < 0:
# Draw the rectangle
pygame.draw.ellipse(screen, BLUE, [rect_x, rect_y, 50, 50])
# Move the rectangle starting point
rect_x += rect_change_x
rect_y += rect_change_y
if rect_x > 650 or rect_x < 0:
rect_change_x = rect_change_x * -1
if rect_y > 450 or rect_y < 0:
rect_change_y = rect_change_y * -1
pygame.display.flip()
clock.tick(60)
pygame.quit()
Ok so I have 2 paddles in this pong game called Blue and yellow rectangle. I can move them but they move off the screen. How do I prevent that. Iv looked online but nothing seems to be working. I thought about putting rectangles around the screen to make a collision point argument where when the Blue/Yellow paddle hit it they won't move any further, but im not sure how to do that with ought ruining the code? Thank you for your help..
You should check to see if it's off the edge of the screen before you change the y coordinate. See
if y_coord + y_speed >= 0 and y_coord + y_speed + 60 <= 500: y_coord += y_speed
Though as you can see it can get a little confusing to use numbers, which is why you should avoid hard-coding. It's better to have a
display_height,
display_width, and
y_speed variable. Basically, outside of initializing variables, you should only have 0s as numbers. Also, note what happens when you leave out
+ y_speed in the if statement.
I suggest you start using the
Rect class, since it makes handling such cases easy. Also, your code will become cleaner and shorter.
Here's an example of using
Rect. Note that I simply use
clamp_ip to ensure the player paddles can't leave the screen:
import pygame BLACK = pygame.color.Color('Black') YELLOW = pygame.color.Color('Yellow') BLUE = pygame.color.Color('Blue') pygame.init() screen = pygame.display.set_mode([700,500]) screen_rect = screen.get_rect() pygame.display.set_caption("Trial to make PONG") blue_rect = pygame.Rect(10, 250, 20, 60) yellow_rect = pygame.Rect(670, 250, 20, 60) ball_rect = pygame.Rect(50, 50, 50, 50) ball_x_speed = 5 ball_y_speed = 5 clock = pygame.time.Clock() done = False while not done: for event in pygame.event.get(): if event.type == pygame.QUIT: done = True # check all pressed keys and move the paddles pressed = pygame.key.get_pressed() if pressed[pygame.K_UP]: blue_rect.move_ip(0, -5) if pressed[pygame.K_DOWN]: blue_rect.move_ip(0, 5) if pressed[pygame.K_w]: yellow_rect.move_ip(0, -5) if pressed[pygame.K_s]: yellow_rect.move_ip(0, 5) # ensure paddles stay on screen blue_rect.clamp_ip(screen_rect) yellow_rect.clamp_ip(screen_rect) # move the ball ball_rect.move_ip(ball_x_speed, ball_y_speed) # check if the ball needs to change direction if ball_rect.x + ball_rect.width > screen_rect.width or ball_rect.x < 0: ball_x_speed = ball_x_speed * -1 if ball_rect.y + ball_rect.height> screen_rect.height or ball_rect.y < 0: ball_y_speed = ball_y_speed * -1 # draw everything screen.fill(BLACK) pygame.draw.ellipse(screen, BLUE, ball_rect) pygame.draw.rect(screen,BLUE, blue_rect) pygame.draw.rect(screen,YELLOW, yellow_rect) pygame.display.flip() clock.tick(60) pygame.quit()
It seems like you're setting the height of the screen to be 500 pixels. Maybe you could check if your paddles are at the limit of the screen before moving them.
newY = y_coord + y_speed if newY >= 0 and newY + PADDLE_HEIGHT < SCREEN_HEIGHT: y_coord = newy
|
http://www.dlxedu.com/askdetail/3/6dfea296ba383f794e995845a1ee02d7.html
|
CC-MAIN-2018-22
|
refinedweb
| 751
| 70.29
|
Copyright ©2005 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This document specifies a new language for introducing temporal control to XML documents. The XML Timing language (Timesheets) is included as a distinctive section in a document and it assigns the timing information to the elements in the other sections of the document, in the same way the Cascading Style Sheets assign spatial properties to the elements.
Compared to SMIL, the XML Timing language can be seen as a different approach to the timing of XML documents. It reuses a subset of timing primitives from the Timing and Synchronization module of SMIL 2.0, but separates content, styling and timing for easier authoring and maintenance of multimedia documents.
By publishing this document, W3C acknowledges that Helsinki Univerisity of
3 Definitions
3.1 Timesheet element
3.2 Media element
4 Attributes
4.1 The begin attribute
4.2 The dur attribute
4.3 Syntax of the time related attributes
4.4 The repeat attribute
5 Elements
5.1 The timesheet element
5.2 The par element
5.3 The seq element
5.4 The excl element
5.5 The item element
6 Semantics of the timing model
7 Events
7.1 Internal events
7.2 User events
7.3 Event semantics
7.4 Additional events
8 Annotated examples
8.1 Simple without events
8.2 With internal events
8.3 With user events
9 Integration with CSS layout
10 Implementations
11 Future work
12 References
13 Acknowledgements
This document defines the features and syntax for XML Timing language. The objective of the language is to define temporal styling for XML documents. Synchronized Multimedia Integration Language (SMIL) is widely used for authoring multimedia presentations. However, SMIL has some limitations when used as a common multimedia declaration language for all XML documents [Timesheets]. For instance, if a document consists of several XML languages, they cannot be properly combined with SMIL. In addition, it has predefined layout model. Also, the desire of keeping content and presentational aspects of a document separate does not realize when using SMIL. The original design principle of XML is fulfilled if content and spatial and temporal styling of a document are separated to three functional sections.
Timesheets can be seen as a temporal counterpart for Cascading Style Sheets (CSS). Whereas CSS defines the spatial layout of the document and formatting of the elements, Timesheets specify what elements are active at a certain moment. And as with CSS, Timesheets can be reused in multiple documents, which can provide a common temporal layout for multimedia presentations with different contents but identical storylines. The document can be shown in a user agent even if the Timesheets are not supported, since the contents and the layout are still governed by the document itself. Of course, the temporal aspect of the document is then lost, since all the elements are active all the time.
A simple example of the Timesheets is shown in section 8.1 Simple without events. It shows a general XHTML document, which represents a single slide from a slideshow. When the document is viewed, first only the title "Introduction" and the page number are shown. Then, after two seconds, the text of the first bullet is shown, followed by other bullet in two seconds intervals. The placement and styling of the elements are specified in the CSS, while the Timesheet only specify the visibility of the elements at a given moment of time.
An XML document may contain one or more Timesheets. The
elements under these Timesheets are referred to as Timesheet
elements. A timesheet element may be a time container,
which has other timesheet elements as its children, or an
item element, which references to one or more Media
elements (cf. Section 3.2 Media element). Timesheet elements are said to be active when
the they have a resolved activation time, otherwise they are
inactive.
Media element is an element that takes part in the
layout of the XML document. They usually represent visual or
audible content that is shown when the document is presented. Also,
elements that control the structure of the document (
div
element in XHTML, for example) are media elements. Media element
is said to be visible when the contents of the element is either
visible or audible.
Media elements can be divided into two separate groups according to the type of content they represent.
Static media elements represent content that has no implicit duration. These elements include the document structure elements and elements defining textual content and images.
Dynamic media elements represent content that may have an implicitely defined duration. This type of content include video and audio. In some cases, the duration of dynamic media may also be indefinite (streaming content, for example).
From the timesheet's point of view, the static and dynamic elements are treated differently. For the static elements, the author has to explicitely define the duration, otherwise the element will be shown an indefinitely long time. The duration of the dynamic elements is defined, so the author doesn't need to explicitely define it for them. Dynamic elements stop and become inactive when their content stops.
This section defines the common attributes that are used by the elements in the timing language. The syntax of the attributes follows the SMIL 2.0 Timing and Synchronization Module specification [SMIL 2.0 Timing], althought the semantics of the attributes may differ (cf. Section 6 Semantics of the timing model).
Time related attributes
beginattribute
The
begin defines the start time of the element,
relative to the scheduled activation of the element. Under a
parallel time container the time is relative to the beginning of
the parent container. Under sequential and exclusive containers
the time is relative to the time when the parent container
activated the element. The attribute is not mandatory, omitting
it equals the attribute value "0s".
durattribute
The
dur defines the duration of the element. The
duration is relative to the start time of the element. If this
attribute is omitted, the duration depends on the type of the
element. For time containers, this means that the duration is
unspecified and the container will stop after all it's children
have stopped. For the
item
element, the interpretation of an unspecified duration depends
on the type of the media element the
item is referencing to. For static
elements the duration is indefinite and the element will stay
active unless the parent element inactivates it. For dynamic
content the duration will be the duration of the content
itself. An item referencing to multiple media elements has a
duration of the longest lasting dynamic element, or
indefinite, if any of the referenced elements are static. The
duration is always overridden with the duration of the parent
container.
Note:
SMIL has an additional attribute
end to specify
the conditions to end an element. The
dur attribute
in Timesheets contains the functionality of SMIL's
end. The
dur can be described by the word
until, meaning that the element is active
until the condition specified by the attribute
becomes true. For example, "..until 6 seconds have passed", or
"..until a certain link is clicked by the viewer".
The
begin and
dur attributes specify
points on the time-line when some action should happen, either
activating or inactivating an element and it's children. These
points can be specified as an offset from some other point or an
offset from a certain document event, or as a combination of
both. The values can also be set to
"indefinite". The syntax for the different cases
are explained below.
Denoted with a numerical value followed by the unit of time, which can be either s for seconds or ms for milliseconds. The numerical value must be positive.
An offset from an event from the DOM that can, for example, be triggered by user action or some other timesheet element. The syntax for an event offset is built from the event's target id, event's type and optionally the time offset from the catching of the event. The target and the type of the event are separated by a dot (.) and the time offset is added with a plus (+) sign. For example, to wait for a DOMActivate event of an element that has an id link1 and specifying that the action is committed two seconds after the event, the value of the attribute would be "link1.DOMActivate+2s". The time offset part of the syntax is optional, omitting it is equal to setting the offset to zero seconds. To specify a non-existing target is an error.
The values are separated with comma (,). There can be multiple event offset values, but only one time offset value. If multiple time offset values are specified, only the first is taken into account while the rest are ignored.
Other attributes
repeatattribute
The
repeat defines the repeat count for the element. When the
element stops and the current repeat count is positive, the element
is activated again and actions of the element are repeated. The
repeat attribute only has meaning with time containers and
items that reference to dynamic content, since repeating static
content has no effect. The
dur attribute specifies the
total duration of the element, repetitions included. This means
that, for example, if the duration is set to one and half times
the original duration of the element and the repeat value is more
than one, the element is shown one and a half times, since the
dur attribute overrides the actual duration of the element.
The
repeat attribute can also have value "indefinite",
which means that the element will be repeated until it is stopped by
the time container or the value of
dur attribute.
The language specifies a parent
timesheet element,
three types of time containers (
par,
seq
and
excl) and an
item for connecting
the timesheet elements to the host media elements.
timesheetelement
The
timesheet element is the parent element for all the other elements of the timing
language. The children of
timesheet are scheduled similarily to
par element. The common attributes, defined in the attributes section have no meaning when
used with the
timesheet element. Instead, two optional
attributes are defined for the element.
src
The value of
src tells the location of an
external timesheet, which will be appended to the end of the
local timesheet. With this attribute a common timesheet can be
reused in multiple documents without the need to rewrite it every
time.
media
The
media attribute is used for selecting the
most suitable timesheet for current media device. It works
similarily to the @media rule in the CSS stylesheets
[CSS 2.1].
parelement
Parallel time container. All the children of the
par are activated
simultaneously and the duration of the container, if not specified with the
dur
attribute will be the same as with the child that has the longest duration of all the
children of the container. This element is similar to the
par element specified in the SMIL 2.0 Timing and
Synchronization Module [SMIL 2.0 Timing].
seqelement
Sequential time controller. The children of
seq are
displayed sequentially so, that next child is activated as soon as
the previous child finishes. The first child is activated when the
parent container starts. Only one child of
seq can be
shown simultaneously. Total duration of the
seq is either
specified by the
dur attribute,
or if it is omitted, by the sum of durations of all the children
of the element. If a child of the container has an indefinite
duration, the following children will never be activated and the
duration of the container will be indefinite. This element is
similar to the
seq element specified in the SMIL 2.0
Timing and Synchronization Module [SMIL 2.0 Timing].
exclelement
The exclusive time container can have only one child active at
a certain moment, similarly to the sequential time container. The
excl doesn't provide any other synchronization or
scheduling to its children, it only assures that no multiple
children are active simultaneously. When a child starts according
to its
begin attribute, the container deactivates any
other child that may be active.
Unlike the other time containers,
excl has implicitely
indefinite duration, since there is no defined situation when the
container should end. The
par ends when all the children
has stopped, and the
seq when the last child
finishes. Neither approach is applicable to the
excl,
since the temporal order of the children is unknown.
The
excl is a special case of the
seq where
the container's duration is set to indefinite and all the children
have indefinite or interactive begin times. It is also a
simplified version of the
excl element defined in the
SMIL 2.0 Timing and Synchronization Module [SMIL 2.0 Timing].
itemelement
The
item element implements the actual connection
between the timesheet and the document. It can reference a media
element or a set of elements by the element's tag, id or class;
the syntax and processing is similar to the CSS selector syntax.
The
item element has three attributes, in addition to the
common attributes. The
select attribute gives the
references to the media elements, the
prefetch
attribute controls the loading of the referenced elements and the
class can be used to change the properties of the
referenced elements.
selectattribute
The
select attribute links the timesheet to the
document. The attribute follows the same syntax and processing as
the CSS selectors, so that the elements can be referenced by their
name, id or class, or a more complex combination of the
selectors. If the attribute targets multiple elements in the
document,
item controls all of them. The attribute value
can also specify a comma separated list of selectors.
prefetchattribute
The
prefetch controls the loading of the resources needed by
the elements referenced by the
item element. Some resources,
like audio, video and big images, can be quite big in size and fetching them on
the fly while the timesheet is already running could skew the timing
of the whole timesheet. With the
prefetch attribute the
author can mark certain elements and their resources to be
prefetched to the memory before the timesheet is started. This way the
resources can be shown precisely at the specified moment of
time. If the attribute is omitted or set to false,
the resources are loaded just before the
item is
activated. When the attribute is set to true the
resources are loaded into the memory before the timesheet and the
timeline is started.
The timing semantics of the timesheets is based on the semantics of the SMIL timing model [SMIL 2.0 Timing], although it has been simplified a bit. This may cause the timing model not to be as powerful in expression of timing relations as the SMIL's, but it should be more approachable to the authors.
The base time, or the syncbase of a timesheet
element is the moment when the element is activated by its
parent. Activating an element doesn't necessary make the referenced media
element visible. Rather, it sets the time moment "0s", to which the
element's attributes are compared. Thus, it's not possible to
specify a negative value to the
begin attribute, since
it would mean that the element was supposed to start in the past
when it was still inactive. The timesheet element can activate
itself, according to the events it is set to listen. The
self-activation of the element bubbles upwards in the DOM so that
the parent elements do the necessary actions to allow the
activation of the correct child.
The syncbase of the child elements of a time container is
depended on the type of the container. The children of
par and
excl elements have the starting time of
their parent as their syncbase. The children of the
seq
element consider the end time of preceding child as their
syncbase. This time is resolved only at the moment the preceding
child ends.
Figure 1 shows a simple
example of the semantics of a timesheet. A parallel time container
has two children, which are
item elements referencing two
media elements. When the
par is started, it activates
both its children with the current time as their syncbase. The
media elements referenced by the children are not activated
yet. At time moment 1s, the media element
item1 is activated, according to the begin value of the
referencing timesheet element. At 2s, the
item2 is activated. At 3s, the
duration of item1 runs out, so it is stopped and
the corresponding timesheet element deactivates itself. At
4s, the parent container stops according to its
duration attribute, stopping all of its active children.
Figure 1: Timeline of a Timesheets
The duration of an element is primarily defined by the
dur attribute. If the element is not stopped
prematurely, due to an event or scheduling of its parent, the
dur attribute tells the overall duration of the
element. The element will not stop until this duration has passed,
and will not stay active longer that this duration. The value of
the
dur attribute will prevail
repeatattribute of the timesheets extends the duration of a media element to be longer than the specified duration
If the duration is not set, the duration of an element depends
on the type of the referenced elements, or the durations of the
children. The timesheet items can reference to static and dynamic
elements in the document. Static elements don't have implicit
durations, and the implicit duration of an
item element
referencing a static element is indefinite. Dynamic elements have
their own durations, which will be also used as the duration of
the timesheet element. The duration of the timecontainer depends
on the durations and activations of its children. The
seq and
par elements stay active until all
of their children have stopped. The implicit duration of the
excl is always indefinite.
The
begin and
dur attributes can contain
references to DOM events [DOM Events]. DOM events
can be triggered by user interaction or by some other event in the
document. Events are divided into two distinct groups, internal
events and user events.
Internal events are dispatched from within the timesheets. They can be used by other elements in the timesheet to create relations between different parts of the timeline. The events specified are begin event, which is dispatched when an element starts and end event, which is dispatched when element stops.
User events are triggered by the actions that user makes. A typical example is that the user clicks on a link in the document, and thus a DOMActivate event is dispatched [DOM Events].
A timesheet element is set to listen to a certain event by
specifying the event's target and type by either
begin or
dur attribute. When specified by
the
begin attribute, an inactive or active but not
yet started element will be started when it receives the
specified event. This may involve the activation and starting of
the parent elements as well, which can require some special
scheduling to be done on the upper level of the DOM
tree. Consider Figure 2 as an
example. At a certain time, the
item with the id "1" is
active. This means that the second child of the
seq
(i.e., the
par element) can't be active. Next, the
item number "3" gets an event, which it is set to
listen to by the
begin attribute. To activate itself,
the element must first inform its parent that it is going to
start. The parent (i.e., the
par element) is also inactive, so
it informs its parent of the activation. The parent
seq
element then stops the
excl element and its children to
allow the
par element to start, and
par
element then activates its children according to the definition.
Figure 2: the affect of event on a timesheet.
When the element is specified to stop according to an event, it doesn't cause that much processing in the timesheet. The element informs its parent that it has stopped and parent then decides what should happen next. Of course, some other element could be waiting to start according to the end event from the particular element.
There are also four additional events that are specified for
the
seq element. They are select-next,
select-prev, select-first and
select-last. These are used to select a certain
child of the
seq element, which facilitates the
creation of presentations where the user can have control of the
progression of the timeline, for example, a slide show. It should
be possible to add later more additional events to any other
elements of the timesheet.
This example shows a document that could be a single slide in a slide show. A new bullet is shown every two seconds.
<html xmlns="" xmlns: <head> <style type="text/css"> ... </style> <time:timesheet> <time:par> <time:item <time:item <time:item <time:item </time:par> </time:timesheet> </head> <body> <div id="content"> <p id="title">Introduction</p> <p id="bullet1">o Some intro to WLAN</p> <p id="bullet2">o Some intro to WLAN</p> <p id="bullet3">- Subbullet</p> <p id="bullet4">- Subbullet</p> <p id="pagenum">2</p> </div> </body> </html>
Next example is a picture show with captions for each image shown simultaneously. The new image is shown every five seconds, which dispatches a begin event that is listened by the corresponding item under the exclusive time container. The exclusive time container takes care that there can be only one caption active at a certain time. If the selection of an image is changed later, there is no need to touch the selection of captions.
<html xmlns="" xmlns: <head> <style type="text/css"> ... </style> <time:timesheet> <time:par> <time:seq> <time:item <time:item <time:item ... </time:seq> <time:excl> <time:item <time:item <time:item ... </time:excl> </time:par> </time:timesheet> </head> <body> > </body> </html>
This is an extended version of the previous example. In this version, the user has full control of progression of the show. When document is loaded, there's a welcome page that suggest the user to click on a link to start the show. Showing the pictures is not done automatically this time, instead the user must click on links "Next" or "Previous" to navigate through the show. At any time, the user can also jump to the beginning or the end of the presentation.
The start and end pages listen to DOMActivate
event, which is dispatched when a user clicks a link. The
forward/backward navigation can't use the same event, the
seq element listens to events select-next
and select-prev instead (cf. Section 7.4 Additional events). In this example, the XForms [XForms] is used to dispatch the events.
<html xmlns="" xmlns: <head> <style type="text/css"> ... </style> <time:timesheet> <time:seq> <time:item <time:par <time:seq <time:item <time:item <time:item ... </time:seq> <time:excl> <time:item <time:item <time:item ... </time:excl> <time:item </time:par> <time:item </time:seq> </time:timesheet> </head> <body> <div id="start-div"> <a href="" id="show" ev:Start show</a> </div/> <a href=""> Previous <xforms:dispatch </a> <a href=""> Next <xforms:dispatch </a> <a href="" id="home" ev:Home</a> <a href="" id="end" ev:End show</a> </div> </div> <div id="end-div"> <h1>Thanks for watching</h1> <a href="" id="home" ev:Watch again</a> </div/> </body> </html>
This section is informative
Since Timesheets only describes the temporal dimension of the document, it must be integrated with a host language's layout system. It can be integrated to CSS based layout by affecting the CSS properties of media elements. For instance, the CSS display property controls whether the element is displayed or not. The timesheets processor sets the CSS pseudo-class timed-inactive for the media element when the element should not be visible based on the timesheet. Then, with a default rule for the pseudo-class, the CSS property display is set to "none" to the non-visible media element. The pseudo-class overrides element's original display property and the element becomes invisible. When the media element should become visible, the implementation removes the pseudo-class from the element, thus restoring the original value.
The default style sheet should contain a declaration with the pseudo-class called timed-inactive that is used to control the visibility of the media elements:
:timed-inactive { display: none ! important;}
Additionally, the language is extended by defining a
class attribute for the
item element. It can be
used to change style properties of the elements from the
timesheet. For example, the author could specify the red background
of an element to be changed to blue at some time. This is done by
setting the value of
class attribute to reference a CSS
pseudo-class that is used in the style sheet of the
document. The author doesn't have to add the same document element
with the same content multiple times with different style
properties, but instead only define a pseudo-class for each
property change and control them from the timesheet.
This section is informative
An implementation of Timesheets has been developed at Helsinki University of Technology, in the X-Smiles project [X-Smiles]. X-Smiles is an open source XML browser, which supports several XML specifications and mixed namespace XML documents styled by CSS.
Currently, the Timesheets implementation only works with documents that can be laid out using Cascading Style Sheets. The integration method is described in the previous section. In the future, it should also be able to control the temporal properties of documents styled with other techniques, such as SVG.
The Timesheets language is intentionally kept as simple and compact as possible, to allow easy experimentation of the idea itself. More work should be done to broaden the usability of the Timesheets. Especially, the ability to present animations needs to be added to the language. Other enhancements include a more controlled way to handle the prefetching of the resources. Also Timesheets should also be integrated with other document languages, like SVG.
This specification and the reference implementation was done in the GO-MM project at Helsinki University Of Technology. We would like to thank the partners (companies and Tekes) for providing the funding. Also, we would like to thank all researchers, who participated that project. This specification is based on the ideas and work done by Kari Pihkala in his doctoral thesis on SMIL, for which we would like to express our utmost gratitude.
|
http://www.w3.org/Submission/2005/SUBM-xml-timing-20050415/
|
CC-MAIN-2016-40
|
refinedweb
| 4,432
| 54.83
|
Quite a few people seem to think that "trading the equity curve" is the answer. The basic idea is that when you are doing badly, you reduce your exposure (or remove it completely) whilst still tracking your 'virtual' p&l (what you would have made without any interference). Once your virtual p&l has recovered you pile back into your system. The idea is that you'll make fewer losses whilst your system is turned off. It sounds too good to be true... so is it? The aim of this post is to try and answer that question.
This is something that I have looked at in the past, as have others, with mixed results. However all the analysis I've seen or done myself has involved looking at backtests of systems based on actual financial data. I believe that to properly evaluate this technique we need to use large amounts of random data, which won't be influenced by the fluke of how a few back tests come out. This will also allow us to find which conditions will help equity curve trading work, or not.
This is the second post in a series on using random data. The first post is here.
How do we trade the equity curve?
I'm going to assume you're reasonably familiar with the basic idea of equity curve trading. If not, then its probably worth perusing this excellent article from futures magazine.
An equity curve trading overlay will comprise of the following components:
- A way of identifying that the system is 'doing badly', and quantifying by how much.
- A rule for degearing the trading system given how badly it is doing
- A second rule for regearing the system once the 'virtual' account curve is 'doing better'
I've seen two main ways for identifying that the system is doing badly. The first is to use a straightforward drawdown figure. So, for example, if your drawdown exceeds 10% then you might take action.
(Sometimes rather than the 'absolute' drawdown, the drawdown since the high in some recent period is considered)
The second variation is to use a moving average (or some other similar filter) of the account curve. If your account curve falls below the moving average, then you take action.
(There are other variations out there, in particular I noticed that the excellent Jon Kinlay blog had a more complex variation)
As for degearing your system, broadly speaking you can eithier degear it all in one go, or gradually. Usually if we dip below the moving average of an equity curve then it is suggested that you cut your position entirely.
Whilst if you are using the current drawdown as your indicator, then you might degear gradually: drawdown; then by another 20% for a total of 40% when you hit a 20% drawdown and so on.
Note that this degearing will be in addition to the normal derisking you should always do when you lose money; if you lose 10% then you should derisk your system by 10% regardless of whether you are using an equity curve trading overlay.
Finally the 'regearing' rule is normally the reverse of the degearing rule and process.
Prior research
The idea of trading the equity curve is something that seems to have bypassed academic researchers (unless they are calling it something else - please write in if you know about any good research) so rather than any formal literature review I had a quick look at the first page of google.
Positive
adaptrade
crazy ivan (whether he's a reliable source I don't know...)
Jon Kinlay (though not the normal system)
Negative (or at least no clear benefit)
Futures magazine (and also here)
Anthony Garnett
futures.io
r-bloggers
Why random data?
I personally find the above research interesting, but not definitive one way or another. My main issue is that it was all done on different financial instruments and different kinds of trading systems, which unsuprisingly gave different results. This might be because there is something 'special' about those instruments where equity curve trading worked, but it's more likely to be just dumb luck. Note: It is slightly more plausible that different kinds of trading rules will give different results; and we'll explore this below.
I personally think that we can't properly evaluate this kind of overlay without using random data. By generating returns for different arbitrary trading strategies we can then judge whether on average equity curve trading will be better.
Another advantage of using random data to evaluate an equity curve overlay system is that we avoid potentially overfitting. If we run one version of the overlay on our system, and it doesn't work, then it is very tempting to try a different variation until it does work. Of course we could 'fit' the overlay 'parameters' on an out of sample basis. But this quite a bit of work; and we don't really know if we'd have the right parameters for that strategy going forward or if they just happened to be the best for the backtest we ran.
Finally using random data means we can discover what the key characteristic of a trading system is that will allow trading the equity curve to work, or not.
Designing the test
Which overlay method?
There are probably an infinite variety of methods of doing an equity curve trading overlay (of which I touched on just a few above). However to avoid making this already lengthy post the size of an encylopedia I am going to limit myself to testing just one method. In any case I don't believe that the results for other methods will be substantially different.
I'm going to focus on the most popular, moving average, method:
"When the equity curve falls below it's N day moving average, turn off the system. Keep calculating the 'virtual' curve, and it's moving average during this period. When the 'virtual' curve goes back above it's moving average then turn the system back on"
That just leaves us with the question of N. Futures magazine uses 10, 25 and 40 days and to make life simple I'll do the same. However to me at least these seem incredibly short periods of time. For these faster N trading costs may well overwhelm any advantage we get (and I'll explore this later).
Also wouldn't it be nice to avoid the 3 year drawdown in trend following that happened between 2011 and 2013? Because we're using random data (which we can make as long as we like) we can use longer moving averages which wouldn't give us meaningful results if we tested just a few account curves which were 'only' 20 years long.
So I'll use N=10, 25, 40, 64, 128, 256, 512
(In business days; 2 weeks, 5 weeks, 8 weeks, 3 months, 6 months, 1 year, 2 years)
def isbelow(cum_x, mav_x, idx):
## returns 1 if cum_x>mav_x at idx, 0 otherwise
if cum_x[idx]>=mav_x[idx]:
return 1.0
return 0.0
def apply_overlay(x, N_length):
"""
apply an equity curve filter overlay
x is a pd time series of returns
N_length is the mav to apply
Returns a new x with 'flat spots'
"""
if N_length==NO_OVERLAY:
return x
cum_x=x.cumsum()
mav_x=pd.rolling_mean(cum_x, N_length)
filter_x=pd.TimeSeries([isbelow(cum_x, mav_x, idx) for idx in range(len(x))], x.index)
## can only apply with a lag (!)
filtered_x=x*filter_x.shift(1)
return filtered_x
Which criteria?
A nice way of thinking about equity curve trading is that it is a bit like buying insurance, or in financial terms a put option on your system's performance. If your system does 'badly' then the insurance policy prevents you from losing too much.
One of my favourite acronyms is TINSTAAFL. If we're buying insurance, or an option, then there ought to be a cost to it. Since we aren't paying any kind of explicit premium, the cost must come in the form of losing something in an implicit way. This could be a lower average return, or something else that is more subtle. This doesn't mean that equity curve trading is automatically a bad thing - it depends on whether you value the lower maximum drawdown* more than the implicit premium you are giving up.
* This assumes we're getting a lower maximum drawdown - as we'll see later this isn't always the case.
I can think of a number of ways of evaluating performance which try and balance risk and reward. Sadly the most common, Sharpe Ratio, isn't appropriate here. The volatility of the equity curve with the overlay on will be, to use a technical term, weird - especially for large N. Long periods without returns will be combined with periods when return standard deviation is normal. So the volatility of the curve with an overlay will always be lower; but it won't be a well defined statistic. Higher statistical moments will also suffer.
Instead I'm going to use the metric return / drawdown. To be precise I'm going to see what effect adding the overlay has on the following account curve statistics:
- Average annual return
- Average drawdown
- Maximum drawdown
- Average annual return / average drawdown
- Average annual return / maximum drawdown
My plan is to generate a random account curve, and then measure all the above. Then I'll pass it through the equity overlay, and remeasure the statistics.
Finally just to note that for most of this post I won't be considering costs. For small N, given we are closing our entire strategy down and then restarting it potentially every week, these could be enormous. Towards the end I will give you an idea of how sensitive the findings are to the costs of different trading instruments.
Which equity curve characteristics?
Broadly speaking the process for using random data is:
- Identify the important characteristics of the real data you need to model
- Calibrate against some real data
- Create a process which produces random data with the neccessary characteristics
- Produce the random data, and then do whatever it is you need to do
Notice that an obvious danger of this process is making random data that is 'too good'. In an extreme case with enough degrees of freedom you could end up producing 'random' data which looks exactly like the data you calibrated it against! There is a balance between having random data that is realistic enough for the tests you are running, and 'over calibrated'.
Identification
What characteristics of a trading system returns will affect how well an equity curve overlay will work? As in my previous post I'll be producing returns that have a particular volatility target - that won't affect the results.
They will also have a given expected Sharpe Ratio. With a negative Sharpe Ratio equity curve overlay should be fantastic - it will turn off the bad system. With a high positive Sharpe Ratio they will probably have no effect (at least for large enough N). It's in the middle that things will get more interesting. I'll test Sharpe Ratios from -2 to +2.
My intuition is that skew is important here. Negative skew strategies could see their short, sharp, losses reduced. Positive skew such as trend following strategies which tend to see slow 'bleeds' in capital might be improved by an overlay (and this seems to be a common opinion amongst those who like these kind of systems). I'll test skew from -2 (average for a short volatility or arbitrage system) to +1 (typical of a fast trend following system).
Finally I think that autocorrelation of returns could be key. If we tend to get losses one after the other then equity curve trading could help turn off your system before the losses get too bad.
Calibration
First then for the calibration stage we need some actual returns of real trading systems.
The systems I am interested in are the trading rules described in my book, and in this post: a set of trend following rule variations (exponentially weighted moving average crossover, or EWMAC for short) and a carry rule.
First skew. The stylised fact is that trend following, especially fast trend following, is positive skew. However we wouldn't expect this effect to occur at frequencies much faster than the typical holding period. Unsurprisingly daily returns show no significant skew even for the very fastest rules. At a weekly frequency the very fastest variations (2,8 and 4,16) of EWMAC have a skew of around 1.0. At a monthly frequency the variations (8,32 and 16,64) join the positive skew party; with the two slowest variations having perhaps half that.
Carry doesn't see any of the negative skew you might expect from say just fx carry; although it certainly isn't a positive skew strategy.
There is plenty of research showing that trend following rules produce returns that are typically negatively autocorrelated eg and. The latter paper suggests that equities have a monthly autocorrelation of around +0.2, whilst trend following autocorrelations come in around -0.3. Carry doesn't seem to have a significant autocorrelation.
My conclusion is that for realistic equity curves it isn't enough just to generate daily returns with some standard deviation and skew. We need to generate something that has certain properties at an appropriate time scale; and we also need to generate autocorrelated returns.
I'll show the effect of varying skew between -2 and +1, autocorrelation between -0.3 and +0.3, and Sharpe Ratio between -1 and +2.
How do we model?In the previous post I showed how to generate skewed random data. Now we have to do something a bit fancier. This section is slightly technical and you might want to skip if you don't care where the random data comes from as long as it's got the right properties.
The classic way of modelling an autocorrelated process is to create an autoregressive AR1 model* (note I'm ignoring higher autoregression to avoid over calibrating the model).
* This assumes that the second, third, ... order autocorrelations follow the same pattern as they would in an AR1 model.
So our model is:
r_t = Rho * r(t-1) + e_t
Where Rho is the desired autocorrelation and e_t is our error process: here it's skewed gaussian noise*.
* Introducing autocorrelation biases the other moments of the distribution. I've included corrections for this which works for reasonable levels of abs(rho)<0.8. You're unlikely to see anything like this level in a real life trading system.
This python code shows how the random data is produced, and checks that it has the right properties.
Now, how do we deal with different behaviour at different frequencies? There are very complicated ways of dealing with this (like using a Brownian bridge), but the simplest is to generate returns at a time scale appropriate to the speed of the indicator. This implies weekly returns for carry and fast EWMAC rules(2,4 and 4,8); and monthly for slower EWMAC rules. If you're trading a very fast trading rule then you should generate daily data, if you see a clear return pattern at that frequency.
I'll use daily returns for the rest of this post, but I've checked that they still hold true at weekly and monthly frequencies (using equity curve filter lookbacks at least 3 times longer than the frequency of returns we're generating).
Results
To recap I am going to be TESTING different lookbacks for the equity curve filter; and I am going to be GENERATING returns with skew between -2 and +1, autocorrelation between -0.4 and +0.4, and Sharpe Ratio between -1 and +2.
I'll keep standard deviation of returns constant, since that will just change the overall scale of each process and not affect the results. I'll look at the results with daily returns. The results won't be significantly different with other periods.
All the code you need is here.
Sharpe Ratio
In this section I'll be varying the Sharpe Ratio whilst keeping the skew and autocorrelation fixed (at zero, and zero, respectively).
scenario_type="VaryingSharpeRatio"
period_length=1 ### daily returns
Average annual return
All of the plots that follow have the same format. Each line shows a different level of return characteristic (Sharpe Ratio in this case). The x axis shows the equity curve filter N day count that we're using for the moving average. Note that N=1000, which is always on the right hand side, means we aren't using a filter at all. The y axis shows the average value of the statistic of interest (in this case average annual return) across all the random equity curves that we generate and filter.
The good news is if you know you're trading system is rubbish, then applying an equity curve system, preferably with large N, improves the performance. If you knew your system was rubbish then of course rather than use a complicated filter to turn it off you wouldn't bother turning it on at all! However for all profitable equity curves equity curve trading reduces, rather than increases, your returns.
Average drawdown
Maximum drawdown
For profitable systems there might perhaps be a modest reduction in maximum drawdown for small values of N. For loss making systems the biggest reduction in drawdown is for large values of N; although all filters are better than none.
Average annual return / average drawdown
Let's now try and put together the return and drawdown into a simple statistic. For unprofitable systems the overlay makes no difference. For profitable systems it reduces the drawdown adjusted return (the 'hump' at the right hand side of the SR=2.0 line is an artifact caused by the fact we can't calculate this statistic when the average drawdown is zero).
Average annual return / maximum drawdown
Skew
In this section I'll be varying the Skew whilst keeping the Sharpe Ratio and autocorrelation fixed (at one, and zero, respectively).In this section I'll be varying the Skew whilst keeping the Sharpe Ratio and autocorrelation fixed (at one, and zero, respectively).
scenario_type="VaryingSkew"
period_length=1 ## daily returns
Average annual return / average drawdown
Average annual return / maximum drawdown
Autocorrelation
In this section I'll be varying the Autocorrelation whilst keeping the skew and Sharpe Ratio fixed (at zero, and one, respectively).In this section I'll be varying the Autocorrelation whilst keeping the skew and Sharpe Ratio fixed (at zero, and one, respectively).
scenario_type="VaryingAuto"
period_length=1
Average annual return
However as we've already discussed trend following systems seem to have negative autocorrelation. So it looks like equity curve overlays are a no-no for a trend following system.
Average drawdown
Again drawdowns are improved only if the autocorrelation is positive. They are much worse if it is negative (note that average drawdowns are smaller for negatively autocorrelated systems anyway).
Maximum drawdown
There is a similar picture for maximum drawdown.
Average annual return / average drawdown
Remember that I haven't included costs in any of these calculations. For information the annualised turnover added to each system by the equity curve filter ranges from around 23 for N_length 10 to 1.2 for N_length 512. With the cheapest futures I trade (standardised cost of 0.001 SR units per year, for something like NASDAQ) this is not a major problem, reducing average return with N length of 10 by around 1%.
* See chapter 12 of my book for details of how I calculate turnover and standardised costs
However let's see the results using a more expensive future, the Australian interest rate future, with a cost of around 0.03 SR units per year.
scenario_type="VaryingAutoMore"
period_length=1
annualised_costs_SR=0.03
Average annual return / maximum drawdown
Conclusion
The idea that you can easily improve a profitable equity curve by adding a simple moving average filter is, probably, wrong. This result is robust across different positive sharpe ratios and levels of skew. Using a shorter moving average for the filter is worse than using a slower one, even if we ignore costs.
There is one exception. If your trading strategy returns show positive autocorrelation then applying a filter with a relatively short moving average will probably improve your returns, but only if your trading costs are sufficiently low.
However if your strategy is a trend following strategy, then it probably has negative autocorrelation, and applying the filter will be an unmitigated disaster.
This is the second post in a series on using random data. The first post is here. The next post on portfolio optimisation is here.
Another solid post, Rob. Why do you prefer SR over the return/drawdown measure that was used in this post? Throughout the book, you use the SR to standardized risk but isn't the ret/dd ratio a more specific measure of that?
I can think of a few reasons:
Intepretability
I have been using Sharpe Ratios a long time, and I don't really have a feel for other performance statistics. If you told me something had a calmar ratio of 0.5 I wouldn't have a clue what you were talking about, and even if you explained that meant the average annual return to max drawdown was 0.5 I still wouldn't know if that was good or not.
Consistency
I create forecasts as proportional to expected returns scaled for standard deviation, which is basically a Sharpe Ratio. I also calculate risk for position scaling by using the standard deviation. Consistently using standard deviation as a measure of risk has its flaws, but at least I'm using the same measure throughout my system.
Symmettry:
Although the downfall of SR is that it assumes symmettry, I actually think it is a good thing to be as scared of an expected rise as a fall.
Statistical robustness:
When we calculate the standard deviation we use the whole distribution. With average drawdown we don't and with maximum we use only a single point. Return / max drawdown in particular is a terrible statistic to use with real data, since it is very much random what it comes out at.
I've tried using a simple MA on win rates for several mean-reversion systems, and the results have always been dismal. Except for that one time I forgot to check for a future leak, and that one worked like a charm! 😃 The problem, as I saw it, is that these systems all had a very high win rate, 60-75%, and so losing trades were few and far between. There was no clustering to speak of, so the switching on and off merely removed good grades.
-Matt
Interesting. I guess a system where you cut after the drawdown reached X% might protect you from a drawdown larger than you ever saw in simulation; i.e. the situation when the MR relationship breaks down.
Thanks Rob, I'll have to look into that. Haven't tried anything using the drawdown as a filter. I suspect that it might not work, but my intuition is usually wrong about trading. Which is why I prefer robots and computers. These sort of of shortish MR trades tend to have many smaller wins, with the occasional invigoratingly large loss. A system that shuts off on drawdown thresholds might simply reduce the amount of little wins needed to scrape back into the black. But until I've tried it, I won't know.
Thanks for your comments and your blog. I've added it to my regular reading list.
|
https://qoppac.blogspot.com/2015/11/random-data-evaluating-trading-equity.html
|
CC-MAIN-2018-09
|
refinedweb
| 3,961
| 61.46
|
XCFit a.k.a (XCUI, Cucumberish and Fitnesse Integration Tests) is a full stack Xcode BDD framework for iOS apps written in Swift. XCFit allows us to write BDD Style API/Contract level, UI and Acceptance Tests with Swift in human readable language using tools like Given/When/Then, Cucumber and Fitnesse in Xcode. We can still use Apple's brand new UI Testing framework (XCUI) under the hood of XCFit and Cucumberish. XCFit provides automated Xcode templates to setup skeleton of BDD which are available on Homebrew, RubyGem. XCFit also packaged as Swift Framework to provide pre-defined BDD Steps written in Swift for Protocol Oriented BDD. XCFit Swift framework is available on CocoaPods, Carthage and Swift Package Manager.
Important Note : XCFit does not support macOS application.
XCFit provides templates for Protocol Oriented BDD using 'Protocol BDD Bundle' and Page Object Pattern for Apple's XCUI Test using 'XCUI POM Test Bundle' Templates. We can get pre-defined BDD steps by using XCFit Swift Framework from CocoaPods, Carthage and Swift Package Manager.
XCFit setup Cucumber style BDD framework with "Cucumberish UI Test Bundle' Templates.
XCFit allows us to setup Fitnesse style decision table test framework with OCSlimProject using 'Acceptance Tests Bundle' templates.
Homebrew - We can tap 'shashikant86/homebrew-taps' and Install XCFit to download Xcode Templates
RubyGems -- xcfit-RubyGem to get automated Xcode Templates
The Rubygem method is preferred.
XCFit is pure Swift but other libraries like Fitnesse and Cucumberish need some additional softwares.
Hardware
You must have Mac Operating System with OSX/MacOS Sierra or above.
Software
XCFit installation has two steps.
This will install Xcode Templates with skeleton code to support BDD in iOS app. The templates are XCUI based Protocol-oriented BDD templates, Page Object Templates, Cucumberish BDD Templates and OCSlim Fitnesse Templates (optional). The templates can be installed with xcfit-RubyGem or Homebrew. You need to select only one method of installtion. The rubygem method is preferred.
XCFit Swift Framework provides pre-defined BDD Style steps with XCUITest to support Protocol-oriented BDD and writing tests using Page Object pattern. The supporting Frameworks like Cucumberish and OCSlim which can be used to write BDD Steps. XCFit Swift Framework is available on XCFit-CocoaPods, Carthage and Swift Package manager. Cucumberish and OCSlimProject are available on Cocoapods.
XCFit templates can be installed using Rubygem.
If you can't use HomeBrew for some reason then XCFit can be installed using RubyGems. This will set our Xcode with BDD templates for XCFit and Cucumberish
$ gem install xcfit
You need to use with 'sudo' if you are using system (pre-installed) Ruby(2.0). XCFit gem will be used to set all the Xcode Templates for Xcode.
You can choose any of the above method. Rubygems method is prefered.
In existing app or brand new app, we have to enable the Xcode templates for targets to speed up the
To setup Templates for Xcode 8 for XCUI ptotocol-oriented BDD, Cucumberish target and Gherkin File Type.
$ xcfit setup_xcode_templates
You will see new option for iOS i.e 'XCFit'. Once Clicked on it. You will see Protocol BDD, Cucumberish UI and Fitnesse Acceptance Tests. XCUI POM, Fitnesse Acceptance Unit Test bundles.
XCFit, Cucumberish or OCSlimProject Framework can be installed using Cocoapods. XCFit and Cuucmberish can be installed using Carthage as well.
Cocoapods is quicker XCFIT, CUCUMBERISH or FITNESSE target names as required.
We can install XCFit Cocoapods depending on Swift version we are using
Latest version should support
target '$_YOUR__TARGET' do pod 'XCFit' end
You can use any of the method above to setup
Podfile.
Now that, we have
Podfile setup, we can install dependencies using command
$ pod install
You need to close the existing Xcode session and Xcode Workspace .xcworkspace next time.
XCFit and Cucumberish can be installed as Cartahge. We need to create
Cartfile in the root of the project. Depending on which version of Swift you are using, we can use different tag
You can get latest tag to work with Swift 3.1 then
Cartfile can have following
github "Shashikant86/XCFit"
Now, we can fetch and build Carthage Dependencies using following command.
$ carthage update --platform iOS
This will checkout and build XCFit frameworks then we can manually drag those frameworks in the
Build Phases of the test targets. This will create 'Carthage' directory with built framework. We need to manually drag and drop this to our XCUIPoMTest' target build settings./XCFit.framework
You can choose any of the above method but Cocoapods is easy and less manual.
XCFit can be installed with Swift Package Manager however Swift Package Manager isn't officially supported for iOS so we can use XCFit only for the standalone Libraries. We need to create
Package.swift file with following content.
import PackageDescription let package = Package( name: "XCFit", dependencies: [ .Package(url: "", majorVersion: 4.0.0), ] )
Now we can use fetch XCFit using
$ swift package fetch
We can build, test package using the Commands available for the Swift Package Manager.
You can read step by step tutorial on my blog on Protocol-Oriented BDD here
XCFit template supports Protocol Oriented BDD. Swift is a protocol oriented language and we don't want to miss the point of Protocol, Extensions and Enums. To setup template. You can read step by step tutorial on my blog on Protocol-Oriented BDD here
From Xcode, create a new app(Or use existing app) and select File ---> New ----> Target
Now Select 'XCFit' for iOS app and Click on 'Protocol Oriented BDD Bundle'
Once Clicked !
It's your feature will all the requirements which can be written as Acceptance tests
It's extension on the Feature where you need to implement step definition in Given When Then format
All the XCUIElements for that Feature.
This is test where you call Given When Then from Extensions. You can import
XCFit framework and extend this class 'XCFit' and also confirms to 'Feature' protocol
You can get XCFit Framework easily with methods mentioned above. If you choose decided to use Cocoapods then create
Podfile and add specific dependency for the target
Cocoapods target names as required and then follow the instructions above.
There are some predefined XCFit steps we can use by importing
XCFit and extending out test class to
XCFit. There are plenty of Pre-Defined BDD Style Steps available here. You can use predefined steps wherever they make sense however it's fairly easy to write your own.
You can simply import
XCFit inside the
UITestBase class and extend it to XCFit. You can also use
FeatureSteps.swift to implement or override some steps. You can read step by step tutorial on my blog on Protocol-Oriented BDD here
XCFit templates gives an option to use very polular Page Object Pattern with Apple's Xcode UI Testing framework. You can install templates and start using the code straight way, no need to use framework unless you want to use pre-defined BDD style tests.
From Xcode, create a new app(Or use existing app) and selct File ---> New ----> Target
Now Select 'XCFit' for iOS app and Click on 'Page Object Test Bundle'
Once Clicked on the target e.g 'XCUI POM Test Bundle' !
This file is at the base of the target. It's exactly same file that Apple's XCUI Test generate at first. You may use it for recording the tests or simply delete it if not needed.
This is groups where we can abstract logic of every screen in the app. Example file are 'HomeScreen.swift' and 'BaseScreen.swift' This assumes that your apps is made up of multiple screens. You can write individual screen class which extend BaseScreen. All the functionality related to screen can be included in this class.
This group has all the test for our app. Currently demo template has two tests 'HomeScreenTest.swift' and 'ProtocolOrientedTest.swift'. This examples shows how XCUI test can be implemented in the Object Orinted way and Protocol oriented way.
Testbase is group where we can abstract all setup, teardown and common stuff in the base class. Every Screen then use this class as base. You can add more stuff as needed e.g Fixtures, Launch Arguments
You can simply import
XCFit inside the test class and extend it to XCFit
You will get access to lots of predefined BDD style human readable steps. It's not mandatory to use those steps unless you wish.
Don't like Pre-defined steps, you can easily override the steps, covered in the later section here
Fastlane is a awesome tool for iOS Continuous Delivery which automates most of the iOS development tasks. We can use it to run tests written using XCFit, We can setup sample
Fastfile using XCFit command
$ xcfit setup_xcfit_fastfile
This will create template Fastfile with all the required lanes. You can replace the YOUR_SCHEME, WORKSPACE and other variables as required. We can then run
$ fastlane xcfit
This will run all our tests using Fastlane that will be easy to plug it with any CI server.
From Xcode, create a new app(Or use existing app) and selct File ---> New ----> Target
Now Select 'XCFit' for iOS app and Click on 'Cucumberish UI Test Bundle'
Once Clicked on the target e.g 'Cucumberish UI Test Bundle' Xcode will create UI testing target with all the required files with Bridging header for Cucumberish UI Testing. It create Page Object Pattern with all required files with screens, steps definitions and Cucumberish initialiser swift file.
Let's see what is inside the Cucumberish templates.
This file is at the base of the target. This initiate Cucumberish for project. We need to register all step definitions in this file.
This is groups where we can abstract logic of every screen in the app. Example file are 'HomeScreen.swift'.
This groups has all the step definitions related to screen. Example file 'HomeScreenSteps.swift'. Once implemented we need to register it in the initialiser file mentioned above.
This group has common code like extensions and common steps. The example file 'CommonStepDefinitions.swift' has some steps that can be used in the feature file.
This groups all the Objective-C headers and Bridging headers needed to get Cucumberish working with Swift.
We don't have 'Features' directory in the template because it needs to have directory on the disk and should be added to Xcode as 'Folder Reference' not Group.
Create a Direcory called "Feature"
Now Add sample Gherkin Feature File to 'Features' directory either by File->New->Gherkin Or Just add it using your favourite text editor e.g demo.feature with content
Feature: Demo App Feature Scenario: Demo Scenario Given the app is running
Now Drag and Drop 'Features' directory to Xcode Cucumberish target
Select only 'Create folder references' Option. ** Do Not Select 'Create groups' Or 'Copy items if needed**'
Now, We have to get cucumberish framework either using Carthage or Cocoapods.
Cucumberish is one of the dependency of XCFit so you will get Cucumberish with XCFit while using it with Cocoapods however Carthage need more setup.
In order to get Cucumberish source content. There are few ways we can do that
Create a 'Podfile' if you don't have already. In your Podfile, add following Pod entry and update/install pod
You can doenload latest version 4.0.0 to work with Swift 3.1
target '$_YOUR__TARGET' do pod 'XCFit' end
Now, we can install dependencies
$ pod install
Now close the existing Xcode session and Xcode Workspace
.xcworkspace next time.
We now have everything we needed to run demo Cucumber demo test. Update Scheme if don't want to run unit test or other type of tests. and press 'CMD+U'
Congratulations !! You have just ran your first Cucumber BDD Scenario in the Xcode.
XCFit adds 'Cucumberish' target to existing Scheme. You can remove that target and run separate scheme to keep it independent from Unit tests. Make sure you make the new scheme executable for Running.
Once you have setup XCFit Cucumberish templates, we need to get Cucumberish framework. In order to get Cucumberish using Carthage, we need to create
Cartfile with following content
You can get Cucumberish
github "Ahmed-Ali/Cucumberish"
Now install, Carthage frameworks using commamnd
$ carthage update --platform iOS
This will chekcout and build XCFit and Cucumberish frameworks inside the
Carthage directory. Now we need to manually drag and drop frameworks in the
build phases of the Cucumberish target.
Link Binary with Librariesand drag
Cucumberish.frameworkfrom
Carthage/Build/iOSdirectory
New Copy Files Phaseand select destination as 'Frameworks' and Add Cucumberish Frameworks from
Carthage/Build/iOSdirectory. Select 'Create Group' and 'Copy if needed' when prompted.
Once drag and drop is don and we have "Features" directory then we are ready to launch our BDD Style tests using 'CMD+U'. The entire Carthage Setup looks like this
There are some pre-defined Cucumberish Steps available to use directly without any need to implement in the step definition. You can see list of steps here. You already have those steps in the 'CommonStepDefinitions.swift' file. You can modify the steps as per your project need or add your own. Don't like Pre-defined steps, you can easily override the steps, covered in the later section here
XCFit has pre-defined steps for both XCFit Swift framework as well as Cucumberish framework.
It's recommended to use your own steps as predefined steps might not read well for your project needs. Pre-defined steps gives you guidance on how to implement your own step, however you can use pre-defined steps wherever they make sense to avoid duplication.
You can easily override pre-defined BDD Style Steps by writing Swift Extensions and Changing Common step definitions in the Cucumberish 'CommonStepDefinitions.swift' file.
XCFit has a step
givenILaunchedApplication() and you are not happy about the wordings. You can easily write and Extension and your steps like this :
extension XCFit { func givenMyiOSApplicationHasBeenLaunched() { XCUIApplication().launch() } }
Now you can use your own
givenMyiOSApplicationHasBeenLaunched() step anywhere inside the Test target.
XCFit template for setting Cucumberish has the Swift code for the all pre-defined Cucumberish BDD Steps inside the 'CommonStepDefinitions.swift' file. You just need to add your own steps accordingly or change the exiasting one.
If you really wanted to get more information about Fitnnese for iOS, please follow documentation on OCSlim project. XCFit adopted the framework as dependeny to make it full stack BDD and might not be able to keep up with that for long. It's worth navigate to OCSlim Project from this point but I will cover basic setup here. Fitnesse is fully integrated standalone wiki and acceptance testing framework for BDD Style testing. As of now we have seen Cucumber and Page Object pattern test frameworks. We will cover basic setup as part of this document. Before get started make sure, you have Fitnesse Xcode templates installed
From Xcode, create a new app(Or use existing app) and select File ---> New ----> Target
Now Select 'XCFit' for iOS app and Click on 'iOS Acceptance Tests '
Once Clicked on the target e.g 'OS Acceptance Tests' Xcode will create new target with all required files and groups for Acceptance testing
Select 'Acceptance Test' Scheme from Xcode and try to build by pressing CMD+B
The build might fail as we need fix some Swift3 related issue as well as we need to add XCFit/OCSlimProject Pod to the to the podfile.
target 'AcceptanceTests' do pod 'OCSlimProject' end
$ pod install
Now, You should be able to build 'Acceptance Tests" target.
You should also note that, the script 'Launch Fitnesse' has been created in the base of the project. Launch the fitness by exucuting that script from command line
$ sh Launch Fitnesse
The browser will popup with example test. You should be able to excute.
You can also setup Fitnesse Acceptance Tests but you need to use Cocoapods for this target.
You can find detailed blog post on Dzone.
We need to create a “Podfile” at the root of the project with the following content.
target 'AcceptanceUnitTests' do pod 'OCSlimProjectTestBundleSupport' end
Now, we can run ‘pod install’ at this stage and close the current Xcode session and open project workspace..
You can read my detailed blog on how to setup Xcode Server for XCFit package on Dzone Xcode Continuous Integration with Xcode Server
Swift Package Manager doesn't officially support iOS projects (Xcode Templates) but We can use it for building packages. XCFit will be having full on support for XCUI Test helpers so that we can use Apple's XCUI Test Framework painless to use. There is sample swift package on Github to test XCFit Full Documetation and API implementation still in progress. You can grab it like this
import PackageDescription let package = Package( name: "XCFit", dependencies: [ .Package(url: "", majorVersion: 4.0.0), ] )
You can clone the existing repo which has a demo app we can run Unit, Fitnesse and Cucumbertish Tests as XCTest
$ git clone $ cd XCFit4Demo $ open XCFit4Demo.xcworkspace/
Run XCUI and Cucumberish test with Xcode using 'XCFit4Demo' Scheme, press "cmd + U". You can also use "AcceptanceUnitTests" target/scheme and press "CMD+U" to run fitnesse tests. You can script it with
xcodebuild or Fastlane Tools.
You can watch step by step video demo on Youtube. Click the link below
Big Thanks to
Shashikant86, shashikant.jagtap@icloud.
git checkout -b my-new-feature)
git commit -am 'Add some feature')
git push origin my-new-feature)
This is special release of XCFit as it's been done from Cupertino.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API
|
https://swiftpack.co/package/XCTEQ/XCFit
|
CC-MAIN-2021-21
|
refinedweb
| 2,915
| 64
|
Tux3 Report: Initial fsck has landed
From:
Daniel Phillips
Date:
Mon Jan 28 2013 - 00:55:30 EST ]
Initial Tux3 fsck has landed
Things are moving right along in Tux3 land. Encouraged by our great initial
benchmarks for in-cache workloads, we are now busy working through our to-do
list to develop Tux3 the rest of the way into a functional filesystem that a
sufficiently brave person could actually mount.
At the top of the to-do list is "fsck". Because really, fsck has to rank as
one of the top features of any filesystem you would actually want to use.
Ext4 rules the world largely on the strength of e2fsck. Not just fsck, but
certainly that is a large part of it. Accordingly, we have set our sights on
creating an e2fsck-quality fsck in due course.
Today, I am happy to be able to say that a first draft of a functional Tux3
fsck has already landed:
Note how short it is. That is because Tux3 fsck uses a "walker" framework
shared by a number of other features. It will soon also use our suite of
metadata format checking methods that were developed years ago (and still
continue to be improved).
The Tux3 walker framework (another great hack by Hirofumi, likewise the
initial fsck) is interesting in that it evolved from tux3graph, Hirofumi's
graphical filesystem structure dumper. And before that, it came from our btree
traversing framework, which came from ddsnap, which came from HTree, which
came from Tux2. Whew. Nearly a 15 year history for that code when you trace
it all out.
Anyway, the walker is really sweet. You give it a few specialized methods and
poof, you have an fsck. So far, we just check physical referential integrity:
each block is either free or is referenced by exactly one pointer in the
filesystem tree, possibly as part of a data extent. This check is done with
the help of a "shadow bitmap". As we walk the tree, we mark off all referenced
blocks in the shadow bitmap, complaining if already marked. At the end of
that, the shadow file should be identical to the allocation bitmap inode. And
more often than not, it is.
Cases where we actually get differences are now mostly during hacking, though
of course we do need to be checking a lot more volumes under different loads
to have a lot of confidence about that. As a development tool, even this very
simple fsck is a wonderful thing.
Tux3 fsck is certainly not going to stay simple. Here is roughly where we are
going with it next:
"Fsck Revisited"
To recap, next on the list is checking referential integrity of the directory
namespace, a somewhat more involved problem than physical structure, but not
really hard. After that, the main difference between this and a real fsck
will be repair. Which is a big topic, but it is already underway. First simple
repairs, then tricky repairs.
Compared to Ext2/3/4, Tux3 has a big disadvantage in terms of fsck: it does
not confine inode table blocks to fixed regions of the volume. Tux3 may store
any metadata block anywhere, and tends to stir things around to new locations
during normal operation. To overcome this disadvantage, we have the concept of
uptags:
"What are uptags?"
With uptags we should be able to fall back to a full scan of a damaged volume
and get a pretty good idea of which blocks are actually lost metadata blocks,
and to which filesystem objects they might belong.
Free form metadata has another disadvantage: we can't just slurp it up from
disk in huge, efficient reads. Instead we tend to mix inode table blocks,
directory entry blocks, data blocks and index blocks all together in one big
soup so that related blocks live close together. This is supposed to be great
for read performance on spinning media, and should also help control write
multiplication on solid state devices, but it is most probably going to suck
for fsck performance on spinning disk, due to seeking.
So what are we going to do about that? Well, first we want to verify that
there is actually an issue, as proved by slow fsck. We already suspect that
there is, but some of the layout optimization work we have underway might go
some distance to fixing it. After optimizing layout, we will probably still
have some work to do to get at least close to e2fsck performance. Maybe we can
come up with some smart cache preload strategy or something like that.
The real problem is, Moore's Law just does not work for spinning disks. Nobody
really wants their disk spinning faster than 72000 rpm, or they don't want to
pay for it. But density goes up as the square of feature size. So media
transfer rate goes up linearly while disk size goes up quadratically. Today,
it takes a couple of hours to read each terabyte of disk. Fsck is normally
faster than that, because it only reads a portion of the disk, but over time,
it breaks in the same way. The bottom line is, full fsck just isn't a viable
thing to do on your system as a standard, periodic procedure. There is really
not a lot of choice but to move on to incremental and online fsck..
So that is the Tux3 Report for today. As usual, the welcome mat is out for
developers at oftc.net #tux3. Or hop on over and join our mailing list:
We are open to donations of various kinds, particularly of your own awesome
developer power. We have an increasing need for testers. Expect to see a
nice simple recipe for KVM testing soon. Developing kernel code in userspace
is a normal thing in the Tux3 world. It's great. If you haven't tried it yet,
you should.
Thank you for reading, and see you on #tux3.
Regards,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at ]
|
http://lkml.iu.edu/hypermail/linux/kernel/1301.3/02423.html
|
CC-MAIN-2016-26
|
refinedweb
| 1,026
| 70.13
|
I’ve used Python (or more specifically IronPython) in the past to use Python as a scripting engine for my app. but never really bothered with Python beyond that. However, I decided I need to spend a little more time with Python, so am going to post a few “getting started” posts, starting with this one…
Python basics
Python files are usually saved with the .py extension and is interpreted, although there are apps for compiling the scripts to executables.
Python is a dynamic language, hence we do not need to declare the type of a variable.
Python uses whitespace and indentation to denote blocks of code, i.e. in C#, Java etc. we’d use curly braces { } to denote a block of code whereas Python expects the code blocks to be tabbed, for example in C# we might have
public int Pi() { return 3.14; }
the same function in Python would be
def pi(): return 3.14
This also demonstrates creating a function in Python (see Functions, below for more information on function definitions).
Also notice that Python does not use line termination like the semi-colon in C#. Java etc. This means if we need to extend our code onto another line we can use the backslash, i.e.
def pi(): return 3.14
Types
Python is a dynamically typed language which has good and bad points. This basically means when we declare a variable name it’s automatically created and it’s type is automatically declared based upon it’s usage. The type can change as we assign different types to the variable, for example
value = "Hello World" # value is of type str value = 123 # value is now of type int
Note: # is used for a single line comment, we can use “”” to start and end a block of code to use as multi-line comments, although technically speaking these denote multi-line strings.
Python types
include the usual types, such as a string (str), int, long, float, boolean along with complex types, tuples and more.
If we need to find the type
at runtime then we can use the type
method, for example
value = (1, "Hello") print(type(value))
In this code, the first line creates a tuple and the next line outputs (to the console) the type of the value variable, in this case the output will be
Enumerations
Enumerations are declared via the Enum type, we need to import the enum module and then we can declare our Enum subclassed type as follows
import enum class Gender(enum.Enum): Male = 1, Female = 2 # in use g = Gender.Female
Functions
Python allows us to define function using the def keyword, here the example we introduced earlier
def pi(): return 3.14
def
is used to declare or define our function, arguments may be passed within the parenthesis, in this instance no arguments exist. Finally we end the function declaration using the colon. The actual statements that are executed within the function are then below the declaration and the code is indented.
Executing functions uses pretty standard syntax, i.e.
value = pi()
Although Python does a good job of type inference when we have code like the following
def add(a, b): return a + b
we have a situation where both of the following bits of code work
strValue = add("2", "3") intValue = add(2, 3)
but in the first instance we get the string “23” and in the second we get the int 5.
Obviously if our intent of that the add
function it for numerical types then we will need to give type hints, for example
def add(a: float, b: float) -> float: return a + b
The strange thing here (if you’re used to similar techniques in F#, for example) is that running the previous example of the add function with strings and ints will still work, i.e. still returns “23” and 5. So it’s debatable how useful hints are. Certainly PyCharm will display a “hint” over the string arguments and tell us the expected type, but ultimately we can still pass in a different types for the add function arguments.
If you want to include type hints but not show them in your source or if you want to hint on existing code that you do not (or cannot) edit. Then you can include a .pyi file along with the .py file including the type/function etc. and separate the hints from the actual implementation. So for example our .py file might have
def add(a, b): return a + b
and the file with the same name but .pyi extension would have
def add(a: float, b: float) -> float: ...
Object Orientated
Python allows us to define classes uses the class keyword, for example
import http.client class WebClient: def __init__(self): self.url = "" self.method = "GET" def submit(self): connection = http.client.HTTPConnection(self.url) connection.request(self.method, "/") response = connection.getresponse() data = response.read() print(response.status, response.reason) print(data) client = WebClient()
The __init__ function is the equivalent of a constructor and self is analogous to this
in C#. Within the __init__ we have declared new variables along with some default values, i.e. the url and method variables.
In the case where we do not have anything to setup/initialize in the __init__ function we can use the pass keyword. Here’s an example of this along with how we can derived/subclass a type
class Animal: def __init__(self): pass class Dog(Animal): def __init__(self): self.legs = 4
A good old, OO example whereby Animal is the base class and Dog subclasses this and adds functionality/fields etc.
As you’ve probably already noticed, Python doesn’t include a new
keyword to create an instance of a class we simply use
animal = Dog()
Importing modules & packages
Like most languages, we can create reusable source code modules (and packages) that can then be imported into our source code, for example let’s import a Python standard library for connecting to an HTTP endpoint
import http.client connection = http.client.HTTPConnection("") connection.request("GET", "/") response = connection.getresponse() data = response.read()
In the code above, we import the http.client library and then create an HTTPConnection instance which we then use to connect to google.co.uk.
We can import multiple modules using comma separated values, i.e.
import http.client, sys
Creating modules & packages
Modules are simply ways to define reusable code within separate files. Packages are is essence namespaces which can contain multiple packages and modules.
To create a module, we simply create a file, for example web.py and include our functions and types etc. within that file, so web.py looks like this
import http.client class WebClient: def __init__(self): self.url = "" self.method = "GET" def submit(self): connection = http.client.HTTPConnection(self.url) connection.request(self.method, "/") response = connection.getresponse() data = response.read() print(response.status, response.reason) print(data)
and it our file that uses this module, we have the following
import web client = web.WebClient() client.submit()
Packages now take this a little further. Still using the file based approach. Packages are simply directories with one or more module file, but every package must
include a file named __init__.py which can be empty. This __init__.py file may contain an __all__ variable which defines what modules are exported, i.e. non-exported modules can be internal or private to the package or exported and visible to those using the package. For example our __init__.py file might look like this
__all__ = ['WebClient'] # example within multiple exports __all__ = ['WebClient', 'SomethingElse']
However the above only seems to be used when using the alternate import syntax, for example
from web import *
See the answers to Can someone explain __all__ in Python?
for much more information on the use of __all__.
|
http://colabug.com/2112397.html
|
CC-MAIN-2018-05
|
refinedweb
| 1,308
| 63.59
|
Obviously we are going to need our conversion routine more than once so it makes sense to convert it into a function that returns a function that approximates the data. However there are a few small changed that are worth making. The first is that the plot is from 0 to n-1 which depends on the number of points in the data set. Much better to normalize it to be in the range 0 to 1 no matter what. The original data points at 0,1,2,3 and so on are now at k/n where k runs from 0 to n-1.
The second problem is that if you examine the function returned xp[t] you will find that it contains long decimal constants that look something like:
0.101036 Sin[3.28439 - 10 π t]
The examples in Wolfram Alpha have nice rational fractions in the formulas to make them look more hand crafted. Fortunately Mathematica has a Rationalize function which will convert decimal values into exact or approximate fractions.
For example:
Rationalize[0.101036 Sin[3.28439-10 π t], 0.001]
where the 0,001 specifies the accuracy of the approximation gives:
which looks a lot more friendly - no really, it does look easier!
So we need to modify the equation a little to produce a function that does the job:
trigSeries[x_] := ( f = Chop[Fourier[x]]; n = Length[x]; hn = Ceiling[n/2]; A0 = First[f]; f = Take[f, {2, hn}]; A = Abs[f]; P = Arg[f]; Function[t, Rationalize[A0/Sqrt[n] + 2/Sqrt[n]*Total[A*Sin[Pi/2+ 2*Pi*Range[1, hn - 1]*t + P]], .001]])
If you now try this out using the original data in x and y:
x = {0, 1, 4, 6, 8, 10, 8, 6, 4, 1, 0};y = {0, 1, 1.5, 1.5, 1, 0,-1,-1.5,-1.5,-1,0};xp := trigSeries[x];yp := trigSeries[y];ParametricPlot[{xp[t], yp[t]}, {t, 0, 1}]
You will see a shape that looks a lot like the original but smoother. The reason for the smoothing is that the Fourier series is only an exact fit at the points x,y you specify. If you were to draw straight lines between these points you would have something that looks much more like the original:
Notice the curve given above is created by plotting the two parametric formulas:
which look like the sorts of equations you can see listed in Wolfram Alpha and which would have taken a long time to find by trial and error or manual skill. This may not be producing impressive graphics, but that is because what we started with wasn't impressive. Take a much bigger curve and digitize it to a set of co-ordinates and the same method will give you a pair of equations that approximate your original curve. From here it is only a short step to a portrait of Einstein - well it still quite a big step really.
The next trick is to implement the same idea in Python. You might initially think that this is impossible as Python isn't an math processing language like Mathematica. However we can do the same sort of trick by building up a string that has the same formula and then using the eval function.
You might also think that Python isn't ideal because it doesn't have a DFT function and not much in the way of plotting but these are easy to fix by importing MatPlotLib, Numpy and SciPy.
So assuming we have these modules imported let's go though the steps to build up the formula and then put the whole thing together as function later. As a sort of exercise in Pythonic code no for loops were used or harmed in the development of this function. There are very definitely places were a for loop might have done the job more efficiently but...
First we need to perform a DFT and this is just a call to the SciPy fft function:
import scipy as spimport numpy as npf=sp.fft(x)
The only problem is that SciPy uses a different definition of the DFT to Mathematica in that it doesn't use 1/sqrt(N) in the forward transform and uses 1/N in the inverse transform. These are the sort of minor differences that are sent to make numerical programming more difficult. The main point is that where we had 1/sqrt(N) in the formula we now need to use 1/N.
Next we can extract the first term A0 from f:
n=len(x)A0=abs(f[0])/n
Notice that we have already divided by n. In the case of Python it is easier to combine as many of the numerical values together as early as possible.
Before moving on it would be a good idea to convert A0 into a fraction - i.e. as we did with Mathematica's Rationalize function. Python has a fractions module that can be used to find rational approximations. You need to add
from fractions import Fraction
and you can do the conversion using:
A0=Fraction(A0).limit_denominator(1000)
The final argument specifies the largest denominator that is allowed - the bigger the more accurate the approximation. Notice that Fraction is a constructor for a fraction object and its methods.
Next we need to process the rest of the list f to get the other amplitudes and the phase angles:
hn=np.ceil(n/2) f=f[1:hn] A=2*abs(f)/n P=sp.pi/2-sp.angle(f)
In this case we remove the first term from the first half of the list and then calculate 2^A/n and the Pi/2 minus the phase angle. Why are we now subtracting the phase angle rather than adding it? The SciPi angle method returns the phase angle computed from a different origin. Again these things are sent to make math programming difficult.
|
https://www.i-programmer.info/projects/119-graphics-and-games/5735-how-to-draw-einsteins-face-parametrically.html?start=2
|
CC-MAIN-2019-13
|
refinedweb
| 1,001
| 68.3
|
Security-Oriented C Tutorial 0x09 - More on Strings
What's up guys! It's time to discuss strings in more detail.
Review
Just a revision in case you have forgotten about what buffers (arrays) are. A buffer is a container to hold data which are adjacent to each other in memory (we have seen this in the previous tutorial on memory). They have a set size which cannot be changed so it is important that you know how much space you need before declaring the array.
Strings
What is the definition of a string in C? A string is any combination of characters proceeded by a null terminating byte (\0). This means it can be a combination of ten characters, or one character, or even no characters! A string is defined with the combination of characters followed by a null terminator within a pair of double quotation marks, e.g. "This is a string".
Defining Strings
The following content will detail two common ways to define strings and what the situation and differences are per definition.
Character Array
We have seen the character array string definition before so here it is again in code:
Just a reminder, the empty square brackets means that it will automatically complete the required number of elements needed to store the string including the null byte. You may also first declare the array with a predefined element number and then manually setting each element to a character.
Pointer to a Character
We have yet to talk about pointers however, for the sake of completeness, we will go over how to define a string with a character pointer.
The variable "str" is declared as a "pointer to a character", so technically it is a pointer to the letter "T"of the string. However, when printing strings, remember that it will only stop printing wherever there is a null terminator therefore it still works. The difference between this and the character array is that the string content should not be modified. If you do so, it may result in what we call a segmentation fault which means that there had been a write access error as the content is in read-only memory. It will inevitably lead to the crashing of the program. This type of string is called a "string literal ".
You'll find that it's possible to reference an element with the character pointer variable just like an array.
The String Library
The string.h header file contains prototypes (will explain this on a tutorial on functions) of many string manipulation functions such as string comparisons, copying strings and concatenating strings. If you're interested, head to Google, search it up and see what you can find.
Conclusion
Have a look over arrays and strings again, get familiar with how they work, especially the material I covered on memory in the last tutorial. When we go over buffer overflows, we will be analyzing the contents in memory and seeing exactly what is happening under the hood.
dtm.
2 Comments
Sorry
Hello there ... here I am again trying to share my thoughts while I am currently learning C++ programming by reading this excellent tutorial and on the way I have some Ideas of how can I better illustrate myself about the concepts that DTM (the author) presents and maybe It can be helpful for you too, maybe not, maybe you already know this stuff, but just in case that there is somebody who feels kind of lost, just like me for being a total beginner, maybe it could be helpful.
On the section Pointer to Character, here there is the code presented:
#include <stdio.h>
int main(void){
char *str = "This is a string" ;
printf("%s\n", str);
return 0;
}
I will try to explain how a pointer works under memory storage perspective:
We first compile and debug it, as recommended on tutorial:
Security-Oriented C Tutorial 0x08 - A Trip Down Memory Lane.
Also, Pointer.c is the name I gave to my program and the executable file is testpointer.
Compile:
root@kali:~/Desktop/c_files# gcc -m32 -gdwarf-2 pointer.c -o testpointer
And Debug:
root@kali:~/Desktop/c_files# gdb -q ./testpointer
Reading symbols from ./testpointer...done.
(gdb)
Then we list the program setences to have a quick look where we should set our debug breaker (at least that is what I think DTM is doing). We then set the breaker on line 4 and run the executable.
(gdb) list
1 #include <stdio.h>
2 int main(void){
3 char *str = "This is a string" ;
4 printf("%s\n", str);
5 return 0;
6 }(gdb)
(gdb) break 4
Breakpoint 1 at 0x5b5: file pointer.c, line 4.
(gdb) run
Starting program: /root/Desktop/c_files/testpointer
Breakpoint 1, main () at pointer.c:4
4 printf("%s\n", str);
(gdb)
Question for an expert: Is the following reasoning correct?:
I am not sure but I think that the program has run before the printf command on line 4. In other words, the program has initialized an entity on memory, or on my way to explain it I would say that is kind of a data space on memory that will allocate the char-data string and the way to address it is by pointing it by the means of a memory address pointer, which is *str and after that the program stops.
Well, we want to know our ESP pointer (top of the stack) and EBP pointer (base of the stack) addresses in order to know from where to where it extends the program data memory:
(gdb) info registers esp ebp
esp 0xffffd3a0 0xffffd3a0
ebp 0xffffd3b8 0xffffd3b8
Correct me if I'm wrong, but what I understand from the results on the above command is that the run program data was stored from memory address 0xffffd3a0 to 0xffffd3b8. And by doing the math :D, b8 - a0+1 = 19 HEX equals to 25 memory addresses that contains the data from our program (that number would be 7 words on memory stack starting from 0xffffd3a0) . Note that 0xffffd3b8 is the bold 00 and the the memory addresses from 0xffffd3b9 to 0xffffd3bb is the 0x00000000.
(gdb) x /7xw 0xffffd3a0
0xffffd3a0: 0x00000001 0xffffd464 0xffffd46c 0x56555660
0xffffd3b0: 0xffffd3d0 0x00000000 0x00000000
Our pointer should be on the above memory range. We look for it:
(gdb) print &str
$6 = (char *) 0xffffd3ac
I think the above command is showing that str is a pointer (*) to a char-data which memory address is store on memory address 0xffffd3ac. Let's examine it.
(gdb) x 0xffffd3ac
0xffffd3ac: 0x56555660
the above command (x only) presents the entire data word (and with word I mean 4bytes=32bits) stored starting from memory address 0xffffd3ac, and guess what. What it is stored on memory address 0xffffd3ac is another memory address 0x56555660. If we take a look and check, lets say the 04 words starting from memory address 0x56555660, we'll get:
(gdb) x /4xw 0x56555660
0x56555660: 0x73696854 0x20736920 0x74732061 0x676e6972
Then our char-data "This is a string" should be there, starting from memory address 0x56555660. By counting the characters of our string, there should be 17 memory positions (including null terminator). So we take a look on it.
(gdb) x /17cb 0x56555660
0x56555660: 84 'T' 104 'h' 105 'i' 115 's' 32 ' ' 105 'i' 115 's' 32 ' '
0x56555668: 97 'a' 32 ' ' 115 's' 116 't' 114 'r' 105 'i' 110 'n' 103 'g'
0x56555670: 0 '\000'
Then you will see that 54HEX=84, 68HEX=104, 69HEX=
105, and so on ....
Well, I hope this explanation of a pointer serves somebody.
Blinko
Share Your Thoughts
|
https://null-byte.wonderhowto.com/how-to/security-oriented-c-tutorial-0x09-more-strings-0167140/
|
CC-MAIN-2017-26
|
refinedweb
| 1,264
| 66.67
|
Mixed-zoom is a feature that loads map regions in which areas that are close to the player contain a high level of detail, while areas that are further away contain progressively lower levels of detail.
The resulting scenes contain vector tiles rendered at distance-dependent zoom levels, with a horizon in the far distance. It means you can render maps that span thousands of meters or more, while using considerably less processing — which translates to a better in-game experience for players.
How it works
Mixed-zoom uses a simple map loading mechanism that uses the
Google.Maps.Loading.MapLoader component. The
Google.Maps.Loading.MixedZoom
component allows you to set additional parameters for mixed-zoom. The following
sample code demonstrates how to use mixed-zoom.
using Google.Maps; using Google.Maps.Loading; using UnityEngine; [RequireComponent(typeof(MapLoader), typeof(MixedZoom))] public class MixedZoomMapLoader : MonoBehaviour { private MapLoader MapLoader; public void Start() { MapLoader = GetComponent<MapLoader>(); MapLoader.Init(new GameObjectOptions() { ... }); } public void Update() { MapLoader.Load(); MapLoader.UnloadUnused(); } }
Script parameters
This section lists the parameters for the Map Loader script component, and the Mixed Zoom script component. The following image shows these script components in the Unity Inspector.
The Map Loader script component
- Maps Service
- The instance of the entry point to the Maps SDK for Unity, used to load the map.
- Zoom
- The zoom level used to load the map in the foreground.
- Region Shape
- An enumeration with the following two values:
- Circle: Loads a circle around the camera position. This is intended to be used when the player has panning control over the camera.
- Viewport: Loads only the portion of the map that's visible to the camera.
- Horizon
- The maximum distance from the camera position for loading the map.
- Unload Unused Seconds
- When
MapLoader.UnloadUnused()is called, unloads parts of the map that haven't been loaded or rendered in this many seconds.
The Mixed Zoom script component
- Foreground Distance
- Up to this distance from the camera, the map is loaded at the zoom level specified in
Map Loader.
- Falloff Distance
- Beyond the foreground distance, the distance between zoom levels doubles, starting with the falloff distance. See the following diagram for details:
Caveats
When using mixed-zoom, the Maps SDK for Unity switches between active and
inactive GameObjects in
OnPreRender(), depending on which objects are the most
appropriate to render for the current camera position.
|
https://developers.google.com/maps/documentation/gaming/mixedzoom
|
CC-MAIN-2020-34
|
refinedweb
| 395
| 54.52
|
CodePlexProject Hosting for Open Source Software
hi,
i am trying to get the feature present in the "old" python win editor.
Once the reference to a COM object was obtained, the auto completion worked.
If I do the equivalent in interactive VS window, all I get is MemberwiseClone and __doc__.
Is there a way to get it enabled/configured in VS or perhaps I have to call something extra?
I also tried the same in plain ipy.exe. Once -X:tabCompletion is provided the methods of the COM objects are available.
pythonwin way:
from win32com import client
ea=client.Dispatch("EA.App")
ironpython way (VS console and ipy):
from System.Runtime.InteropServices import Marshal
ea=Marshal.GetActiveObject('EA.App')
Do you want this in the normal IDE or in the REPL window? If it's just the repl window you can get this via enabling Tools->Options->Python Tools->Interactive Windows->Completion Mode->"Always evaluate expressions" and we should give
you completions off of live numbers (this is similar to -X:TabCompletion).
If it's in the editor window we are tracking this via this feature request: Please vote for it but unfortunately I don't think we'll be doing it for 1.0 at this point.
thanks! It made a difference but ...
> Do you want this in the normal IDE or in the REPL window?
My focus is interactive: REPL, ipython or pythonwin.
I did more testing and here are the results:
1) ironpython within REPL it shows more but does not include any of the COM object methods/properties.
2) cpython with ipython, the same result as above
3) cpython with ipython after makepy run over the obeject in question, partial COM object information is available (some of the methods/properties but not all)
4) cpython with pythonwin (with or without makepy info), all COM object information is available
I suspect the pythonwin interactive mode (kind of REPL) is very intelligent about the COM objects.
I can always prototype/test interactively with pythonwin and paste results into the VS.
Cheers,
Pawel
Cool - glad that helps. My guess is that the solutions that aren't working don't provide information via dir() about what members are on them. Instead they probably respond to __getattr__/__getattribute__ requests and provide the members at runtime.
pythonwin probably wraps the COM objects in something which has all of the members available. IronPython could probably improve it's COM interop to support this - not sure about normal CPython.
Are you sure you want to delete this post? You will not be able to recover it later.
Are you sure you want to delete this thread? You will not be able to recover it later.
|
http://pytools.codeplex.com/discussions/261126
|
CC-MAIN-2017-22
|
refinedweb
| 451
| 64.71
|
To help with that I've looked over the documents and parts of the source code & have built an atyle formatting options file:
///////////////////////////////////// blender_astyle_options /////////////////////////////////////////////
-t -C -N -l
#indent with tabs (4 default)
#indent classes
#indent namespaces
#break definition brackets but attach block brackets
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
It can be used from the command line as:
$> astyle --options=blender_astyle_options test.cpp
This will reformat the file 'test.cpp' to match the required system. A second file could be setup by you to change the blender source to your own personal formatting style for working on.
Of course this idea was borrowed from a different thread. And credit should go to them as well: cessen brought the topic up, xitnalta named asytle, & EWLloyd provided the link to astyle
Now please take this in the frame of mind it's ment. I only want to see the sources come to a stable standard as fast as possible. If this formatting standard is not acceptable it can be disscussed. But I will continue to lobby for a system that provides this kind of result. This may be a bit presumptuous of me, but like I said I only want blenders source to stabilize as quickly as possible.
If there are no major complaints I would be willing to start a project to reformat the current code base & build it into the make system. I also believe the current documents should be ammended to show that a system like this is in place.
One last comment about this. Some people may react violently to the thought of having to read/write code that is not in their preferred coding style. All I can say is that this reaction should be tempered by the knowledge that there are no 'standards' in coding and every shop I've worked in had different requirements. At each place I've needed to 'relearn' my coding style. Open source projects are no different. The Linux kernel project, GNU, & Apache all have formatting requirements. There is no reason why we shouldn't as well.
Thank you for keeping an open mind,
voidptr
|
https://www.blender.org/forum/viewtopic.php?t=86&view=next
|
CC-MAIN-2016-40
|
refinedweb
| 349
| 71.14
|
Not that is the thing you’d like to build, follow along and we’ll work on it together!
This is what we’re aiming for:
We’re going to be working with quite a bit of JavaScript, React and the DOM API from here on out.
First, let’s spin up a fresh projectFirst, let’s spin up a fresh project
Let’s start by bootstrapping a simple React application with styled-components tossed in for styling:
npx create-react-app react-easy-carousel cd react-easy-carousel yarn add styled-components yarn install yarn start
Styling isn’t really the crux of what we’re doing, so I have prepared aa bunch of predefined components for us to use right out of the box:
// App.styled.js import styled from 'styled-components' export const H1 = styled('h1')` text-align: center; margin: 0; padding-bottom: 10rem; ` export const Relative = styled('div')` position: relative; ` export const Flex = styled('div')` display: flex; ` export const HorizontalCenter = styled(Flex)` justify-content: center; margin-left: auto; margin-right: auto; max-width: 25rem; ` export const Container = styled('div')` height: 100vh; width: 100%; background: #ecf0f1; ` export const Item = styled('div')` color: white; font-size: 2rem; text-transform: capitalize; width: ${({size}) => `${size}rem`}; height: ${({size}) => `${size}rem`}; display: flex; align-items: center; justify-content: center; `
Now let’s go to our
App file, remove all unnecessary code, and build a basic structure for our carousel:
// App.js import {Carousel} from './Carousel' function App() { return ( <Container> <H1>Easy Carousel</H1> <HorizontalCenter> <Carousel> {/* Put your items here */} </Carousel> </HorizontalCenter> </Container> ) } export default App
I believe this structure is pretty straightforward. It’s the basic layout that centers the carousel directly in the middle of the page.
Now, let’s make the carousel componentNow, let’s make the carousel component
Let’s talk about the structure of our component. We’re gonna need the main
<div> container which as our base. Inside that, we’re going to take advantage of native scrolling and put another block that serves as the scrollable area.
// Carousel.js <CarouserContainer> <CarouserContainerInner> {children} </CarouserContainerInner> </CarouserContainer>
You can specify width and height on the inner container, but I’d avoid strict dimensions in favor of some sized component on top of it to keep things flexible.
Scrolling, the CSS wayScrolling, the CSS way
We want that scroll to be smooth so it’s clear there’s a transition between slides, so we’ll reach for CSS scroll snapping, set the scroll horizontally along the x-axis, and hide the actual scroll bar while we’re at it.
export const CarouserContainerInner = styled(Flex)` overflow-x: scroll; scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none; &::-webkit-scrollbar { display: none; } & > * { scroll-snap-align: center; } `
Wondering what’s up with
scroll-snap-type and
scroll-snap-align? That’s native CSS that allows us to control the scroll behavior in such a way that an element “snaps” into place during a scroll. So, in this case, we’ve set the snap type in the horizontal (
x) direction and told the browser it has to stop at a snap position that is in the center of the element.
In other words: scroll to the next slide and make sure that slide is centered into view. Let’s break that down a bit to see how it fits into the bigger picture.
Our outer
<div> is a flexible container that puts it’s children (the carousel slides) in a horizontal row. Those children will easily overflow the width of the container, so we’ve made it so we can scroll horizontally inside the container. That’s where
scroll-snap-type comes into play. From Andy Adams in the CSS-Tricks Almanac:.
Couldn’t say it better myself. Play around with it in Andy’s demo on CodePen.
But, we still need another CSS property set on the container’s children (again, the carousel slides) that tells the browser where the scroll should stop. Andy likens this to a magnet, so let’s put that magnet directly on the center of our slides. That way, the scroll “locks” on the center of a slide, allowing to be full in view in the carousel container.
That property?
scroll-snap-align.
& > * { scroll-snap-align: center; }
We can already test it out by creating some random array of items:
const colors = [ '#f1c40f', '#f39c12', '#e74c3c', '#16a085', '#2980b9', '#8e44ad', '#2c3e50', '#95a5a6', ] const colorsArray = colors.map((color) => ( <Item size={20} style={{background: color, borderRadius: '20px', opacity: 0.9}} key={color} > {color} </Item> ))
And dumping it right into our carousel:
// App.js <Container> <H1>Easy Carousel</H1> <HorizontalCenter> <Carousel>{colorsArray}</Carousel> </HorizontalCenter> </Container>
Let’s also add some spacing to our items so they won’t look too squeezed. You may also notice that we have unnecessary spacing on the left of the first item. We can add a negative margin to offset it.
export const CarouserContainerInner = styled(Flex)` overflow-x: scroll; scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none; margin-left: -1rem; &::-webkit-scrollbar { display: none; } & > * { scroll-snap-align: center; margin-left: 1rem; } `
Take a closer look at the cursor position while scrolling. It’s always centered. That’s the
scroll-snap-align property at work!
And that’s it! We’ve made an awesome carousel where we can add any number of items, and it just plain works. Notice, too, that we did all of this in plain CSS, even if it was built as a React app. We didn’t really need React or styled-components to make this work.
Bonus: NavigationBonus: Navigation
We could end the article here and move on, but I want to take this a bit further. What I like about what we have so far is that it’s flexible and does the basic job of scrolling through a set of items.
But you may have noticed a key enhancement in the demo at the start of this article: buttons that navigate through slides. That’s where we’re going to put the CSS down and put our JavaScript hats on to make this work.
First, let’s define buttons on the left and right of the carousel container that, when clicked, scrolls to the previous or next slide, respectively. I’m using simple SVG arrows as components:
// ArrowLeft export const ArrowLeft = ({size = 30, color = '#000000'}) => ( <svg xmlns="" width={size} height={size} <path d="M19 12H6M12 5l-7 7 7 7" /> </svg> ) // ArrowRight export const ArrowRight = ({size = 30, color = '#000000'}) => ( <svg xmlns="" width={size} height={size} <path d="M5 12h13M12 5l7 7-7 7" /> </svg> )
Now let’s position them on both sides of our carousel:
// Carousel.js <LeftCarouselButton> <ArrowLeft /> </LeftCarouselButton> <RightCarouselButton> <ArrowRight /> </RightCarouselButton>
We’ll sprinkle in some styling that adds absolute positioning to the arrows so that the left arrow sits on the left edge of the carousel and the right arrow sits on the right edge. A few other things are thrown in to style the buttons themselves to look like buttons. Also, we’re playing with the carousel container’s
:hover state so that the buttons only show when the user’s cursor hovers the container.
// Carousel.styled.js // Position and style the buttons export const CarouselButton = styled('button')` position: absolute; cursor: pointer; top: 50%; z-index: 1; transition: transform 0.1s ease-in-out; background: white; border-radius: 15px; border: none; padding: 0.5rem; ` // Display buttons on hover export const LeftCarouselButton = styled(CarouselButton)` left: 0; transform: translate(-100%, -50%); ${CarouserContainer}:hover & { transform: translate(0%, -50%); } ` // Position the buttons to their respective sides export const RightCarouselButton = styled(CarouselButton)` right: 0; transform: translate(100%, -50%); ${CarouserContainer}:hover & { transform: translate(0%, -50%); } `
This is cool. Now we have buttons, but only when the user interacts with the carousel.
But do we always want to see both buttons? It’d be great if we hide the left arrow when we’re at the first slide, and hide the right arrow when we’re at the last slide. It’s like the user can navigate past those slides, so why set the illusion that they can?
I suggest creating a hook that’s responsible for all the scrolling functionality we need, as we’re gonna have a bunch of it. Plus, it’s just good practice to separate functional concerns from our visual component.
First, we need to get the reference to our component so we can get the position of the slides. Let’s do that with
ref:
// Carousel.js const ref = useRef() const position = usePosition(ref) <CarouserContainer> <CarouserContainerInner ref={ref}> {children} </CarouserContainerInner> <LeftCarouselButton> <ArrowLeft /> </LeftCarouselButton> <RightCarouselButton> <ArrowRight /> </RightCarouselButton> </CarouserContainer>
The
ref property is on
<CarouserContainerInner> as it contains all our items and will allow us to do proper calculations.
Now let’s implement the hook itself. We have two buttons. To make them work, we need to keep track of the next and previous items accordingly. The best way to do so is to have a state for each one:
// usePosition.js export function usePosition(ref) { const [prevElement, setPrevElement] = useState(null) const [nextElement, setNextElement] = useState(null) }
The next step is to create a function that detects the position of the elements and updates the buttons to either hide or display depending on that position.
Let’s call it the
update function. We’re gonna put it into React’s
useEffect hook because, initially, we want to run this function when the DOM mounts the first time. We need access to our scrollable container which is available to use under the
ref.current property. We’ll put it into a separate variable called
element and start by getting the element’s position in the DOM.
We’re gonna use
getBoundingClientRect() here as well. This is a very helpful function because it gives us an element’s position in the viewport (i.e. window) and allows us to proceed with our calculations.
// usePosition.js useEffect(() => { // Our scrollable container const element = ref.current const update = () => { const rect = element.getBoundingClientRect() }, [ref])
We’ve done a heck of a lot positioning so far and
getBoundingClientRect() can help us understand both the size of the element —
rect in this case — and its position relative to the viewport.
The following step is a bit tricky as it requires a bit of math to calculate which elements are visible inside the container.
First, we need to filter each item by getting its position in the viewport and checking it against the container boundaries. Then, we check if the child’s left boundary is bigger than the container’s left boundary, and the same thing on the right side.
If one of these conditions is met means that our child is visible inside the container. Let’s convert it into the code step-by-step:
- We need to loop and filter through all container children. We can use the
childrenproperty available on each node. So, let’s convert it into an array and filter:
const visibleElements = Array.from(element.children).filter((child) => {}
- After that, we need to get the position of each element by using that handy
getBoundingClientRect()function once again:
const childRect = child.getBoundingClientRect()
- Now let’s bring our drawing to life:
rect.left <= childRect.left && rect.right >= childRect.right
Pulling that together, this is our script:
// usePosition.js const visibleElements = Array.from(element.children).filter((child) => { const childRect = child.getBoundingClientRect() return rect.left <= childRect.left && rect.right >= childRect.right })
Once we’ve filtered out items, we need to check whether an item is the first or the last one so we know to hide the left or right button accordingly. We’ll create two helper functions that check that condition using
previousElementSibling and
nextElementSibling. This way, we can see if there is a sibling in the list and whether it’s an HTML instance and, if it is, we will return it.
To receive the first element and return it, we need to take the first item from our visible items list and check if it contains the previous node. We’ll do the same thing for the last element in the list, however, we need to get the last item in the list and check if it contains the next element after itself:
// usePosition.js function getPrevElement(list) { const sibling = list[0].previousElementSibling if (sibling instanceof HTMLElement) { return sibling } return sibling } function getNextElement(list) { const sibling = list[list.length - 1].nextElementSibling if (sibling instanceof HTMLElement) { return sibling } return null }
Once we have those functions, we can finally check if there are any visible elements in the list, and then set our left and right buttons into the state:
// usePosition.js if (visibleElements.length > 0) { setPrevElement(getPrevElement(visibleElements)) setNextElement(getNextElement(visibleElements)) }
Now we need to call our function. Moreover, we want to call this function each time we scroll through the list — that’s when we want to detect the position of the element.
// usePosition.js export function usePosition(ref) { const [prevElement, setPrevElement] = useState(null) const [nextElement, setNextElement] = useState(null) useEffect(() => { const element = ref.current const update = () => { const rect = element.getBoundingClientRect() const visibleElements = Array.from(element.children).filter((child) => { const childRect = child.getBoundingClientRect() return rect.left <= childRect.left && rect.right >= childRect.right }) if (visibleElements.length > 0) { setPrevElement(getPrevElement(visibleElements)) setNextElement(getNextElement(visibleElements)) } } update() element.addEventListener('scroll', update, {passive: true}) return () => { element.removeEventListener('scroll', update, {passive: true}) } }, [ref])
Here’s an explanation for why we’re passing
{passive: true} in there.
Now let’s return those properties from the hook and update; transform: translate(-100%, -50%); ${CarouserContainer}:hover & { transform: translate(0%, -50%); } visibility: ${({hasItemsOnLeft}) => (hasItemsOnLeft ? `all` : `hidden`)}; ` export const RightCarouselButton = styled(CarouselButton)` right: 0; transform: translate(100%, -50%); ${CarouserContainer}:hover & { transform: translate(0%, -50%); } visibility: ${({hasItemsOnRight}) => (hasItemsOnRight ? `all` : `hidden`)}; `
So far, so good. As you’ll see, our arrows show up dynamically depending on our scroll location in the list of items.
We’ve got just one final step to go to make the buttons functional. We need to create a function that’s gonna accept the next or previous element it needs to scroll to.
const scrollRight = useCallback(() => scrollToElement(nextElement), [ scrollToElement, nextElement, ]) const scrollLeft = useCallback(() => scrollToElement(prevElement), [ scrollToElement, prevElement, ])
Don’t forget to wrap functions into the
useCallback hook in order to avoid unnecessary re-renders.
Next, we’ll implement the
scrollToElement function. The idea is pretty simple. We need to take the left boundary of our previous or next element (depending on the button that’s clicked), sum it up with the width of the element, divided by two (center position), and offset this value by half of the container width. That will give us the exact scrollable distance to the center of the next/previous element.
Here’s that in code:
// usePosition.js const scrollToElement = useCallback( (element) => { const currentNode = ref.current if (!currentNode || !element) return let newScrollPosition newScrollPosition = element.offsetLeft + element.getBoundingClientRect().width / 2 - currentNode.getBoundingClientRect().width / 2 currentNode.scroll({ left: newScrollPosition, behavior: 'smooth', }) }, [ref], )
scroll actually does the scrolling for us while passing the precise distance we need to scroll to. Now let’s attach those functions>
Pretty nice!
Like a good citizen, we ought to clean up our code a bit. For one, we can be more in control of the passed items with a little trick that automatically sends the styles needed for each child. The Children API is pretty rad and worth checking out.
<CarouserContainerInner ref={ref}> {React.Children.map(children, (child, index) => ( <CarouselItem key={index}>{child}</CarouselItem> ))} </CarouserContainerInner>
Now we just need to update our styled components.
flex: 0 0 auto preserves the original sizes of the containers, so it’s totally optional
export const CarouselItem = styled('div')` flex: 0 0 auto; // Spacing between items margin-left: 1rem; `
export const CarouserContainerInner = styled(Flex)` overflow-x: scroll; scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none; margin-left: -1rem; // Offset for children spacing &::-webkit-scrollbar { display: none; } ${CarouselItem} & { scroll-snap-align: center; } `
AccessibilityAccessibility
We care about our users, so we need to make our component not only functional, but also accessible so folks feel comfortable using it. Here are a couple things I’d suggest:
- Adding
role='region'to highlight the importance of this area.
- Adding an
area-labelas an identifier.
- Adding labels to our buttons so screen readers could easily identify them as “Previous” and “Next” and inform the user which direction a button goes.
// Carousel.js <CarouserContainer role="region" aria- <CarouserContainerInner ref={ref}> {React.Children.map(children, (child, index) => ( <CarouselItem key={index}>{child}</CarouselItem> ))} </CarouserContainerInner> <LeftCarouselButton hasItemsOnLeft={hasItemsOnLeft} onClick={scrollLeft} <ArrowRight /> </RightCarouselButton> </CarouserContainer>
More than one carousel? No problem!More than one carousel? No problem!
Feel free to add additional carousels to see how it behaves with the different size items. For example, let’s drop in a second carousel that’s just an array of numbers.
const numbersArray = Array.from(Array(10).keys()).map((number) => ( <Item size={5} style={{color: 'black'}} key={number}> {number} </Item> )) function App() { return ( <Container> <H1>Easy Carousel</H1> <HorizontalCenter> <Carousel>{colorsArray}</Carousel> </HorizontalCenter> <HorizontalCenter> <Carousel>{numbersArray}</Carousel> </HorizontalCenter> </Container> ) }
And voilà, magic! Dump a bunch of items and you’ve got fully workable carousel right out of the box.
Feel free to modify this and use it in your projects. I sincerely hope that this is a good starting point to use as-is, or enhance it even further for a more complex carousel. Questions? Ideas? Contact me on Twitter, GitHub, or the comments below!
Its looks nice. I wish you had put an example with images with different sizes, aspect ratios and difinitions tho. But, on mobile, the arrows don’t work as expected: sometimes the left arrow just doesn’t show up and sometimes clicking once on the arrow jumps two items and sometimes it simply don’t work
Maybe something broke, but at the time of this writing, the scroll snapping is not working at all for me in the demos (latest Android Chrome)
The first one did for me but not the second (the last CSS only version). But when I opened it in CodePen, it worked fine.
Might be something to do with how its embedded from CodePen.
Same here with scroll snapping not working on android chrome
It does nothing in my Chrome browser on Samsung S8. It is like there is no carousel there, only some overflow y with hidden scrollbar…
It’s not only Javascript, it’s for the ReactJS library specifically … you have to correct the title of the article.
A made a few of these some years back, it’s quite a fun exercise that teaches you a lot about React.
Here was my last iteration:
I used quite a different approach, so it might be interesting to compare them.
This one had to loop around, so I had to “virtualize” the slide elements – which also worked out nicely in terms of preloading images or other content on the slides, on the fly.
It also had to have simple gravity physics – when you drag and release, it snaps into place, which requires quite a different approach to animation, using animation frames rather than CSS, making sure the animation loop stops when the carousel is at rest, etc.
I don’t think it properly supports touch devices at this point, and I never managed to support different size slides either.
Perfecting these things is a lot of hard work.
Does it mean to work on iOS? The navigation buttons don’t seem to work on all well known web browsers for iOS I know.
also this one
If you want a native CSS/javascript carousel (no React), you can try: (I am the author)
|
https://css-tricks.com/a-super-flexible-css-carousel-enhanced-with-javascript-navigation/
|
CC-MAIN-2022-33
|
refinedweb
| 3,260
| 53.31
|
Details
Description
In the Windows port, I used ifdef(s) for the initializations to keep the current code for Linux, and added code to compile in Visual Studio. If there is no objection, maybe we could replace the current initialization code with the Visual Studio code and remove the #ifdef(s).
Here's some examples:
Eample1
ssize_t pn_data_encode(pn_data_t *data, char *bytes, size_t size)
{
#ifndef _WINDOWS
pn_atoms_t latoms =
;
#else
pn_atoms_t latoms;
latoms.size = data->size + data->extras;
latoms.start = atoms;
#endif
--------------------
Example 2
#ifndef _WINDOWS
return (pn_bytes_t)
;
#else
pn_bytes_t pnBytes;
pnBytes.size = size;
pnBytes.start= start;
return pnBytes;
#endif
--------------------
Example 3
pn_do_transfer()
#ifndef _WINDOWS
delivery = pn_delivery(link, pn_dtag(tag.start, tag.size));
#else
pn_delivery_tag_t delivt;
delivt.bytes = tag.start;
delivt.size = tag.size;
delivery = pn_delivery(link, delivt);
#endif
Activity
- All
- Work Log
- History
- Activity
- Transitions
Hi Cliff and Andrew,
Whatever you want to use for the #ifdef is fine, as long as it distinguishes the Visual Studio port. I'll change the #ifdef's accordingly.
I did find this about different compilers:
"Notice that not all compliant compilers provides the correct pre-defined macros. For example, Microsoft Visual C++ does not define _STDC, or Sun Workshop 4.2 supports C94 without setting __STDC_VERSION_ to the proper value. Extra checks for such compilers must be added.
Notice that some compilers, such as the HP aC++98 standard."
You're right. I should have said Visual Studio does not support "Designated initializers"
Thanks,
Mary
I also second Cliff's point about the #ifdef test being incorrect: Id say that the correct test would probably be something like:
#if defined(_STDC_VERSION) && __STDC_VERSION_ >= 199901L
...[existing code]
#elif __cplusplus
...[replacement code]
#else
#error Unsupported compiiler
#endif
We could protect ourselves immediately from unsupported environments by using just the STDC_VERSION test with the else and error.
[There is a useful stackoverflow article about detecting C language version here -]
Is it worth pointing out that regular brace initialisation of structures has been in C for a very long time and is certainly supported by Visual Studio c and c++.
So it's only necessary to change
pn_atoms_t latoms =
;
into
pn_atoms_t latoms =
;
Of course for many other structs it won't be so simple and will require setting default values for uninitialised members in the middle of initialised values. Also the code will no longer be as clear or safe.
I'm not sure there is any way to manage this other than as you suggest.
The downside is that the code becomes less compact and readable. Somehow, even if fancy macros could restore the compactness, I am skeptical such macros would really make for clearer code. So I am in favour of this approach in the absence of a better suggestion.
Note that your changes have nothing to do with "WINDOWS". It is all about "_cplusplus". The same for
PROTON-57. In your future examples, it would be helpful if you kept that clear.
As a corollary, since these proposed changes are about languages and not platforms, the implication is that it is less difficult for developers to code to both C99 and C++ without having multiple development machines or rely on external CI notifications. Linux proton developers should be able develop in gcc (C99) and sanity check with g++. Likewise, Visual Studio proton developers should be able to develop in their IDE and sanity check with a third party C99 toolchain. End users can just use their favourite compiler.
Just as there are C++ coding guidelines for qpid cpp
there could be similar info for proton C: the dual compilation environment, gotchas, and guidelines. I would volunteer to draft these pages as part of implementing
PROTON-57 and PROTON-67.
fixed in proton-159
|
https://issues.apache.org/jira/browse/PROTON-67
|
CC-MAIN-2015-32
|
refinedweb
| 618
| 55.03
|
Message-ID: <2111146277.799.1432300413053.JavaMail.haus-conf@codehaus02.managed.contegix.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_798_218106637.1432300413052" ------=_Part_798_218106637.1432300413052 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location:
=20
=20
This text here is based on ideas from Jochen Theodorou (see chitchat-with-groovy-compiler= a> and ast-macros-and-mixin= s)=20
Right now, there is no good macro preprocessor for Java. Annotations som= ehow come close but they don't really fit the bill. In the Java VM, annotat= ions are a runtime feature. You cannot enhance an existing class; only crea= te new ones. This means that you cannot add setters and getters to a class.==20
When you look at OR Mappers, they even do this at runtime, so there is n= o way to see what is actually happening: When the error happens, the code w= hich is executed can be completely different than what you see in the sourc= e. Even decompiling the class file will not help anymore because the inform= ation isn't there, yet. It's only added when the classloader reads the file= .=20
So from a certain point of view, Sun's solution is the worst of all worl= ds: Your code is changed at a point in time when you can't see it anymore a= nd you cannot move the modification in the compile cycle because the API si= mple doesn't allow it.=20
To know where you want to go, you must have a goal. The goal here is to = reduce the amount of code to write for a certain feature. Specifically, the= idea is to be able to move common, repeated code into a single place and b= e able to reference it easily.=20
The code must be more flexible than a method call and easier to manage t= han cut&paste.=20
A bound property in a Java bean is a field which sends notifications to = listeners when it is changed. This means it is made up of these parts:= =20
OR Mappers will only get you so far. While they will solve many or all p= roblems, they also introduce new ones:=20
So what do we expect from AST Macros in this case?=20
Some simple examples:=20
Before we look at solutions, let's look at what the code ought to do in = the end.=20
=20
class A { @BoundProperty int x }=20
should become=20
import javax.beans.*; class A { // the following is added only once per class PropertyChangeSupport propertyChangeSupport void addPropertyChangeListener(PropertyChangeListner listner) { propertyChangeSupport.addPropertyChangeListner(listener) } void addPropertyChangeListener(String property, PropertyChangeListner l= istner) { propertyChangeSupport.addPropertyChangeListner(property, listener) } void removePropertyChangeListener(PropertyChangeListner listner) { propertyChangeSupport.removePropertyChangeListner(listener) } void removePropertyChangeListener(String property, PropertyChangeListne= r listner) { propertyChangeSupport.removePropertyChangeListner(property, listene= r) } PropertyChangeSupport[] getPropertyChangeListeners() { return propertyChangeSupport.getPropertyChangeListeners } // the following is added per each annotated proeprty private int x void setX (int x) { =09propertyChangeSupport.firePropertyChanged('x', this.x, this.x =3D x) } int getX() { return x; } }=20
specifically:=20
This leads to a couple of demands which an AST Macro Processor (AMP) mus= t met:=20
In a perfect world, an AMP should be able to modify the code on a source= level and pass it back to an IDE, for example, so that I can see (and debu= g) what is actually compiled (instead of only seeing the Annotation).= =20
SQL enhanced code is pretty similar to bound properties but more code is=
generated. The first step is to define the class which maps a database tab=
le to a Java object:
@Entity class Foo { @Id @Column (type:java.sql.Types.INTEGER) int id @Column (type:java.sql.Types.CHAR, size:20) String name }=20
=20
= After this is compiled, I want to see a special field "SQL" which= I can use to build database queries like so:
def columns =3D [Foo.SQL.value, Foo.SQL.name] def cond =3D Sql.WHERE () { Foo.SQL.id >=3D 5 && Foo.SQL.name != =3D null } def list =3D Sql.SELECT (columns, table:Foo.SQL.TABLE, where:cond, class:Fo= o.class)=20
=20
= This gets converted by the compiler into:
def list =3D [] def _sql =3D "SELECT id, name FROM foo WHERE id >=3D ? AND name IS = NOT NULL" _sql =3D Sql.eachRow (_sql, [5]) { Foo o =3D new Foo () o.id =3D it[0] o.name =3D it[1] list << o }=20
=20
= The SQL object in Foo also gives access to the standard DAO methods like lo= ading an object by its primary key:
def foo =3D Foo.SQL.load (5)=20
=20
= In addition to the simple bound property example, the AMP must also be able= to note the usage of an annotated object, so it can convert the Groovy cod= e into SQL at compile time (and possibly check it for mistakes).
Groovy 1.x must run on Java 1.4. We must decide what to do with non-macr= o annotations, whether we want to support a switch to generate Java 5 class= files (so Groovy can generate code for third party APTs like Hibernate)= =20
It seems that it is possible to write annotations into Java 1.4 classfil=
es (see Commons Attributes). But the questions =
is: Is this futile? There are only a few tools which support annotations
and Java 1.4.
In this light, it makes more sense to add a switch to allow Groovy to wr= ite Java 5 classfiles, so users stuck to 1.4 can still use it and Java 5 us= ers can upgrade when they want to.=20
The compiler needs a way to decide what to do with an official Java 5 an=
notation like
javax.persistence.Entity which is defined in EJB=
3: Expand it as a macro or pass it on into the class file so a third party =
library/tool can process it later.
Here, the user might want to decide differently per class (i.e. handle m= ost of these cases with Hibernate and some corner cases with her own AST ma= cro).=20
For Groovy-specific macros, the solution is to add a marker interface to= the macro annotation.=20
Options=20
javax.persistence.Entity
|
http://docs.codehaus.org/exportword?pageId=78425
|
CC-MAIN-2015-22
|
refinedweb
| 1,043
| 54.42
|
Dave Kuhlman
Release 1.00
Mar. 28, describes fsmGenerate.py. It explains what it does and how to use it. fsmGenerate.py generates skeletons of FSM/REST Web applications.
fsmGenerate.py can produce:
And, optionally fsmGenerate.py will package the entire generated application into a .zip file that can be imported (by Python 2.3).
fsmGenerate.py generates an FSM/REST application for the Quixote Web application server. For more information on FSM/REST see REST and FSM and BP for Quixote How-to.
fsmGenerate.py generates source code for an FSM/REST web application. The application is a skeleton in the sense that code implementing the special behavior of each state must be added by hand. (Note for future work: The FSM/REST application is generated from an XML document that describes the FSM. It may be possible to ``enrich'' that document so that it contains implementations of behaviors that implement actions and conditions used by each state.)
The application is structured as an FSM (finite state machine). This means that each request from a client provides input values that are used by the application (the current state in particular) to determine and perform a transition. Performing the transition causes the FSM to execute an action and select a new current state.
The application is a REST (representation state transfer) application. This means, among other things, the following:
The server and the client communicate with each other by passing XML documents back and forth. The definition of the XML interchange document is specific to each state in the FSM. For each state, fsmGenerate.py generates an XML Schema definition which describes the XML interchange document for that state. In addition, generateDS.py is used to translate the XML Schema document input Python code that implements a parser for the XML interchange document and classes that represent the elements defined by the XML Schema document.
The generated implementation is structured as a Python package (a directory containing a __init__.py file). The package contains a module (a Python .py file) for each state in the FSM. Each of these ``state'' modules contains a class that implements the state.
fsmGenerate.py generates a directory, which, because it contains a __init__.py file, is a Python package.
This package will contain, depending on the command-line options given to fsmGenerate.py and used to generate it, the following:
This section describes a suggested sequence of steps to be followed in using fsmGenerate.py.
You must create an FSM-XML document that describes your application. This FSM-XML document is used as input to fsmGenerate.py, which uses it to create the application and a client user interface (GUI).
The FSM-XML document contains elements that describe each state in the FSM. The distribution (fsmGenerate_examples.zip) contains an XML Schema (fsm.xsd) that describes the FSM-XML document type. There is also a sample document (fsm_plants.xml). Here is a brief description of the elements in that document:
fsm -- The wrapper element for the whole document. Contents:
state -- Contents:
transition -- Contents:
inputs -- Contents:
field -- Each field results in the generation of a graphical user interface (GUI) control in the .wxg file generated for wxGlade. Contents:
Run fsmGenerate.py to produce the application and support code. You can find fsmGenerate.py in the distribution file: fsmGenerate_examples.zip.
Here is the ``help'' message from fsmGenerate.py:
fsmGenerate -- Generate Quixote application skeleton, wxGlade GUI definition, and X Schema definitions for FSM REST Web application. Usage: python fsmGenerate.py [options] <in_file_name> <out_name> Options: -h, --help Display this help message. -a, --app Generate Quixote application skeleton. -g, --gui Generate .wxg file for client-side GUI. -s, --schema Generate .xsd X Schema files for XML interchange docs. -z, --zip Zip into PyZipFile. Example: python -a -g -s -z fsmGenerate.py myapp1
And, here is a description of the options:
Because modifying and extending the code generated by fsmGenerate.py depends so much on your application and your needs, this section can at most contain guidelines. However, I'll at least try to offer suggestions on where to put things and how to use the generated code.
First, let's make clear what they are. The generated .xsd files describe the XML documents that are passed back and forth between an FSM/REST server and a client. Thus, from the client's point of view, the client must generate an XML document that satisfies the X Schema for the current state and submit that document as the content of the client's request. Likewise, from the client's point of view, the client will receive an XML document from the the server as the result of a request. From the server's point of view, the server will receive (and must parse) a document whose contents are described by the XML Schema for the current state. And, also from the server's point of view, the server must generate an XML document that satisfies the XML Schema for the current state as the representation of the resource for the current request.
Note that these modules generated by generateDS.py are there to help you but are not strictly necessary. Any of a variety of other methods for processing the XML interchange documents with Python could be used. Some examples are (1) using Python's DOM or minidom support and (2) using David Mertz's Gnosis tools (see the ``See Also'' section, below).
fsmGenerate.py helps you process the XML interchange documents by using generateDS.py to produce code that can parse a state specific XML interchange document and then access the elements in that document. It does this by loading the XML document into instances of (generated) Python classes that represent the elements.
For a given state ``X'', fsmGenerate.py produces the following files:
Here is an example of code that uses a sample module to parse and XML interchange document and then to extract an input value from it:
import Xsub o o o doc = Xsub.parseString(content) value = doc.getFsminput().getArg1()
And, here is another example. This one sets a value in the interchange document structure, then uses that structure to generate XML content:
import Xsub import StringIO o o o doc = Xsub.parseString(content) value = doc.getFsminput().getArg1() o o o doc.getFsmoutput().setContent(someNewContent) contentStream = StringIO.StringIO() doc.export(contentStream, 0) newContent = contentStream.getvalue() contentStream.close() # # Do something with newContent. #
For each state named ``X'' in the FSM XML specification file, fsmGenerate.py generates a file named X.py. You can add application specific code to each of these Python modules.
Here is an example -- a generated module that implements a state named ``Plant'':
# Plant.py # from states import State class Plant(State): def __init__(self, doc): State.__init__(self, doc) def _q_index(self, request): nextState = None # Transition tr_plant_1 if compareArg(arg1, "fruit"): nextState = 'Fruit' action2() # Transition tr_plant_2 if compareArg(arg1, "vegetable"): nextState = 'Vegetable' action3() self.doc.setFsmcurrentstate(nextState) content = self.generateContent() self.setXmlResponse(request) return content
Here are some things you will need to do to this generated code:
The generated file has the name gui.wxg.
Start up wxGlade and then open this file.
This file contains a number of dialog/frame definitions, one for each state in the FSM. From within wxGlade, you can modify these dialog definitions, then use wxGlade to generate Python code that implements the dialogs. If you do not change the name of the output, it will generate a Python file/module named gui.py.
You will want to implement a client. I'm going to assume that you will do this in Python. If you want to implement your client in some other programming language, you will have to do a bit of translation of my guidance.
The distribution contains a minimal example of a client: client.py. There are more client examples in the fsm examples file, which are described in dkuhlman/fsm_howto.html.
Here are a few comments and guide-lines:
If your client talks to a warm body and you want that end-user to be able to enter input values into a graphical user interface, then you may want to use the ``- -gui'' option and then work with the generated .wxg file. Here are a few suggestions:
It would be helpful if we could capture FSM XML files from a BPML. We might even consider modifying fsmGenerate.py (actually, the underlying fsmgenapp module) so that it could read the BPML directly.
Another possibly approach would be to take a UML diagram editor such as PyUt, and modify it so that it can export our FSM XML documents. I am investigating that one. I'll have to resolve the following questions, at least:
Requirements and desirables -- What would make this usable and valuable? Remember that our goal is to connect BPs to FSMs, i.e. to implement BPs on the Web with FSM/REST.
The examples discussed in this document pass the current state name between the server and the client by including that state name in the XML interchange document. Doing so makes things a bit awkward because (1) you need the current state name in order to determine which parser to use and (2) before you can determine the current state name (and thus the document type), you must at least partially parse the document.
This means that you have to use something like SAX or a regular expression to partially parse the document and obtain the state name and, then use the generated parser to parse the document. (The generated code and the sample client (client.py) use a regular expression.)
A possibly more convenient approach might be to pass the current state as part of the URI. This would solve the problem for the server, though not for the client.
In order to use fsmGenerate.pyyou will need several software packages. See the "See Also" section for links to these packages.
Thanks to the implementors of Quixote for producing an exceptionally usable application server that is so suitable for REST.
Thanks to Alberto Griggio <albgrig@tiscalinet.it> for wxGlade.
See Also:.
|
http://www.rexx.com/~dkuhlman/fsmGenerate_howto.html
|
crawl-002
|
refinedweb
| 1,680
| 58.38
|
Cross-platform, language-agnostic binary package manager
.qfiles?
linux-64with the subdir that you are interested in. There are also compressed files as well (.json.bz2)
conda init --reversebut that didn't reverse
$PATH
conda config --describe
micromamba(or
µmambawhich will be a statically linked executable, hehe)
dnf, I think there is a
microdnfas well, right?
conda installstill accurate for recent conda versions? Is there any way to control the cache location or otherwise make the cache threadsafe?
jqlibrary, I installed using
conda install -c conda-forge jq. The install was on a brand new installation of conda and a fresh env. The installation went ok, but I can't
import jq, it says the Module can't be found
conda list, but the one marked
conda-forge, so maybe I'm missing something
|
https://gitter.im/conda/conda?at=5ea9da219f0c955d7d941627
|
CC-MAIN-2021-43
|
refinedweb
| 134
| 57.57
|
Using IndexedDB in Web Browser — All in Java with Mrs. Gwitany and Dr. Jackl
This story isn’t about Java Applet or Java WebStart, this story is a pure JavaScript story presented by Mrs. Gwitany and Dr. Jackl, generally known as GWT and J2CL.
In the world of web browser JavaScript is the king, so all the Web APIs are based on JavaScript. The Mozilla Developer Network (MDN) is the source of truth for the Web APIs. It looks awesome and it explains everything with examples very nicely. So if you want to build web apps you surely need the MDN documentation.
Lesson 1: consider Mozilla Developer Network (MDN) and Web APIs as your best friend.
In this story I will show you how we can use Web APIs from GWT / J2CL transpiler. For this purpose I chose IndexedDB API. From the documentation on MDN here is the definition of Index.
Following simple logic should be implemented with IndexedDB:
- The web app will create an IndexedDB database when a user open the web app for the first time. If there is no database / datastore available it will create a new database and insert some values.
- If we open the web app for the next time and the database is already there, the web app will just insert some values. That’s all.
As we have learned from the article “Learn Once Use Everywhere: Using JavaScript APIs in Java for Web Browser” we need JsInterop classes which bridge the access from Java to the IndexedDB API (use case 2). Surely we can build the JsInterop classes manually by ourself but we don’t have to. Elemental2 library from Google is here to help. Elemental2 library is a thin bridge and it contains a collection of JsInterop classes to access available Web APIs. We can use these classes directly in our Java web app. So what are the steps to use Elemental2 library? Here you are…
First Step: you need to add the needed Maven dependencies, in this case the IndexedDB Elemental2 library, to your pom.xml.
<dependency>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-indexeddb</artifactId
<version>1.1.0</version>
</dependency>
Lesson 2: before you create JsInterop classes manually take a look at Elemental2 library, for most Web APIs there are already the JsInterop classes created for you.
Second Step: The documentation of Elemental2 library for IndexedDB is very rare, so you need to use the MDN documentation for IndexedDB. The documentation is great and comes with some examples. For the IndexDB topic there are also some good documentations and articles:
- Working with IndexedDB from Google. In this article you need to understand the difference working with IndexedDB API and IndexedDB promised library. At the appendix you have a comparison between those two. With Elemental2 we only use the IndexedDB API.
- How to use IndexedDB to build Progressive Web Apps: this is a very good article to start with IndexedDB.
- Some Elemental2 general examples
With above docs and articles you are ready to implement IndexedDB functions with Elemental2.
Lesson 3: search for articles and documentations about the topic first. Most of the articles are for JavaScript but don’t panic, you will understand what you have to do in Java since it is very similar. Remember: the programming model in JavaScript is mostly based on events, promises, asynchronous programming model. The Elemental2 APIs will look very similar to the JavaScript APIs.
Third Step: The first problem I encounter was to check, whether IndexedDB is available on the web browser with following JavaScript code:
if ('indexedDB' in window) {
console.log('This browser doesn\'t support IndexedDB');
return;
}
After asking to the GWT Gitter Chat (this is definitely the place to ask for GWT / J2CL / Elemental2 topics) I got following solutions in Java:
// General solution with JsInterop
Window window = DomGlobal.window;
if (Js.asPropertyMap(window).has("indexedDB") {
logger.info("IndexedDB found");
}... or ...// Use Elemental2 specific global variable
IDBFactory indexedDB = IndexedDbGlobal.indexedDB;
if (indexedDB != null) {
logger.info("IndexedDB found");
}
After getting the solution for the first obstacle, the rest is easy as things are working just the same as in the JavaScript solution. Very interesting is the asynchronous programming model in JavaScript which is not usual for Java developers. Here is the code for checking the database / datastore when it is not there yet, so you need to create it first.
JavaScript:
openDBRequest.onupgradeneeded = function(event) {
// Create object store from db or event.target.result
};
Java with Lambda:
openDBRequest.onupgradeneeded = event -> {
// Create object store from db or event.target.result
return null;
};
As you can see the code is quite similar. The return “null” in Java is not nice but it is needed because the Elemental2 libraries are generated from Closure libraries (more on the generation topic later).
With these three steps you would be able to finish the implementation of the simple logic for IndexedDB above. The complete Java class is implemented in the file IndexedDbElemental2.java. Now we can run the web app. Just go to the directory of the Maven project indexeddb-elemental2-example and run following command:
mvn gwt:generate-module gwt:devmode
We can debug the Java code, change it and reload it. Everything will be automatically transpiled and hot reloaded. Debugging works very well by adding a breakpoint on the sourcemaps in Google Chrome.
To see the result you just need to go to the “Application” bar on the Chrome and look for the “Storage” area on the left. At the menu IndexedDB you will find our generated database and datastore. By clicking the “refresh” button to the table you can see the content of the datastore. In this example we save the Product object on each reload of the index.html. On each reload we create the IndexedDbElemental2 object and open the database. Here is the EntryPoint class AppEntryPoint:
package com.github.lofi.client;
...
public class AppEntryPoint implements EntryPoint {
@Override
public void onModuleLoad() {
new IndexedDbElemental2().openDb();
}
}
That’s it! You can check the whole file IndexedDbElemental2 and you’ll see that the shape is quite similar to the JavaScript example, which makes for us very easy to implement as long as we can find some good JavaScript articles or examples for the topic.
To conclude this story I want to show you the background how Elemental2 libraries are built. The Elemental2 libraries are mostly generated with the help of JsInterop Generator. Here is the description of JsInterop Generator project:
The jsinterop generator is a Java program that takes closure extern files as input and generates Java classes annotated with JsInterop annotations. This project is used for building Elemental2 [library]. Any other uses are experimental. You can use it to generate Java APIs for other JavaScript libraries but we don’t provide any official support. Feel free to open issues on the GitHub issue tracker, though.
It is important to know that we actually can get the JsInterop files through automated generation since they are only contracts between Java and JavaScript world.
In the mean time there is also another generator Webtack Generator which generates the JsInterop files with more Java orientation and nicer Javadocs. Do you remember the “return null” above? Here on this page you can see the differences of generated file by JsInterop Generator (Elemental2) and Webtack Generator (aka. Elemental3). For a comparison I created the same project but using Webtack JsInterop for IndexedDB: indexeddb-elemental3-example. Check it out and take a look the IndexedDB API (IndexedDbElemental3), it looks cleaner and more Java oriented.
Lesson 4: try to generate the JsInterop files you need, check whether someone works for Mrs. Gwitany and Dr. Jackl already did this or use JsInterop Generator / Webtack Generator to generate them automatically. Remember: JsInterop files are only the contract between Java and JavaScript world.
Mrs. Gwitany and Dr. Jackl are not alone with their transpiler tooling. TypeScript transpiler and Kotlin to JavaScript transpiler are quite similar. The main difference is if you use Spring Boot (Java) on the server side you have the same language, tooling and bullet proof mechanism also on the client side on the browser, so you can Learn Once Use Everywhere!
This diagram below shows the way to access the Web Browser APIs from Java.
Epilog: Many greets from Mrs. Gwitany and Dr. Jackl and I hope you also enjoy the four lessons mentioned in this story. Next time they’ll show us how to make this IndexedDB example more maintainable and testable by using Dependency Injection, Service / Repository pattern and Mock object — which are a bullet proof mechanism in developing Java apps for and from Java developers.
All examples can be found at:
Padlet for GWT / J2CL modern programming:
|
http://lofidewanto.medium.com/using-indexeddb-in-web-browser-all-in-java-with-mrs-gwitany-and-dr-jackl-388188468541
|
CC-MAIN-2021-21
|
refinedweb
| 1,446
| 56.15
|
Introduction.
Prerequisites
- Install .NET Core 2.1 Preview 2 SDK from here
- Install Visual Studio 2017 v15.7 or above from here
- Install ASP.NET Core Blazor Language Services extension from here
- SQL Server 2008 or above
Blazor framework is not supported by versions below Visual Studio 2017 v15.7.
Source Code
Before proceeding, I would recommend that you get the source code from GitHub.
Creating Tables
We will be using two tables to store our data.
- Country: used to store the name of the Country. It contains two fields — CountryId and CountryName.
- Cities: This contains the list of cities for the Countries we will insert in the Country table. It contains three fields — CityId, CountryId, and CityName. The CountryId column is a foreign key referring to CountryId in the Country table.
Execute the following commands to create both tables:
CREATE TABLE Country(CountryId VARCHAR(5) PRIMARY KEY,CountryName VARCHAR(20) NOT NULL)GOCREATE TABLE Cities(CityId VARCHAR(5) PRIMARY KEY,CountryId VARCHAR(5) FOREIGN KEY REFERENCES Country(CountryId),CityName VARCHAR(20) NOT NULL)GO
Now we will put some data in both of the tables. Open the Country table and execute the following insert statement.
INSERT INTO Country VALUES ('C1', 'India')INSERT INTO Country VALUES ('C2', 'China')INSERT INTO Country VALUES ('C3', 'USA')
Then execute the following insert statements to insert data into the Cities table.
INSERT INTO Cities VALUES ('P1','C1','New Delhi')INSERT INTO Cities VALUES ('P2','C1','Mumbai')INSERT INTO Cities VALUES ('P3','C1','Chennai')INSERT INTO Cities VALUES ('P4','C1','Hyderabad')INSERT INTO Cities VALUES ('P5','C1','Bengaluru')INSERT INTO Cities VALUES ('P6','C2','Beijing')INSERT INTO Cities VALUES ('P7','C2','Shanghai')INSERT INTO Cities VALUES ('P8','C2','Hong Kong')INSERT INTO Cities VALUES ('P9','C2','Macau')INSERT INTO Cities VALUES ('P10','C3','New York')INSERT INTO Cities VALUES ('P11','C3','Chicago')INSERT INTO Cities VALUES ('P12','C3','Las Vegas')
Create Blazor Web Application
Open Visual Studio and select File >> New >> Project.
After selecting the project, a “New Project” dialog will open. Select .NET Core inside the Visual C# menu from the left panel. Then, select “ASP.NET Core Web Application” from the available project types. Name the project “BlazorDDL” and press OK.
After clicking on OK, a new dialog will open asking you to select the project template. You can see two drop-down menus at the top left of the template window. Select “.NET Core” and “ASP.NET Core 2.0” from these dropdowns. Then, select the “Blazor (ASP .NET Core hosted)” template and press OK.
Now, our Blazor solution will be created. You can see the folder structure in Solution Explorer as shown in the below image.
You can see that we have three project files created inside this solution.
- BlazorDDL.Client: it has the client side code and contains the pages that will be rendered on the browser.
- BlazorDDL.Server: it has the server side code, such as DB related operations and web API.
- BlazorDDL.Shared: it contains the shared code that can be accessed by both client and server.
Scaffolding the Model to the Application
We are using Entity Framework core database first approach to create our models. We will create our model class in the “BlazorDDL.Shared” project so that it can be accessible to both the client and server project.
Navigate to Tools >> NuGet Package Manager >> Package Manager Console. Select “BlazorDDL.Shared” from the Default project dropdown. Refer to the image below:
First we will install the package for the database provider that we are targeting, which is SQL Server in this case. Run the following command:
Install-Package Microsoft.EntityFrameworkCore.SqlServer
Since we are using Entity Framework Tools to create a model from the existing database, we will install the tools package as well. Run the following command:
Install-Package Microsoft.EntityFrameworkCore.Tools
After you have installed both packages, we will scaffold our model from the database tables using the following command:
Scaffold-DbContext "Your connection string here" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Tables Country, Cities
Do not forget to put your own connection string (inside “ ”). After this command gets executed successfully, you can see that a Models folder has been created and contains three class files: “myTestDBContext.cs”, “Cities.cs”, and “Country.cs”. And so we have successfully scaffolded our Models using EF core database first approach.
At this point in time, the Models folder will have the following structure.
Creating the Data Access Layer for the Application
Right click on “BlazorDDL.Server” project and then select Add >> New Folder and name the folder “DataAccess”. We will be adding our class to handle database-related operations inside this folder only.
Right click on the “DataAccess” folder and select Add >> Class. Name your class “DataAccessClass.cs”. This class will handle our database-related operations.
Open “DataAccessLayer.cs” and put the following code into it.
using BlazorDDL.Shared.Models;using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;namespace BlazorDDL.Server.DataAcces{ public class DataAccessLayer { myTestDBContext db = new myTestDBContext(); public IEnumerable<Country> GetAllCountries() { try { return db.Country.ToList(); } catch { throw; } } public IEnumerable<Cities> GetCityData(string id) { try { List<Cities> lstCity = new List<Cities>(); lstCity = (from CityName in db.Cities where CityName.CountryId == id select CityName).ToList(); return lstCity; } catch { throw; } } }}
Here we have defined two methods:
- GetAllCountries: it will fetch all the country data from the country table.
- GetCityData: it will fetch the city data corresponding to the country id provided to it.
Now our data access layer is complete. We will proceed to create our web API Controller.
Adding the web API Controller to the Application
Right click on the “BlazorDDL.Server/Controllers” folder and select Add >> New Item. An “Add New Item” dialog box will open. Select “ASP.NET” from the left panel, then select “API Controller Class” from templates panel and name it “CountriesController.cs”. Press Add.
This will create our API “CountriesController” class.
We will call the methods of the “DataAccessLayer” class to fetch data and pass on the data to the client side.
Open the “CountriesController.cs” file and put the following code into it.
using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;using BlazorDDL.Server.DataAcces;using BlazorDDL.Shared.Models;using Microsoft.AspNetCore.Mvc;using Microsoft.AspNetCore.Http;namespace BlazorDDL.Server.Controllers{ public class CountriesController : Controller { DataAccessLayer objCountry= new DataAccessLayer(); [HttpGet] [Route("api/Countries/GetCountryList")] public IEnumerable<Country> GetCountryList() { return objCountry.GetAllCountries(); } [HttpGet] [Route("api/Countries/GetCities/{id}")] public IEnumerable<Cities> GetCities(string id) { return objCountry.GetCityData(id); } }}
At this point in time, our BlazorDDL.Server project has the following structure.
We are done with our backend logic. Therefore, we will now proceed to code our client side.
Adding Razor View to the Application
Right click on the “BlazorDDL.Client/Page”s folder and then select Add >> New Item. An “Add New Item” dialog box will open. Select Web from the left panel, then select “Razor View” from the templates panel and name it “CountryData.cshtml”.
This will add a “CountryData.cshtml” page to our “BlazorDDL.Client/Pages” folder.
Open the “CountryData.cshtml” page and put the following code into it.
@using BlazorDDL.Shared.Models@page "/country"@inject HttpClient Http<h1>Country Data</h1><p>This component demonstrates cascading dropdownlist using EntityFrameWork Core</p><hr />@if (countryList == null){ <p><em>Loading...</em></p>}else{ <div class="row"> <div class="col-md-4"> <label for="Country" class="control-label">Country</label> </div> <div class="col-md-4"> <label asp-Cities</label> </div> </div> <div class="row" style="padding-top:10px"> <div class="col-md-4"> <select class="form-control" onchange="@CountryClicked"> <option value="">-- Select Country --</option> @foreach (var country in countryList) { <option value="@country.CountryId">@country.CountryName</option> } </select> </div> <div class="col-md-4"> <select class="form-control" onchange="@CityClicked"> <option value="">-- Select City --</option> @if (cityList != null) { @foreach (var city in cityList) { <option value="@city.CityName">@city.CityName</option> } } </select> </div> </div> <div class="row" style="padding-top:50px"> <div class="col-md-4"> <label class="control-label">Country Name: @countryName</label> </div> <div class="col-md-4"> <label class="control-label">City Name: @cityName</label> </div> </div>}@functions {List<Country> countryList = new List<Country>();List<Cities> cityList = new List<Cities>();string countryId { get; set; }string countryName { get; set; }string cityName { get; set; }protected override async Task OnInitAsync(){ countryList = await Http.GetJsonAsync<List<Country>>("api/Countries/GetCountryList");}protected async void CountryClicked(UIChangeEventArgs countryEvent){ cityList.Clear(); cityName = string.Empty; countryId = countryEvent.Value.ToString(); countryName = countryList.FirstOrDefault(s => s.CountryId == countryId).CountryName; cityList = await Http.GetJsonAsync<List<Cities>>("api/Countries/GetCities/" + countryId); this.StateHasChanged();}void CityClicked(UIChangeEventArgs cityEvent){ cityName = cityEvent.Value.ToString(); this.StateHasChanged();}}
Let’s understand this code.
At the top, we have included BlazorDDL.Shared.Models namespace so that we can use our Country and Cities model class on this page. We define the route of this page using the @page directive. So, in this application, if we append “/country” to the base URL, then we will be redirected to this page. We are also injecting HttpClient service to enable the web API call.
Then we have defined the HTML section to display two Dropdown lists on our web page. We are calling the “CountryClicked” method on the “onchange” event of the Country dropdown. This method will call the “GetCites” web API method to fetch the city data from the Cities table corresponding to the countryid of the selected country.
We are also setting the value of the “countryName” property to the selected country. The “StateHasChanged” method is invoked to refresh the UI. This will ensure that the City dropdown list will get refreshed on changing the country dropdown.
Similarly, we have another dropdown list to display cities data corresponding to each country. On the “onchange” event of the Cities dropdown, we are setting the value of the “cityName” property to the selected city.
We are also displaying the selected country name and city name value on the webpage.
The @functions section contains all our properties and methods. We have defined two variables: countryList of type Country, and cityList of type City. These handle the countries and cities data, respectively. We have also declared three properties to handle the countryId, countryName, and cityName data.
Inside the “OnInitAsync” method, we are calling the GetCountryList web API method to populate countryList. This variable is used to bind the data to the Country dropdown list on page load.
Adding the Link to the Navigation menu
The last step is to add the link to our “CountryData” page in the navigation menu. Open the “BlazorDDL.Client/Shared/NavMenu.cshtml” page and put the following code into it.
<div class="top-row pl-4 navbar navbar-dark"> <a class="navbar-brand" href="/">BlazorDDL<="/country"> <span class="oi oi-list-rich" aria-</span> Country </NavLink> </li> </ul></div>@functions {bool collapseNavMenu = true;void ToggleNavMenu(){ collapseNavMenu = !collapseNavMenu;}}
Now we have completed our cascading dropdown list application.
Execution Demo
Launch the application.
A web page will open as shown in the image below. The navigation menu on the left shows the navigation link for the CountryData page.
Click on “country” in the navigation menu. It will redirect to the CountryData view where you can see two dropdown s— Country and Cities — on the page. Notice the URL has “/country ” appended to it as we have defined it using the @page directive.
Here you can see both the dropdown lists. The Country dropdown list is already populated with the country data. If we select any country name from this dropdown, then the city dropdown will also get populated with the corresponding city data. We can also see the selected country and city values in the labels below both drop down lists.
Hosting the application
To learn how to host a Blazor application using IIS , refer to Deploying a Blazor Application on IIS
Conclusion
We have learned how to create cascading dropdown lists in Blazor using Entity Framework Core database first approach with the help of Visual Studio 2017 and SQL Server 2014. Please get the source code from GitHub and play around to get a better understanding.
Get my book Blazor Quick Start Guide to learn more about Blazor.
You can check my other articles on Blazor here
You can also find this article at C# Corner.
See Also
- ASP.NET Core — Getting Started With Blazor
- ASP.NET Core — CRUD Using Blazor And Entity Framework Core
- ASP.NET Core — CRUD Using Angular 5 And Entity Framework Core
- ASP.NET Core — CRUD With React.js And Entity Framework Core
- ASP.NET Core — Using Highcharts With Angular 5
Originally published at
|
https://www.freecodecamp.org/news/how-to-create-a-cascading-dropdownlist-in-blazor-using-ef-core-d230bb5bff5f/
|
CC-MAIN-2021-04
|
refinedweb
| 2,098
| 50.43
|
If you consult Books Online (BOL), you'll find several relevant entries, including OPENXML and OPENROWSET. All the examples supply the XML text as a declared variable, which is convenient for the documentation staff but not for the developer who wants to read an XML file and treat it accordingly. To make sense of this onion, perhaps it's best to approach it from the inside out.
OPENXML is a rowset function (i.e., one that returns a rowset), and it works similarly to the rowset functions OPENQUERY and OPENROWSET. Using OPENXML, you can perform JOINs to XML data without actually importing the data first. You could also use it in conjunction with INSERT. . . SELECT, UPDATE, and DELETE.
However, to use OPENXML, you must perform two tasks that aren't required with OPENQUERY and OPENROWSET. These tasks require two system stored procedures.
The first, sp_xml_preparedocument, reads the specified XML text and moves its contents into memory. Here's the syntax:
sp_xml_preparedocument @hdoc =
[, @xmltext =
[, @xpath_namespaces =
The parameters are:
- @hdoc: a handle (effectively a pointer) to a region of memory where some data of interest resides. Note that it is an output variable--after the procedure runs, the variable will contain the handle to the XML file's contents in memory. Be sure to save the result since you'll need it later.
- @xmltext: the actual XML text you want to process.
- @xml_namespaces: any namespace references that your XML requires in order to operate correctly. Note that any URLs here need to be delimited with angle brackets (<>).
Assuming that the parameters you passed are valid and the XML text is sound, your XML data will reside in memory. Now you call sp_xml_preparedocument, passing the variable containing your XML file, and then OPENXML, whose syntax is a little more involved:
OPENXML(idocint [in],rowpatternnvarchar[in],[flagsbyte[in]])
[WITH (SchemaDeclaration | TableName)]
Note: There isn't enough space in this tip to describe the parameters that OPENXML accepts. See BOL for more information; search for OPENXML in Transact-SQL Reference.
Now we have the back end in place. All that remains is importing an actual XML file into SQL for processing. (It's curious how all the BOL examples leave this crucial part unattended.)
(I have to acknowledge the invaluable assistance of my colleague Billy Pang, who helped me work through this problem. He inspired the code that follows, though I tailored it for the specific requirements. Thanks, Billy!)
The basic trick is, read the file as text, line by line. Then, concatenate all the resulting rows into a large VARCHAR variable. Finally, pass this variable into the foregoing code.
Here is the code to read the file and store its contents into a variable:
Now you have the entire contents of the file in the variable @FileContents. All you have to do is plug said variable into the @xmltext parameter to sp_xml_preparedocument, and then call OPENXML.
With this solution in hand, it's possible to perform all the magic that you might want. You can join XML documents to SQL tables without importing the data, and then use the result to INSERT, UPDATE, DELETE for whatever your please.
1
Rahul Khinvasara - 25/01/05
What if the size of xml file is 50mb ?
How much a varchar field can hold ?
» Report offensive content
2
Randy Koehn - 19/04/05
You guys totally rock!!!
This was the solution that I have hunted for some time... brilliant; only thing is every XML file that I am working with is greater than 8000 characters long. I can easily enough spread the file across several varchar(8000) variables; however, I can't find a reasonable means to concatinate them for use with the sp_xml_preparedocument command... any suggestions?
» Report offensive content
3
Kumar Narala - 10/10/06
Thank you very much for sharing such an important piece, which has been omitted in most of the sites
» Report offensive content
4
harry - 11/10/06
what if the file size is greater than what can be stored in @filecontents (i.e) greater than 8000 which can be stored using varchar?
» Report offensive content
5
Moe - 10/01/07
I had the same idea but knew there was an 8000 limit on varchar. I see others had the same question. Anyone have a solution?
» Report offensive content
6
Paul Manley - 17/04/07
The BOL isn't missing anything. The addition of reading in a text file isn't part of the OpenXML problem. Also, using xp_cmdshell for this is pretty flawed.
If anything you should be using DTS, COM, setup a linked server to a file, do a bulk insert first to get your data, or preferably pass it in from your application.
The Text data type allows more than 8000 characters. And that is what you should be using for this kind of data.
The only issue I see with this is there seems to be no way to edit the recordset. Being able to do an update on this data source would be supremely useful.
» Report offensive content
7
Simon - 08/05/07
Thanks, This is a life saver. I've wanted to be able to read the file in transact SQL to be able to do my XML data load in a single transaction.
Unfortunately using DTS Com and using the SQL Server XML Bulk insert makes this very difficult.
» Report offensive content
8
Deepak - 13/09/07
Hi Arthur,
really good to see ur code for reading an xml file and then using it in OPENXML method.
But I am facing a problem here. I used your code to fill a variable with the data of an xml file. It got filled with all the data successfully. But when I used this variable in sp_xml_preparedocument method it doesn't returned any result.
Now I tried the other way. I copied all the data of the xml file and hardcoded that data into a @doc variable, inspiite of using your code to read the xml file. Now OPENXML worked perfectly and it returned records as expected.
I am using element centric mapping...
Can u suggest... I am attaching the code here...
» Report offensive content
9
Vinu Joshua - 20/09/07
Good thought... but is there anyway to overcome the 8000 char limit?
» Report offensive content
10
kiran826 - 15/10/07
Hi i have used above piece of code to read an XML file but i didn't get any output. could anyone provide me a solution.
I have an xml file generated by a dataset (ds.ReadXML()). i want insert all these rows into DB. Please suggest me in this regards.
» Report offensive content
11
Mani - 03/11/07
Kiran826,
Make sure your xml file is residing on the same server as your sql server. Since this query is executed from the sql, it will be looking for this file on that server.
» Report offensive content
12
Manisha - 26/01/08
I am readinf my xml file the you have described here. But when the xml data is saved as text it "n++" prefix is being added to it. Hence the next operation of sp_xml_preparedocument throws xml parser error. I have attched xml format here.
could you please suggest something?
» Report offensive content
13
Jitu Mevada - 14/05/08
I want to read below XML file into SQL...... I dont know How to get fields value. Please provide me proper help.
» Report offensive content
14
Adam - 15/05/08
This is really a brilliant piece of work. I can't tell you how many times I get this sort of question. If I may make one suggestion, a lot of XML files have a newline character at the end, which might get convereted to a NULL when you import the results into a table. NULL plus anything is NULL. Pursuant, you might want to do this as you build the string:
Great work! Thank you for sharing!!
» Report offensive content
15
Santosh - 03/07/08
I want to insert records from XML string. Means my sql parameter will be XML data and in store procedure i want to manupulate each record and store it into table.
Can anybody suggest me any solution?
» Report offensive content
16
Tashfeen Khalid - 10/02/09
Reading a file into SQL Server... ...
Consuming XML in a stored procedure... ...
» Report offensive content
|
http://www.builderau.com.au/architect/webservices/soa/Reading-an-XML-file-from-SQL-Server/0,339024590,339174685,00.htm
|
crawl-002
|
refinedweb
| 1,389
| 74.08
|
If I create a new directory for a new project in Python, this directory will not be on the default python path as shown in sys.path.
In IDLE, if I work solely in files and not at the interactive prompt and save both files into this new directory I can import one into the other with no problem. So say I save the files to the directory ~/python-projects/myproject, and that the files are called main.py and mymodule.py, I can import mymodule.py into main.py by doing 'import mymodule'. All is well and good.
However, if I also have the IDLE interactive prompt open and try to do 'import mymodule', it fails. It even fails after I change the working directory using:
import os
os.chdir('...').
Listing sys.path shows me that the current directory ('.') is not on the path. This is very inconvenient since it means I can't try things out interactively. Is there any way I can get IDLE to look for files in it's current working directory?
I'm using xubuntu, by the way, and am very new to Python; so apologies if this is a naive question.
Thanks in advance
PAE
|
http://www.python-forum.org/viewtopic.php?p=13512
|
CC-MAIN-2015-27
|
refinedweb
| 202
| 76.32
|
Which is the equivalent of what we have in regular waitqueues.I'm not crazy about the name, but this also helps us get bothapis closer -- which iirc comes originally from the -net folks.We also duplicate the comments for the lockless swait_active(),from wait.h. Future users will make use of this interface.Signed-off-by: Davidlohr Bueso <dbueso@suse.de>--- include/linux/swait.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-)diff --git a/include/linux/swait.h b/include/linux/swait.hindex 4a4e180d0a35..ce4c2582fd42 100644--- a/include/linux/swait.h+++ b/include/linux/swait.h@@ -79,9 +79,62 @@ extern void __init_swait_queue_head(struct swait_queue_head *q, const char *name DECLARE_SWAIT_QUEUE_HEAD(name) #endif -static inline int swait_active(struct swait_queue_head *q)+/**+ * swait_active -- locklessly test for waiters on the queue+ * @wq: the waitqueue to test for waiters+ *+ * returns true if the wait list is not empty+ *+ * NOTE: this function is lockless and requires care, incorrect usage _will_+ * lead to sporadic and non-obvious failure.+ *+ * NOTE2: this function has the same above implications as regular waitqueues.+ *+ * Use either while holding swait_queue_head::lock or when used for wakeups+ * with an extra smp_mb() like:+ *+ * CPU0 - waker CPU1 - waiter+ *+ * for (;;) {+ * @cond = true; prepare_to_wait(&wq_head, &wait, state);+ * smp_mb(); // smp_mb() from set_current_state()+ * if (swait_active(wq_head)) if (@cond)+ * wake_up(wq_head); break;+ * schedule();+ * }+ * finish_wait(&wq_head, &wait);+ *+ * Because without the explicit smp_mb() it's possible for the+ * swait_active() load to get hoisted over the @cond store such that we'll+ * observe an empty wait list while the waiter might not observe @cond.+ *+ * Also note that this 'optimization' trades a spin_lock() for an smp_mb(),+ * which (when the lock is uncontended) are of roughly equal cost.+ */+static inline int swait_active(struct swait_queue_head *wq)+{+ return !list_empty(&wq->task_list);+}++/**+ * swq_has_sleeper - check if there are any waiting processes+ * @wq: wait queue head+ *+ * Returns true if @wq has waiting processes+ *+ * Please refer to the comment for swait_active.+ */+static inline bool swq_has_sleeper(struct swait_queue_head *wq) {- return !list_empty(&q->task_list);+ /*+ * We need to be sure we are in sync with the list_add()+ * modifications to the wait queue (task_list).+ *+ * This memory barrier should be paired with one on the+ * waiting side.+ */+ smp_mb();+ return swait_active(wq); } extern void swake_up(struct swait_queue_head *q);-- 2.12.0
|
http://lkml.org/lkml/2017/9/5/619
|
CC-MAIN-2018-30
|
refinedweb
| 366
| 52.8
|
Thanks alot for the response but what I guess I don't get is why does explicit casting exist for objects? Since upcasting is implicit, it doesn't require a cast in the () format as my first example. This compiles just fine: public class BaseTest2{ public static void main(String [] args){ BaseTest2 base = new BaseTest2(); Sub2 sub = new Sub2(); base = sub; } } class Sub2 extends BaseTest2{}
What situations wouldn't throw a runtime exception, or is it simply there because it is required for primitives and the exception just lets you know that "hey, downcasting is never leagal under any circumstances???"
originaly posted by Sabarish It is not that downcasting is always illegal at runtime. In some cases u may use a superclass reference to hold an object of the subclass. In that case, u can get that object back into a subclass reference by using the downcast. I have modified ur program to demonstrate this... code: -------------------------------------------------------------------------------- public class BaseTest2 { public static void main(String [] args) { //Below line is modified to hold subclass object BaseTest2 base = new Sub2(); //The following should now be valid at runtime too Sub2 sub = (Sub2)base; }} class Sub2 extends BaseTest2 {} -------------------------------------------------------------------------------- Such a downcast is to instruct the compiler that u know what ur doing, that is u know that ur casting the object reference into a more specialized type. In some cases this may be desirable. For ex suppose Sub2 has a method m2() which is not in BaseTest2. In that case u can't invoke that method using the reference base even though base points to a valid Sub2 type object and has the m2() method. U will have to cast the reference to a Sub2 type reference to make the program compile and invoke m2().
That should be the reason why ClassCastException is a RuntimeException. Only the programmer can predict whether the cast will work or throw an exception !
Originally posted by Barkat Mardhani: Hi Ron: Your example is talking about classcast exception when you cast one derived class to another derived class. Whereas, Alan is talking about casting a super class object to a derived class....
public class BaseTest2 { public static void main(String [] args) { BaseTest2 base = new BaseTest2(); Sub sub = (Sub)base; } } class Sub2 extends BaseTest2 { } Compiles fine, but throws a ClassCastException. Now, I understand why the cast is required for compiling, but why is there an exception?
Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance.
Kinght."
Originally posted by Alan Phillips: How can I access the methods in a superclass from a subclass which overides the method.
Originally posted by Alan Phillips: working through it really helped me understand that a superclass can be a subclass or a superclass, a subclass can ONLY be a subclass.
This is why Ron and I are getting the feeling that you're still a bit off. The runtime type of an object never changes: once it's instantiated, it will remain the same type no matter what kind of casting you do. Casting merely allows you to reference an object in a more general (upcasting) or specific (downcasting) manner. Casting does not change the type of an object Casting simply allows you to assign the value of one reference variable to another. As an added precaution, the Java Runtime checks if the reference type is compatible with the actual object type; if it isn't a ClassCastException is thrown.
2. The runtime type of the actual object that obj references is determined by the argument to new, which in line 2 is SubClass, and in line 4 is SuperClass.
|
http://www.coderanch.com/t/239272/java-programmer-SCJP/certification/Dan-exam-ClassCastException
|
CC-MAIN-2014-52
|
refinedweb
| 609
| 65.96
|
Coroutines¶
Coroutines are the recommended way to write asynchronous code in
Tornado. Coroutines use the Python
await:
async def fetch_coroutine(url): http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body
Native vs decorated coroutines¶
Python 3.5 introduced the
async and
await keywords (functions
using these keywords are also called “native coroutines”). For
compatibility with older versions of Python, you can use “decorated”
or “yield-based” coroutines using the
tornado.gen.coroutine
decorator.
Native coroutines are the recommended form whenever possible. Only use decorated coroutines when compatibility with older versions of Python is required. Examples in the Tornado documentation will generally use the native form.
Translation between the two forms is generally straightforward:
# Decorated: # Native: # Normal function declaration # with decorator # "async def" keywords @gen.coroutine def a(): async def a(): # "yield" all async funcs # "await" all async funcs b = yield c() b = await c() # "return" and "yield" # cannot be mixed in # Python 2, so raise a # special exception. # Return normally raise gen.Return(b) return b
Other differences between the two forms of coroutine are outlined below.
Native coroutines:
are generally faster.
can use
async forand
async withstatements which make some patterns much simpler.
do not run at all unless you
awaitor
yieldthem. Decorated coroutines can start running “in the background” as soon as they are called. Note that for both kinds of coroutines it is important to use
awaitor
yieldso that any exceptions have somewhere to go.
Decorated coroutines:
have additional integration with the
concurrent.futurespackage, allowing the result of
executor.submitto be yielded directly. For native coroutines, use
IOLoop.run_in_executorinstead.
support some shorthand for waiting on multiple objects by yielding a list or dict. Use
tornado.gen.multito do this in native coroutines.
can support integration with other packages including Twisted via a registry of conversion functions. To access this functionality in native coroutines, use
tornado.gen.convert_yielded.
always return a
Futureobject. Native coroutines return an awaitable object that is not a
Future. In Tornado the two are mostly interchangeable.
How it works¶
This section explains the operation of decorated coroutines. Native coroutines are conceptually similar, but a little more complicated because of the extra integration with the Python runtime. awaitable object until it is yielded. This means it is important to call coroutines in the right way, or you may have errors that go unnoticed:
async
await or
yield keyword in the
call. When you are overriding a method defined in a superclass,
consult the documentation to see if coroutines are allowed (the
documentation should say that the method “may be a coroutine” or “may
return a
Future”):
async def good_call(): # await will unwrap the object returned by divide() and raise # the exception. await
Calling blocking functions¶
The simplest way to call a blocking function from a coroutine is to
use
IOLoop.run_in_executor, which returns
Futures that are compatible with coroutines:
async def call_blocking(): await IOLoop.current().run_in_executor(None, blocking_func, args)
Parallelism¶
The
multi function accepts lists and dicts whose values are
Futures, and waits for all of those
Futures in parallel:
from tornado.gen import multi async def parallel_fetch(url1, url2): resp1, resp2 = await multi([http_client.fetch(url1), http_client.fetch(url2)]) async def parallel_fetch_many(urls): responses = await multi ([http_client.fetch(url) for url in urls]) # responses is a list of HTTPResponses in the same order async def parallel_fetch_dict(urls): responses = await multi({url: http_client.fetch(url) for url in urls}) # responses is a dict {url: HTTPResponse}
In decorated coroutines, it is possible to
yield the list or dict directly:
@gen.coroutine def parallel_fetch_decorated(url1, url2): resp1, resp2 = yield [http_client.fetch(url1), http_client.fetch(url2)]
Interleaving¶
Sometimes it is useful to save a
Future instead of yielding it
immediately, so you can start another operation before waiting.
from tornado.gen import convert_yielded async def get(self): # convert_yielded() starts the native coroutine in the background. # This is equivalent to asyncio.ensure_future() (both work in Tornado). fetch_future = convert_yielded(self.fetch_next_chunk()) while True: chunk = await fetch_future if chunk is None: break self.write(chunk) fetch_future = convert_yielded(self.fetch_next_chunk()) await self.flush()
This is a little easier to do with decorated coroutines, because they start immediately when called:
@gen.coroutine def get(self): fetch_future = self.fetch_next_chunk() while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = self.fetch_next_chunk() yield self.flush()
Looping¶
In native coroutines,
async for can be used. In older versions of
Python, looping is tricky with coroutines since there is no way
As an alternative to
PeriodicCallback, a
coroutine can contain a
while True: loop and use
tornado.gen.sleep:
async def minute_loop(): while True: await do_something() await:
async def minute_loop2(): while True: nxt = gen.sleep(60) # Start the clock. await do_something() # Run while the clock is ticking. await nxt # Wait for the timer to run out.
|
https://www.tornadoweb.org/en/latest/guide/coroutines.html
|
CC-MAIN-2022-27
|
refinedweb
| 794
| 50.63
|
In this project Laurence decided to try to implement a dynamic programming solution for the Longest Common Subsequence (LCS) problem. Below is his blog post regarding this.
"I learned about dynamic programming in university, but I had a lot of trouble understanding exactly how it works. Attempting to program a dynamic programming algorithm in Haskell has helped me understand the fundamental principles behind dynamic programming in a way that I wasn’t able to when I learned it from an imperative programming perspective.
What is Dynamic Programming?
In dynamic programming, you have a problem where your goal is to find the optimal value of a function F on a particular input, where F has two properties:
- Optimal sub-structure. This means that for F can be broken into multiple sub-problems, each of which has an optimal solution and the optimal solution for F is a combination of the optimal solutions to the sub-problems of F. In general, the sub-problems of F have sub-problems themselves, so dynamic programming is a naturally recursive kind of problem.
- Overlapping sub-problems. This means that while you recursively evaluate the optimal solution for F, you evaluate some of its recursive sub-problems more than once. Since there is only one optimal solution to each sub-problem (because the sub-problem functions are pure functions, and are referentially transparent), you are wasting time evaluating the repeated sub-problems over and over again if you re-evaluate their sub-problems. Instead, you want to memoize the sub-problems by storing them in some kind of cache so you don’t have to re-compute them.
In the case of the LCS problem, we want to compute the longest sub-sequence of characters between two strings (we could do this on two sequences of any type, but strings are used as a common example). It turns out that this problem has optimal substructure and overlapping sub-problems, and so we can use dynamic programming to solve it efficiently.
When this was taught to me in university, the emphasis was on the implementation of a solution using a matrix, rather than on the principle of dynamic programming which can be applied in the case of any problem with both optimal substructure and overlapping sub-problems.
The principle is that for any problem, F(i, j), there are sub-problems F(i – 1, k), where
F(i, j) = G(F(i – 1, 0), F(i – 1, 1), …)
In other words, you need to know the optimal solutions of the sub-problems F(i – 1, k) and you apply a function G to the values of the sub-problems to compute F(i, j).
In addition, since the sub-problems overlap, the values of the sub-problems F(i – 1, k) are stored in some kind of cache, perhaps a list, graph, hash table, or in the case of LCS, a matrix. This allows you to avoid re-computing sub-problem values which you have computed previously.
The LCS problem, and every other dynamic programming problem, can be visualized as a graph problem, where each problem is a vertex and each sub-problem is connected to its parent problem with an edge:
In order to memoize a general dynamic programming problem, you can cache the optimal solution for each sub-problem at each vertex as meta-data. A problem has overlapping sub-problems if there are two paths to reach the same sub-problem, F(i – j, k), from the problem, (F(i, 0)):
Instead of re-computing the overlapping sub-problem, F(i – j, k), when you encounter it the second time, you can access the cached value to avoid re-computing it.
Sometimes, you may need to recover the path taken for the optimal solution, you can store which edge to take to get to the best sub-problem. When you can choose an edge to take which represents the optimal solution, the dynamic programming problem is called a dynamic decision problem. (The little arrows next to each node represent the edge chosen for the optimal sub-problem).
This method of storing which edges represent the optimal solution is used in the LCS computation.
F(i, 0) can then be computed using the cached values with the function you saw above:
F(i, 0) = G(F(i – 1, 0), F(i – 1, 1), F(i – 1, 2))
In the case of the longest common sub-sequence, the function G is called LCS and is defined like this:
For two strings A and B of length m and n respectively, the LCS of those strings is:
LCS(A[0, m], B[0, n]) | A[m - 1] == B[n - 1] = 1 + LCS(A[0, m - 1], B[0, n - 1]) | otherwise = max(LCS(A[0, m - 1], B[0, n]), LCS(A[0, m], B[0, n - 1])
Here we are computing the length of the LCS of A and B. Whenever the length of the LCS increases by 1, we have added a character to the LCS which matches in A and B.
As you can see, the problem is solved by computing optimal solutions to LCS on prefixes of A and B. In order to get a prefix of A or B which is one smaller than A or B, we remove one character from either A or B. The LCS of the first character of A and B is 0 if A[0] != B[0] and 1 if A[0] == B[0]. This is our terminal case for the recursion.
In the general case, to find the LCS of A and B, there are two cases, either the last character of A and B are the same, or they differ.
Let’s give the name P to the last character of A and Q to the last character of B. if P and Q are the same, the P must be a part of the LCS of A and B because P is common to A and B and any sub-sequence which doesn’t include P would be shorter than a sequence which ends with P. The LCS of A and B must be whatever the LCS of A and B are with P removed, plus P.
In the case where P and Q differ, they can not be in the LCS of A and B because they are not common to both A and B. In this case, it is possible that the LCS of A and B is the LCS of A with P removed and B or the LCS of A and B with Q removed. In order to compute an optimal LCS, we must choose whichever is longer.
You may be tempted to ask “aren’t we forgetting about the case P is not equal to Q and where we remove both P from A and Q from B?”; let’s call this case the “overlapping sub-problem”. You could include a check for the overlapping sub-problem too, but it would be a waste of time, because it is an overlapping sub-problem of both LCS(A[0, m – 1], B[0, n]), and LCS(A[0, m], B[0, n – 1]). In the first case, we can remove Q from B to form the overlapping sub-problem and in the second case we can remove P from A to form the overlapping sub-problem. Since the overlapping sub-problem is a sub-problem of a sub-problem, we don’t need to write a special case for it in the recursion because it will naturally be handled by recursively applying the first two cases.
It is important to note that up until this point, we have only been computing the length of the LCS, which is not the goal of this algorithm, which is to find the sub-sequence itself. In order to compute the sub-sequence, we should note that when the LCS increases in length, a character is added to the LCS, and when it doesn’t increase in length, we are choosing which sub-problem contains the longer common sub-sequence. In order to find the LCS, of two strings A and B, we should add the last character P/Q to the LCS if LCS(A, B) is greater than LCS(A[0, m – 1], B[0, n – 1]) and if not, we should choose to consider a prefix of A and B based on which of LCS(A[0, m – 1], B) and LCS(A, B[0, n – 1]) is larger.
In practice, we can efficiently compute the LCS using a matrix for memoization:
Using a matrix allows us to access the cache in constant time. Notice that an extra empty character has been prefixed to both strings, so that the terminating condition of the LCS function when the length of the sub-string is 0 is length 0. If the ith entry in A is equal to the jth entry in B, then we only need to access the cached value in F(i – 1, j – 1), otherwise we need to take the maximum value of F(i – 1, j) and F(i, j – 1).
Code Time
Let’s examine how to implement this in Haskell.
Firstly, we need to use the Data.Array and Data.Matrix packages for constant time access to the cache and strings:
import Data.Array ((!)) --Import the array index operator import qualified Data.Array import qualified Data.Matrix
Since we want to recover the path taken for the decision problem, we also need a direction to travel in the matrix using a Direction type:
data Direction = NoDir | LeftDir | UpDir | DiagonalDir deriving (Show, Eq)
The main function takes two strings, converts them into arrays, and calls lcs on them:
main = getArgs >>= (\args -> case args of [] -> putStrLn "Please enter two strings for lcs" (a : []) -> putStrLn "Please enter two strings for lcs" (a : b : []) -> let arrayA = Data.Array.listArray (0, length a) a arrayB = Data.Array.listArray (0, length b) b in lcs arrayA arrayB (initMatrix (length arrayA) (length arrayB)))
The two strings are called a and b.
initMatrix just sets up a matrix with all zero entries and no direction:
initMatrix :: Int -> Int -> Data.Matrix.Matrix (Direction, Int) initMatrix a b = Data.Matrix.matrix a b (\(i, j) -> (NoDir, 0))
lcs is broken into two parts, first the sub-problem matrix is computed in lcsMatrix and then the optimal path is traced through the matrix in traceMatrix. lcs prints out the resulting longest common sub-sequence:
lcs :: Data.Array.Array Int Char -> Data.Array.Array Int Char -> Data.Matrix.Matrix (Direction, Int) -> IO () lcs a b m = putStrLn (traceMatrix (length a - 1) (length b - 1) a b subProblemMatrix "") where subProblemMatrix = lcsMatrix (length a - 1) (length b - 1) a b m
Note that lcsMatrix and traceMatrix both start at the bottom right corner of the matrix and recursively traverse towards the top left.
lcsMatrix updates the matrix cache with the value of the LCS for the coordinates i and j:
lcsMatrix :: Int -> Int -> Data.Array.Array Int Char -> Data.Array.Array Int Char -> Data.Matrix.Matrix (Direction, Int) -> Data.Matrix.Matrix (Direction, Int) lcsMatrix 0 0 _ _ m = m lcsMatrix 0 _ _ _ m = m lcsMatrix _ 0 _ _ m = m lcsMatrix i j a b m = let (thisDir, thisValue) = Data.Matrix.getElem (i + 1) (j + 1) m in updateMatrix thisDir i j a b m
Annoyingly, Data.Matrix is 1-indexed instead of 0-indexed, so we need to add 1 to each coordinate; instead of (i, j) we need to use (i + 1, j + 1).
lcsMatrix terminates without updating the cache whenever it reaches the top or left of the matrix.
updateMatrix performs the actual memoized evaluation of the LCS function I defined above:
updateMatrix :: Direction -> Int -> Int -> Data.Array.Array Int Char -> Data.Array.Array Int Char -> Data.Matrix.Matrix (Direction, Int) -> Data.Matrix.Matrix (Direction, Int) updateMatrix NoDir i j a b m | (a ! (i - 1)) == (b ! (j - 1)) = let diagM = lcsMatrix (i - 1) (j - 1) a b m (diagDir, diagValue) = Data.Matrix.getElem i j diagM in Data.Matrix.setElem (DiagonalDir, (1 + diagValue)) (i + 1, j + 1) diagM | otherwise = let leftM = lcsMatrix (i - 1) j a b m upM = lcsMatrix i (j - 1) a b leftM (leftDir, leftValue) = Data.Matrix.getElem (i + 1) j upM (upDir, upValue) = Data.Matrix.getElem i (j + 1) upM in if leftValue < upValue then Data.Matrix.setElem (UpDir, upValue) (i + 1, j + 1) upM else Data.Matrix.setElem (LeftDir, leftValue) (i + 1, j + 1) upM updateMatrix _ _ _ _ _ m = m --Matrix already has a value here
! is the array indexing operator.
There are a few cases to consider here.
First, the second pattern is matched if direction is anything other than NoDir. This means that if you call updateMatrix on any element which has a direction, the cache is used instead of computing the matrix update. Pattern matching makes it pretty simple to implement memoization in Haskell.
In the other pattern, the expression (a ! (i – 1)) == (b ! (j – 1)) tests if the character at the i and jlocations in the strings are equal. The reason we have to subtract 1 here is because an empty character was prefixed onto the strings in the matrix, so the matrix index is off-by-one relative to the string index.
In the case where the characters are equal, we need to consider the diagonal element, which is computed like this:
diagM = lcsMatrix (i - 1) (j - 1) a b m
The cache is implicitly checked and updated by lcsMatrix, so we need to use the matrix returned by the function for all future queries. Next, we want the diagonal element (i – 1, j – 1):
(diagDir, diagValue) = Data.Matrix.getElem i j diagM
Then we can update the matrix element at (i, j) with 1 + the diagonal value:
Data.Matrix.setElem (DiagonalDir, (1 + diagValue)) (i + 1, j + 1) diagM
Again, since we want to set the element (i, j) in Data.Matrix, we need to add 1 to each coordinate to get (i + 1, j + 1). Notice that I stored a DiagonalDir in the Matrix, this will be used later to trace the LCS.
In the case where the two characters don’t match, we need to get the left and up neighbor values. These are computed or retrieved from the cache using the lcsMatrix function:
leftM = lcsMatrix (i - 1) j a b m upM = lcsMatrix i (j - 1) a b leftM
Notice that I am passing leftM as a parameter to the up neighbor computation. This is because the up neighbor computation may benefit from the cache updates computed in the left neighbor computation. In general, you need to use the latest version of your state wherever possible.
Once we’ve updated the matrix caches, we can read from the updated matrices:
(leftDir, leftValue) = Data.Matrix.getElem (i + 1) j upM (upDir, upValue) = Data.Matrix.getElem i (j + 1) upM
The LCS function chooses the maximum LCS value from each of these and updates the matrix appropriately:
if leftValue < upValue then Data.Matrix.setElem (UpDir, upValue) (i + 1, j + 1) upM else Data.Matrix.setElem (LeftDir, leftValue) (i + 1, j + 1) upM
Notice that I have stored UpDir and LeftDir in the matrix to use for tracing the LCS in traceMatrix.
All that remains is to trace the LCS starting at the final element:
traceMatrix :: Int -> Int -> Data.Array.Array Int Char -> Data.Array.Array Int Char -> Data.Matrix.Matrix (Direction, Int) -> [Char] -> [Char] traceMatrix i 1 a b _ longestCommonSubsequence | a ! (i - 1) == b ! 0 = (a ! (i - 1)) : longestCommonSubsequence | otherwise = longestCommonSubsequence traceMatrix 1 j a b _ longestCommonSubsequence | a ! 0 == b ! (j - 1) = (a ! 0) : longestCommonSubsequence | otherwise = longestCommonSubsequence traceMatrix i j a b m longestCommonSubsequence = let (direction, _) = Data.Matrix.getElem (i + 1) (j + 1) m in case direction of LeftDir -> traceMatrix i (j - 1) a b m longestCommonSubsequence UpDir -> traceMatrix (i - 1) j a b m longestCommonSubsequence DiagonalDir -> traceMatrix (i - 1) (j - 1) a b m (a ! (i - 1) : longestCommonSubsequence)
The first and second patterns match the cases when either i or j is 1. In the case where the characters match, they are added to the longestCommonSubsequence, otherwise the function evaluates to the existing sub-sequence. These are the terminal cases for the recursion.
The third pattern matches the general case of the recursion for element (i, j). The first thing which happens is the direction is extracted from the matrix for the element:
(direction, _) = Data.Matrix.getElem (i + 1) (j + 1) m
In the case where the direction is LeftDir or UpDir, the recursion just continues with the left neighbor’s index or up neighbor’s index respectively:
LeftDir -> traceMatrix i (j - 1) a b m longestCommonSubsequence UpDir -> traceMatrix (i - 1) j a b m longestCommonSubsequence
In the case where the direction is DiagonalDir, that means that we discovered an element of the LCS in lcsMatrix, the current character is added to the longestCommonSubsequence and the recursion contiues with the diagonal neighbor’s index:
DiagonalDir -> traceMatrix (i - 1) (j - 1) a b m (a ! (i - 1) : longestCommonSubsequence)
Altogether, these operations will compute the LCS of a and b.
The code for this post can be found here:
Article written by Laurence Emms and originally found on whatthefunctional.wordpress.com. All image and text credit to Laurence Emms.
Are you enjoying our content? Let us know below!
|
https://www.signifytechnology.com/blog/2018/04/dynamic-programming-in-haskell-by-laurence-emms
|
CC-MAIN-2019-13
|
refinedweb
| 2,914
| 58.62
|
Passion for TFS and VSTS keeps me live and Communicating
Project Server 2007 VSTS Connector was released in Codeplex. Here is the description of this from Codeplex
Performance testing guide is now available on codeplex. This guide shows you an end-to-end approach for implementing performance testing. Whether you are new to performance testing, or looking for ways to improve your current performance testing approach, you will find insights that you can tailor for your specific scenarios. This guide is related to Performance Testing Guidance Project . - J.D. Meier, Carlos Farre, Prashant Bansode, Scott Barber, Dennis Rea
Another great feature in Orcas Version control is that there is an option to create a branch without having to download any of the file locally ( i.e without any get operations). This new option is "/silent" argument for the tf branch command and this prevents the get operations and thus doing the braching in a faster way.
Here's the screenshot how it can be used
Cheers !
While I was exploring some great features of Orcas I came across this interesting great blog post that describes some new features in the profiler that are now available with Visual Studio Team System "Orcas" beta 1. Here's short desciption from this blog
Don't miss to visit this blog and this feature !
The below links should be very useful to customers to clarify what exactly they will need to purchase in order to enable source control/bug tracking/testing scenarios within VSTS /Team Foundation Server
Presales website
VSTS datasheet
Cheers !
I just came across this news from bharry's blog. This is a great news for testers to create bugs and improve their productivity !
Heres the contents of the blog...:
The !
I am very much excited about the new features of Orcas. I recently blogged about new Code Metrics feature. In this blog I explain the new features of Version Control within Orcas
There are lot of improvements on Version control part of Orcas and you can try it yourself by downloading Orcas
Soon to follow a blog on great new features on Orcas Team Build. Stay tuned .....
I came across this interesting blog by Richard Murillo and thought of sharing it. In this post he explains lessons learnt and how to leverage Visual studio Team System to execute outsourced projects. Here's the content of what he has to say
"Having:
IMHO in both projects are considered high risk when examining the vendor skill set, staffing model, and experience with projects of this complexity. In most situations you can apply the Pareto !
The SDC build tasks is now available in CodePlex
Project Description from the
Use these taks and save your time in writing these tasks !.
Think of it like this: A process template in TFS is similar to a document template in Word.
That said, if you still wish to begin using the CMMI template, my advice is to begin fresh, with a new project. To do this:
Alternatively, it is also possible to modify the individual work item type definitions within an existing project using WITExport.exe and WITImport.exe. Together these programs import and export work item type definitions from an existing project (as XML documents). So, you can export a WIT, modify it, and import it. If you go this direction, you will definitely want to check out the Visual Studio 2005 SDK 3.0 - September 2006 RTM (which you can find here), as it contains the documentation for the XML format you'll be modifying. Note: Changing a WIT for a specific project does NOT update the underlying process template. Also note that going this direction may have negative side-effects, such as broken reports. The safest method is to create a new project as described above.
Here's is a cool list of various Visual Studio 2005 and Team Foundation Server add-ins, add-ons, widgets, and extensibility solutions.
Cheers
Srikanth
Work
Find the answers for the below questions here
The new Code Metrics feature for Visual Studio ‘Orcas’! Available in Visual Studio Team Developer and Team Suite, this new feature allows users to generate code metrics for projects and solutions and displays the results in the Code Metrics Results tool window. An example Code metrics Results window is shown below
This feature can generate five different metrics: Maintainability Index, Cyclomatic Complexity, Depth of Inheritance, Class Coupling, and Lines of Code.
Maintainability Index - Measures ease of code Maintanance and higher values for this is better
Cyclomatic Complexity - Measures the number of branches and lower values for this is better
Depth of Inheritance - This measures the lenght of object inheritance hierarchy and lower values for this is better
Class Coupling - Measures number of classes that are referenced and lower values are better
Lines of Code - Measures lines of executable code and lower values are better
All metrics are averaged at the type, namespace, and assembly levels with the exception of Class Coupling. The Class Coupling metric displays the total number of distinct types referenced at the method and type levels rather than the total number of type references.
As you can see in the figure Visual Studio gives Red or Green icon for the index based on which you can change your code to improve code quality. 100 are displayed.
Users can also export these results into Excel where they can perform their own calculations and transformations.
To generate code metrics, simply do the following:
Download Orcas and try it out !!!
|
http://blogs.msdn.com/srikanthr/
|
crawl-002
|
refinedweb
| 915
| 59.23
|
XSLT Recipes for Interacting with XML Data.
It's easy to fetch a list of values from ZODB and turn them into a SELECT widget. What's trickier is to set the selected item of the list to match some XSLT-derived value. If XSLT could call out to Python extension functions, that'd be wonderful. A couple of years ago, I wrote a column in which I explored a similar scenario -- calling out to Perl from an XSLT stylesheet. The idiom looks like this:
I thought this way of writing XSLT extension functions would have been standardized by now, but for reasons not clear to me, it hasn't been. I'm bummed, and so is XSLT guru Jeni Tennison:. [xsl-editors@w3.org]
Lacking a standard way to write XSLT extension functions, the script in Figure 5 takes another tack. It uses Python functions to communicate with the environment -- in this case, Zope -- and then interpolates dynamically-written XSLT text into the stylesheet. Consider this form fragment:
<div>sessionDay: <select name="sessionDay"> %s </select></div>
The
%s is swapped for the result of the method call
context.makeList('sessionDays',"@day"), and here is the body of that
method:
It's a Zope PythonScript, so the parameters --
property and
selector -- are specified using the Zope management interface. The raw Python
declaration would look like this:
def makeList ( property, selector ): ....
We can test the function from the URL-line, for any Zope folder containing a sessionDays property and an instance of a sessions file, like so:
Here's the resulting XSLT fragment:
When this XSLT fragment is executed in the context of Figure 5, a single session will be current, and only one of the expressions in Figure 8 will return true. For example,
That's close, but there's still some minor surgery required to make this work in the
browser. The
adjustSelectWidget() method shown in Figure 5 takes care of that,
along with a few related warts:
Procedural joins of XML data
The sessionSpeakers widget requires information from both data sources. Speakers assigned to a session appear in the session file as email addresses (see Figure 2), but the corresponding names appear in the speakers file.
The first thing to note about this arrangement is that, just like in the old dBase days, there's no referential integrity other than that which you enforce programmatically. However, the RDBMS vendors are catching up to this requirement. In Oracle 9i release 2, for example, it's possible to code triggers that keep multiple XML fragments consistent in the same way they can keep multiple SQL tables consistent.
Oracle and DB2 also embrace SQL/XML, the XML extensions in the proposed ISO/ANSI SQL:2003 (or, since we are running out of time this year, SQL:200n) standard. And everyone's hot on the trail of XQuery implementations, another way to join heterogeneously across SQL and XML data. So do-it-yourself programmatic joins across XML documents won't always be necessary. But for simple problems and for small quantities of data, it's handy to be able to do it.
To create the sessionSpeakers widget seen in Figure 3, I needed a way to get speaker and session data out of their respective XML files and into Python data structures where I could manipulate it. I tried several approaches. The first was Python's xml.dom.minidom. Figure 11 shows one way to use it to convert the speakers file to a Python dictionary.
Next, I tried the same thing using Aaron Swartz's xmltramp:
Both approaches are workable, but in each case I found it hard to match up the code
to the
structure of the document. Here's an alternative XSLT-based approach: a PythonScript
called
speakersAsDict that's similar to the
sessionsAsDict method seen
in Figure 5.
This strategy produces a textual representation of a Python dictionary, and then evaluates
it to yield a reference to the dictionary. Clearly that's a security concern. I'm
addressing
it in two ways. First, the
safeEval method is a PythonScript wrapper for an
Zope external method that uses a neutered
eval like so:
eval(s, {'__builtins__': {}})
As a result,
safeEval doesn't get to call any functions -- in particular, it
doesn't get to call the
globals() method that gives access to OS-level
functions.
The next line of defense is Zope's folder-level security. I'm only planning to locate
safeEval in a restricted, access-controlled area of the site. Together these
strategies add up to reasonable, if not iron-cladprotection. (It's always tricky to
strike
the right balance between the power of dynamic languages and the danger they can lead
to.
I'll be curious to see how Zope's
RestrictedPython implementation, which is used to sandbox PythonScripts and Zope Page
Templates, may evolve in the forthcoming Zope 3.)
All that said, I like the XSTL-oriented way of extracting Python data because
You can precisely select a subset of the data.
It's easier to visualize the structure of the document.
It's not language-dependent -- you could for example emit a Perl or Java hashtable instead.
It's not sensitive to the sequencing of elements in the document..
|
https://www.xml.com/pub/a/2003/08/13/udell.html
|
CC-MAIN-2022-05
|
refinedweb
| 875
| 60.14
|
The QWSMouseHandler class is a mouse driver for Qt/Embedded. More...
#include <qmouse_qws.h>
List of all member functions.
The.
See also Qt/Embedded.
Note that once created, mouse handlers are controlled by the system and should not be deleted.
The driver and device arguments are not used by this base class.
This method is reimplemented in the calibrated mouse handler to set calibration information (from, for instance, the Qtopia calibration screen). This version does nothing.
This method is reimplemented in the calibrated mouse handler to clear calibration information. This version does nothing.
Returns the mouse position.
This file is part of the Qt toolkit. Copyright © 1995-2005 Trolltech. All Rights Reserved.
|
https://doc.qt.io/archives/3.3/qwsmousehandler.html
|
CC-MAIN-2021-43
|
refinedweb
| 112
| 63.05
|
Big Faceless Report Generator Changelog
CHANGELOG for Big Faceless Report Generator ------------------------------------------- ----------------------------------------------------------------------------- Version 1.2.4 (released 2021-10-08) ----------------------------------------------------------------- * When the output-profile is set to a profile that disallowed non-embedded fonts, such as PDF/UA or PDF/A, embedded versions of the standard fonts (serif, sans-serif, courier etc) will be used automatically. * When a load over HTTP for an image has failed, we were trying to load it a second time as a PDF even if the failure was due to a network error. Fixed. * Some minor fixes to make PDF/UA output more reliable. * Built with PDF Library 2.26.1, Graph Library 1.1.6 Version 1.2.3 (released 2020-12-17) ----------------------------------------------------------------- * Added ITF-14 barcode format (the "itf14", "itf14checksum", "itf14-box" and "itf14checksum-box" barcode types). * Fixed some performance issues that had crept into the codebase. For very large documents, speed should be about 10% faster. Most of the slowdowns occurred in PDF/A-2 with the introduction of tags. * Added "pdfa4", "pdfa4e" and "pdfa4f" as valid values for output-profile. * The underlying 2.24.4 PDF Library tightens up the PDF/UA requirements, in partcular in the area of tables. As a result is it's possible that documents being generated as PDF/UA-1 in the previous release will fail to generate with this build. If this happens, the documents generated with 1.2.2 were not quite correct PDF/UA documents. * Build with PDF Library 2.24.4, Graph Library 1.1.6 Version 1.2.2 (released 2020-07-10) ----------------------------------------------------------------- * Added "certify" as an attribute for <input type="signature">, to alow the creation of certifying signatures. * Fixed some compatibility issues with Java 5 that had got into the codebase. The API is now tested and verified against Java 5 to 14, inclusive. * Add "ecc" and "bar-width" attributes for QR-codes * Added "title" attribute to all elements, to set the alternative description for the element. * Added some workarounds to assist screen-readers in reading out the correct values when creating PDF/UA-1 documents, when an <img> is loaded from a PDF. * Don't crash when colspan/rowspan attributes are set to negative values. * Underlying PDF library adds support for the Myanmar and Khmer Unicode blocks. * Build with PDF Library 2.24.3, Graph Library 1.1.6 Version 1.2.1 (released 2020-03-20) ----------------------------------------------------------------- * Verified with Java 14 * Allow PDF documents to be used as the source for <img> elements. * Allow the use of the "PostScript Name" to select a particular font in an OpenType collection, which is the normal approach. * Some fixes to the generation of "artifact" tags in tagged PDF output. * Built with PDF Library 2.24.1, Graph Library 1.1.6 Version 1.2 (released 2019-12-04) ----------------------------------------------------------------- * Added full support for generating PDF/UA documents. See our blog article for this release for details. * Fixed the attribute selectors, eg div[foo]. Previously these were only working for attributes that set a CSS property * Fixed the "inherit" value, which was not working properly. * Implemented the ":empty" selector * The <barcode> element can now have its font specified. The system stylesheet sets it to Helvetica, which was the fixed default prior to this release. * Built with PDF Library 2.24, Graph Library 1.1.6 Version 1.1.70 (released 2019-09-27) ----------------------------------------------------------------- * Fixes to the way logical structure were created. This could result in text being unselectable when the PDF was vieweed in Acrobat. * Built with PDF Library 2.23.7, Graph Library 1.1.6 Version 1.1.69 (released 2019-08-30) ----------------------------------------------------------------- * No Report Generator-specific changes. * Built with PDF Library 2.23.6, Graph Library 1.1.6 Version 1.1.68 (released 2019-07-04) ----------------------------------------------------------------- * No Report Generator-specific changes. Signficant changes from the PDF Library are: * PDFs with encryption and "Compressed XRef" turned on were being created in a way that broke Acrobat. This is now fixed. * The way text is clustered when edited in Acrobat is more logical * Unicode model updated to 12.0 * Color-bitmap OpenType fonts are supported (eg for emoji) * Built with PDF Library 2.23.4, Graph Library 1.1.6 Version 1.1.67 (released 2019-05-30) ----------------------------------------------------------------- * Added the "URLConnectionFactory" interface to allow custom URL schemes to be created or existing schemes modified. See API docs for an example. * Added support for WOFF2 fonts - these are loaded exactly as if they were regular OpenType fonts. * Fixed regression in 1.1.63 where documents were no longer "editable" in Acrobat. * Graphs are now marked as <Figure> rather than <Artifact> when the PDF is tagged. * More whitespace fixes. * Built with PDF Library 2.23.3, Graph Library 1.1.6 Version 1.1.66 (released 2018-12-14) ----------------------------------------------------------------- * The "barwidth" attribute is honoured for PDF417 barcodes * The new "ecc" and "columns" attributes on the <barcode> element can be used to control the error-correction and dimensions of a PDF417 barcode * Fixed a bug introduced by the fix to the previous version where the number of columns in the <thead> didn't match the number in the body of the table. * Fix a bug in whitespace normalization which has been there since 2002, although we're unsure how easy it was to reproduce out of a test environment. It could rarely result in a run of whitespace not collapsing as it should. * Built with PDF Library 2.23.1, Graph Library 1.1.6 Version 1.1.65 (released 2018-10-12) ----------------------------------------------------------------- * Verified with Java 11, and removed support for Java 4. * Lazily load fonts where possible, which should speed up parsing in some cases. * Fix an issue with backslash characters in Code128 barcodes * Fixed an exception that sometimes occurred when an entire row of cells had a rowspan > 1 * Built with PDF Library 2.23, Graph Library 1.1.6 Version 1.1.64 (released 2018-08-02) ----------------------------------------------------------------- * Improved support for Indic language layout * Built with PDF library 2.22.2, Graph Library 1.1.6 Version 1.1.63 (released 2018-06-04) ----------------------------------------------------------------- * Added "line-break" property and corrected behaviour of "word-break" property to match that defined in css-text-3. The "break-word" value for "word-break" is still not supported. * Added "globalsign" as a type of handler for <input type="signature"> fields * Changed the layout of the text for the "upc-a" format barcode to match the traditional layout. * Embedding a digital signature in a PDF/A format report will now generate a valid PDF/A document * Added pdf417:eci, pdf417:2001 and pdf417:2015 format barcodes to cater for the incompatibility between different revisions of the PDF417 format. * Includes an overdue update of the userguide. * Built with PDF library 2.22.1, Graph Library 1.1.6 Version 1.1.62 (released 2017-10-19) ----------------------------------------------------------------- * No changes except a rebuild with the latest version of the PDF Library. * Built with PDF library 2.20.3, Graph Library 1.1.6 Version 1.1.61 (released 2017-06-28) ----------------------------------------------------------------- * Added ability to create a "Tagged PDF". This can be done by adding <meta name="tagged" value="true"/> to the <head> of the PDF, or by selecting an OutputProfile that requires tagging (eg PDF/A2a) * Added "PDF/A1a", "PDF/A2a", "PDF/A2u", "PDF/A3a", "PDF/A3u" and "PDF/UA1" value to the list of known OutputProfiles that can be targetted. * Added "databar" type to <barcode>, to create GS1 DataBar barcodes. * Fixed issue introduced in 1.1.58 with "background-color:transparent" causing subsequent content to disappear (alpha was not being properly restored). * Built with PDF library 2.20.1, Graph Library 1.1.6 Version 1.1.60 (released 2016-05-06) ----------------------------------------------------------------- * Added ability to load fonts from an OpenTypeFontCollection - just specify the font URI as normal but add a "#font=n" to the end, where n is the index into the collection. * Added OSGi headers to manifest * Built with PDF library 2.18.4, Graph Library 1.1.6 Version 1.1.59 (released 2016-01-27) ----------------------------------------------------------------- * Added "pades", "ocsp", "timestampurl" and "algorithm" attributes, all used on <input type="signature"> elements to support the new "long term validation" options for digital signatures added to the PDF Library 2.18.2 * Added improved support for integration with Graphs created by our Graph Library: graphs sections are now able to contain actions, such as "href" or "onmouseover". See the Graph Library documentation for more detail * When embedding a PDF using the "background-pdf" attribute, adding a "#full" after the URL will embed the PDF with all its annotations. By default, the annotations are removed * Added <meta name="startpage">, to set the initial page number for numbering. * Don't fail when URLs used in the PDF are considered invalid by Java - this allows "mailto" URLs to be used (they still have to be supported by the PDF viewing application to work) * Fixed size of page when specified as "ledger-landscape" or "b2" * Built with PDF library 2.18.2, Graph Library 1.1.6 Version 1.1.58 (released 2015-09-16) ----------------------------------------------------------------- * Graphs drawn with version 2 of the graph library (i.e. with the namespace of) will use the same vector-based patterns available to the Report Generator (detailed on pages 51-52 of the userguide), as opposed to the bitmap patterns available when converting a Graph to a bitmap image. * Fixed trimming of whitespace after a break in a descendant, e.g. "<p><i><br/></i> trimmed</p>" * Fixes to auto-sizing of Deutchepost barcodes * Added boolean "immediate" attribute to <input type="choice"> fields, to control whether the value is immediately committed or not. The default is false. * Added "dpi" meta attribute to control the conversion from "px" units to points. The default value (and the value used in previous releases) is 90. * Don't fail when hidden fields are missing a default value * Added "decimal-leading-zero" types of list markers * Fix to allow <input> elements to work properly when used in <macro> elements. * Fixed a rare ConcurrencyModificationException with certain input * Built with PDF library 2.17.1 (plus some minor patches), Graph Library 1.1.6 Version 1.1.57 (released 2014-11-24) ----------------------------------------------------------------- * Added "word-break" attribute (as defined in CSS3) and "spellcheck" attribute (for input fields) * Fixed wrapping issue with "white-space: forced" (which is now a synonym for "word-break: break-all") * Allow specifying custom XMP attributes with "xmp" prefix in meta, eg <meta name="xmp:dc:rights", "Copyright"/> * Fixed behaviour when WARNING_UNKNOWN_ATTRIBUTE is set to false * Corrected handling of XML entities in XML XML destined for secondary parser (eg our Graph XML Parser) * Fixed creation of blank signature fields * Built with PDF Library 2.16.1, Graph Library 1.1.6 Version 1.1.56 (released 2014-05-27) ----------------------------------------------------------------- * Improved error messages when loading of external HTTP resources fails * Built with PDF library 2.15.3, Graph Library 1.1.6 Version 1.1.55 (released 2013-12-20) ----------------------------------------------------------------- * Fixed some subtle regressions to text with "requote" set, new in 1.1.53. * Fixed use of padding on inline attributes inside auto-sized blocks * Fixed exception that was being thrown when version 2 Graphics were embedded in XML and the XML InputSource did not have a System ID or base URL specified. * Added "PDFA2b" and "PDFA3b" as values for "output-profile Meta tag, * Added "lab(l, a, b)" as a way of specifying a color in the CIELab ColorSpace * Built with PDF library 2.15.1, Graph Library 1.1.6 Version 1.1.54 (released 2012-08-20) ----------------------------------------------------------------- * No changes except a rebuild with the latest version of the PDF Library. * Built with PDF library 2.11.25, Graph Library 1.1.6 Version 1.1.53 (released 2012-05-01) ----------------------------------------------------------------- * Added "aes256" option as an encryption-algorithm (requires Acrobat X) * Added "font-feature-settings" attribute to turn on or off OpenType font settings. * Added "quantize" option when importing images, to downsample 24 or 32 bit images to 8-bit on the fly. * Built with PDF library 2.11.23, Graph Library 1.1.6 Version 1.1.52 (released 2012-02-13) ----------------------------------------------------------------- * Added option to flatten all annotations on a PDF included via the background-pdf tag. * Built with PDF library 2.11.21, Graph Library 1.1.6 Version 1.1.51 (released 2011-10-27) ----------------------------------------------------------------- * Added <pdfset> as an optional outer tag, to combine multiple smaller PDFs into one. * Added Xinclude support, to include XML from external sources into the source * Graphs from version 2 of our Graph Library can now be embedded directly into the Report Generator using the Graph tag library syntax. The Graph Library must still be licensed seperately. * Added "pre-line" as a valid value for "whitespace" attribute * Added ability to embed flash objects via <object> tag, exactly as for HTML * Added ReportHandler class, to make XSLT transformations easier to do. * Built with PDF library 2.11.19, Graph Library 1.1.6 Version 1.1.50 (released 2011-06-27) ----------------------------------------------------------------- * No changes other than a rebuild with a newer version of the PDF Library, which fixes more bugs to do with barcodes. Customers using this release to insert an FNC1 character into a barcode must do so with the U+EFC1; character, eg <barcode type="code128" value="0123456"/>. * Built with PDF library 2.11.17, Graph Library 1.1.6 Version 1.1.49 (released 2011-04-18) ----------------------------------------------------------------- * No changes other than a rebuild with a newer version of the PDF Library, which fixes a few bugs with various barcodes. * Built with PDF library 2.11.16, Graph Library 1.1.6 Version 1.1.48 (released 2011-03-29) ----------------------------------------------------------------- * Fixed long-standing issue where a blank page was sometimes added to the end of the document * Added Aztec-code to barcode tag * Built with PDF library 2.11.15, Graph Library 1.1.6 Version 1.1.47 (released 2010-12-23) ----------------------------------------------------------------- * Added new META keys to enable creation of PDF/A1-b:2005 documents * Added alternative method to include control characters in Barcodes. * Updated producer field to "bfo.com" * Built with PDF library 2.11.13, Graph Library 1.1.6 Version 1.1.46 (released 2010-05-26) ----------------------------------------------------------------- * Upper-alpha and lower-alpha lists now number correctly after the first 26 items. * Built with PDF library 2.11.10b, Graph Library 1.1.6 Version 1.1.45 (released 2009-11-12) ----------------------------------------------------------------- * Fixed NPE for certain types of list when <li> was empty. * Built with PDF library 2.11.8, Graph Library 1.1.6 Version 1.1.44 (released 2009-09-03) ----------------------------------------------------------------- * Added support for "data:" URI syntax as defined in RFC2397. This will work in every environment without calling URL.setURLStreamHandlerFactory(). * Added suport for a "classpath:" URI, which can be used to load resources such as images, CSS stylesheets etc. from the classpath. For example, an image could be stored in a Jar and then referenced as "classpath:/org/faceless/report/resources/logo.jpg" * Added "ean8" as a value for "codetype" in <barcode> * Fixed layout bug from 1.1.40 that was occasionally causing paragraphs to wrap incorrectly. * Fix to problem where some streams being read from Jars were not closed. We've had reports this was causing a native memory leak, although we haven't been able to reproduce this here (see Java bug 4797189). However if you are seeing this behaviour we recommend upgrading. * Built with PDF library 2.11.7, Graph Library 1.1.6 Version 1.1.43 (released 2009-07-06) ----------------------------------------------------------------- * No changes to the Report Generator layer * Built with PDF library 2.11.6, Graph Library 1.1.6 Version 1.1.42 (released 2009-03-04) ----------------------------------------------------------------- *. * Added "datamatrix" as a value for "type" in <barcode> * Added "overprint" as a boolean attribute, to control overprinting for text or graphics. * Corrected some wrapping issues that could occur when setting "letter-spacing". * Fixed incorrect breakpoint between <nobr>word1<sup>word2</sup></nobr> * Built with PDF library 2.11.4, Graph Library 1.1.6 Version 1.1.41 (released 2009-01-27) ----------------------------------------------------------------- * Added "aes256" as an encryption algorithm, to use the new AES-256 encryption added in the PDF library 2.11 * Built with PDF library 2.11.2, Graph Library 1.1.6 Version 1.1.40 (released 2008-11-10) ----------------------------------------------------------------- * Added "intelligentmail" as a value for "type" in <barcode>, and added the "color" attribute to <barcode>. * Tweaked the <meta name="output-profile"> feature - individual features can now be turned off or on. * Built with PDF library 2.10.6, Graph Library 1.1.6 Version 1.1.39 (released 2008-04-24) ----------------------------------------------------------------- * Fixed the "pdf:show" action * The barcode default sizing may be slightly different, due to corrections in the underlying PDF library. * Added the ability to license the Report Generator with a license file, rather than a keycode. * Built with PDF library 2.10.1, Graph Library 1.1.6 Version 1.1.38 (released 2007-10-24) ----------------------------------------------------------------- * Added "modifyPDF" method stub to PDFFilter class, for easier custom filters * Built with PDF library 2.8.5, Graph Library 1.1.6 Version 1.1.37 (released 2007-08-21) ----------------------------------------------------------------- * Fix to position of blocks placed directly inside absolutely positioned blocks * Built with PDF library 2.8.4, Graph Library 1.1.6 Version 1.1.36 (released 2007-06-19) ----------------------------------------------------------------- * Under some circumstances, cells in a table row using "rowspan" would not have their height calculated correctly. Fixed. * Changes from PDF library will fix problems when using letter-spacing and non-ASCII Bookmarks. * Built with PDF library 2.8.1, Graph Library 1.1.6 Version 1.1.35 (released 2007-04-17) ----------------------------------------------------------------- * "background-macro" is now always drawn behind headers and footers * No signficant other changes other than a rebuild with PDF library 2.7.9, which has some fixes for the Pashto and Kirghiz languages. * Built with PDF library 2.7.9, Graph Library 1.1.6 Version 1.1.34 (released 2007-02-05) ----------------------------------------------------------------- * Fixed NullPointer when a table is created with a height attribute but no rows. * Barcodes can now be created with any height, to mirror the same change in the PDF library. The "min-height" attribute can be used to ensure the height doesn't go below the minimum recommended height of a barcode. * Fixed typo in DTD * Built with PDF library 2.7.7, Graph Library 1.1.6 Version 1.1.33 (released 2006-12-13) ----------------------------------------------------------------- * No signficant changes other than a rebuild with PDF library 2.7.6 - this allows our Polish customers (amongst others) to create PDFs without embedding a font. * Built with PDF library 2.7.6, Graph library 1.1.6 Version 1.1.32 (released 2006-09-13) ----------------------------------------------------------------- * Improvements to speed of text rendering both here and in the PDF library. Should be about 5-10% faster. * The default value for "submitted" for form elements is now "true" * Built with PDF library 2.7.2, Graph library 1.1.6 Version 1.1.31 (released 2006-07-26) ----------------------------------------------------------------- * Some tweaks to allow Graphs created with the Graph Library 2 to be embedded into a Report. Although theoretically this can be done no matter how the report is generated, these changes work best when the report is created using a JSP. * Built with PDF library 2.7.0, Graph library 1.1.6 Version 1.1.30 (released 2006-04-24) ----------------------------------------------------------------- * Fixed problem with some event handlers on <input> tag * Built with PDF library 2.6.9, Graph library 1.1.6 Version 1.1.29 (released 2006-01-31) ----------------------------------------------------------------- * Correctly position bullets when a <li> contains text of a varying sizes * Built with PDF library 2.6.6, Graph library 1.1.6 Version 1.1.28 (released 2005-11-04) ----------------------------------------------------------------- * Removed requirement to have SystemId specified for all InputSource. If a relative URL is encountered during parsing, then an error will be thrown. * Fixed pagenumber and totalpages definitions in DTD * Bookmarks pointing to nodes split at the end of a page were failing - now fixed * Improvements to CSS parsing * Built with PDF library 2.6.3, Graph library 1.1.6 Version 1.1.27 (released 2005-09-01) ----------------------------------------------------------------- * Smarter embedded font initialization when italic, bold and bold-italic are really the same as the regular font * Fixed rare infinite loop when laying out some tables with incorrect colspan attributes * Fixed occasional incorrect wrap when * Re-enabled "showtext" attribute for BarCodes, which were dropped in 1.1.10 * Built with PDF library 2.0.5, Graph library 1.1.5 (Latest build of PDF library fixes a memory leak - anyone using 1.1.10 or later should upgrade to at least this version) Version 1.1.13 (released 2003-12-05) ----------------------------------------------------------------- * Added "font-stretch" attribute. Note this is done by simple scaling, so will scale the vertical stems of the font as well. Not ideal or technically correct, but without multiple-master font support the only way we can do it. * Renamed "background-image-position" to correct name "background-position". The old name still works as an alias. * "background" shorthand attribute is now recognised according to CSS2 rules * Now allows blank values in <input type="select">, eg. <option></option> * Built with PDF library 2.0.4, Graph library 1.1.5 Version 1.1.12 (released 2003-11-21) ----------------------------------------------------------------- * "font" attribute now works for complicated font names including spaces, quotes etc. * TD tags with rowspan > 1 that cover more than one page are correctly sized. * <pagenumber> and <totalpages> tags can now take a "length" and "type" attribute, to specify the estimated number of characters and the type of digit (decimal, upper-roman etc.) respectively. * Built with PDF library 2.0.2, Graph library 1.1.5 Version 1.1.11 (released 2003-11-11) ----------------------------------------------------------------- * Documents no longer need an InputSource System ID to be specified, unless of course there are relative URLs to be resolved within the XML. * Several changes were made in the underlying PDF library. All users running 1.1.10 should upgrade to this version. * Built with PDF library 2.0.1, Graph library 1.1.5 Version 1.1.10 (released 2003-11-05) ----------------------------------------------------------------- * "class" attribute can take multiple classes, seperated by spaces. e.g. <p class="red outlined"> * Added alpha transparency support - just specify a color as alpha(50%, NNN) where NNN is any color - e.g. alpha(50%, red), alpha(50%, gray(50%)) * Valid CSS2 attributes that are not used by the Report Generator will no longer cause a CSS parsing error * Added new <meta> entries - output-profile, trapped. * Added new options for access-level - "print-lowres, print-highres" etc., plus "plain-metadata" * Signatures can now take a width and height, and also accept "acrobat6" or the name of a SignatureHandlerFactory class as a handler. Also takes background-image and background-pdf as parameters. * Fonts can be "opentype" as well as "truetype". Added a "bytes" attribute to allow single or double byte embedding - defaults to 1 * Document colors default to gray(0%), not rgb(0%,0%,0%). A subtle difference but important for PDF/X output. * Built with PDF library 2.0.1p1, Graph library 1.1.5 Version 1.1.9 (released 2003-10-08) ----------------------------------------------------------------- * Allows "with-key(x)" and "inline(x)" as values for the display-percentage attribute, where "x" is the number of decimal places to display on the graph. * Fixed PDFFilter class to work with WebLogic 8.1 * Fixed problem with Document Image caching where images had filenames containing "#" characters. * Built with PDF library 1.2.11, Graph library 1.1.4 Version 1.1.8 (released 2003-07-15) ----------------------------------------------------------------- * The "page-break-before" and "page-break-after" attributes can be set to "left" or "right" to control whether the next page appears on an even or odd page. * The "page-break-before" and "page-break-after" attributes can be set to "avoid" on a <TR> to keep it with the previous/next node. Other values like "always" are not (yet) recognised. * Added "min-height" attribute, for compatibility with CSS2 * Built with PDF library 1.2.11, Graph library 1.1.4 Version 1.1.7 (released 2003-04-30) ----------------------------------------------------------------- * Fixed bug which was causing an OutOfMemoryException even with tiny documents, caused by a certain combination of text and <br/> tags inside a <span> tag. * More fixes to language specific styles, continuing on from changes made in the previous version * Better bidirectional text handling * CSS fix for systems running non-ASCII encodings by default, eg OS/390. * Now skips unknown fonts in a list of fonts, only complaining if it can't find any of them. * Built with PDF library 1.2.10, Graph library 1.1.4 Version 1.1.6 (released 2003-04-08) ----------------------------------------------------------------- * Fixed language tests - previous versions were ignoring any :lang pseudo-tags specified in a stylesheet. Now that it's suddenly working some users may notice slightly different behaviour (eg. pages created in the en_US locale will now default to letter). Previous behaviour can be recreated by setting the "lang" tag on the PDF to something generic, eg. <pdf lang="en"> * Added workaround for weird stack problem with WebSphere 3.5.1 on AS/400 - this was resulting in tiny paragraphs inside tables on some installations. * Added some new internationalization examples in the "example/samples" folder * Can now set to set the base URL of the document. This can be used to override the above behaviour if required, by setting the value to a URL beginning with "https". * Inline elements can have backgrounds, padding, margins and borders * Added fix for Tomcat 4.0.4 and Tomcat 4.1.x when using a filter. * Added fix for com.sun.xml parser * Added support for bidirectional text - lists and tables are aligned correctly for arabic, hebrew and yiddish. Changing fonts or styles in the middle of a word will result in incorrect layout, and the "unicode-bidi" attribute is not supported (although explicit byte-order marks can be embedded in the document, eg ""), but other than that full bidirectional algorithm should be supported. * Any tag can now specify "white-space:pre" - it's not limited to <pre> * Improved border support - now the "border" property and friends function as specified in CSS2, with the exception that CSS2 border styles other than "solid" or "dotted" aren't recognized. * Split the "text-align" and "align" attributes. "align" is used to control alignment of blocks inside their parents, and "text-align" is used to control text inside a paragraph block. If "text-align" isn't set but "align" is, then the value of "align" is used, for backwards compatibilty. * Now uses the technically-more-correct "xml:lang" attribute as synonym for "lang". * Added "background-pdf:none" to turn off the background PDF * Built with PDF library 1.2.1, Graph library 1.1 Version 1.0.14 (released 2002-09-03) ----------------------------------------------------------------- * Added the ability to specify more than one font for a paragraph. If a glyph cannot be found in the first font, the second will be tried, then the third and so on. For example, <p font- could be used to display English and basic Greek without changing fonts. * Added language selectors in stylesheets. This allows you to do things like body:lang(ja) { font-family: HeiSeiMin; } or even body:lang(en_US) { size:letter; }. Both of these rules are now in the default stylesheet, along with some other language-specific rules which set the default font for Chinese, Japanese and Korean. * Added new type of color - "gradient(red,blue)" can be used to set the color on bar graphs ONLY to a smooth gradient running from red to blue. If used elsewhere, the result will be solid blue. Any two colors can be used, so long as they're in the same colorspace. * Added "upc-a" as a new type of barcode, to display UPC-A barcodes using the standard layout, rather than having to use the "ean-13" layout * Added new value for "display-values" attribute in bargraphs - "inside-top" will display the value of the bar slightly inside the top of the bar. * Can now change the axes-color of graphs using the "axes-color" attribute. "color", which erroneously did this earlier, no longer works. * Added patch for Tomcat 3.2 so the JAR can be deployed in WEB-INF/lib * Added patch for WebLogic 6.1 SP 3 (earlier releases of 6.1 are OK) * Several other fixes, including better error reporting, colorspace handling, OS/390 license key fix * About a 10% increase in speed across the board. * Built with PDF library 1.2, Graph library 1.1 Version 1.0.13 (released 2002-06-26) ----------------------------------------------------------------- * Localized formatters for graphs - the date() and simple() formatters will now be localized depending on the "lang" attribute. Previously they were tied to the locale of the webserver. * Renamed <currentpage> to <pagenumber>, and added an optional "idref" attribute, so you can print the page number of a different tag, eg. <pagenumber idref="chapter1"/>. Intended for use in table of contents. * Samples in a <datacurve> can now have Y-values of "NaN", "+Inf" or "-Inf", to add a gap in the middle of a line. * All axes graphs can have "min-y" or "max-y" attributes set, not just bar graphs * Fixed bug in span with no contents, eg. <b></b> * Built with PDF library 1.1.27, Graph library 1.0.12 Version 1.0.12 (released 2002-05-12) ----------------------------------------------------------------- * Fixed problem with <img> tag - only specifying one of the width or height now causes the other to be scaled correctly * All tags in CSS stylesheets are now case-insensitive * Fixed missing exception details caused by errors in CSS stylesheets * Ligatures are now always off for monospace fonts. * Code128 barcodes can now include a
character to represent the FCN1 control character - which means you can now use Code128 to print EAN128 codes. * Fixed bugs with custom formatters for graphs * Built with PDF library 1.1.25, Graph library 1.0.12 Version 1.0.11 (released 2002-04-21) ----------------------------------------------------------------- * Replaced "transform" method with parse(XMLReader, InputSource). Removed the old method completely - it never worked properly and shouldn't have been released. * Now handles styles specified inline HTML-style, e.g. <body style="margin:0;"> This is for easier conversion from HTML only, and is not the recommended way to specify attributes. * Now handles "font" attribute according to CSS2, eg "italic 12pt/14pt serif" * Added "font-variant" attribute - can be used to set text to small-caps. This requires some heavy processing and is not recommended for long phrases * Handles multiple arguments to padding/margin/border - e.g. to display the second page) * Added support for digital signatures via the <input type="signature"> tag. * Added ability to load a customer formatter for graphs by specifying the full constructor syntax - eg. * Added bar-width to <barcode> * Many smaller changes and bugfixes (naturally) Beta1 (released 2001-10-14) --------------------------- * First beta release. # vim: syntax=none textwidth=80
|
https://bfo.com/viewtext/products/report/docs/CHANGELOG.txt?title=Big%20Faceless%20Report%20Generator%20Changelog
|
CC-MAIN-2021-43
|
refinedweb
| 5,153
| 68.47
|
Content Atom Model DefinitionContent Atom Model Definition
This is the Thrift definition of the Content Atom model, and the published versions of this repository are built from the autogenerated code in various languages.
Adding a new atom typeAdding a new atom type
In order for the scala code generated from the thrift definitions to be packaged correctly a scala namespace needs to be included. For example for the chart atom this would be:
#@namespace scala com.gu.contentatom.thrift.atom.chart
How to releaseHow to release
$ sbt 'release cross'
This will release 3 artifacts to Maven Central:
content-atom-model-thrift-$version.jarcontains only the Thrift files
content-atom-model_2.13-$version.jarcontains the Thrift files and Scrooge-generated Scala 2.13 classes
content-atom-model_2.12-$version.jarcontains the Thrift files and Scrooge-generated Scala 2.12 classes
content-atom-model_2.11-$version.jarcontains the Thrift files and Scrooge-generated Scala 2.11 classes
You will need a PGP key and Sonatype credentials. See here and here for some helpful guides.
To cross release locally use
$ sbt '+publishLocal'
JavaScriptJavaScript
The JS library should be published to npmjs, see:
and
npm help publish.
If you're unfamiliar with publishing on npm the following commands can be useful:
npm whoami- to find out your username (if you have created one)
npm adduser- to create a user
npm owner ls- to check the owners of content-atom.
npm owner add <username>- to add a new owner allowing them to publish content-atom.
But in summary:
Bump the version number in
package.json
Make sure you have built the latest version of the JS library with
sbt compile
If you've added another type, be sure to add it to
js/main.js
Then,
npm publishin the same directory as
package.json
|
https://index.scala-lang.org/guardian/content-atom/content-atom-model/3.0.2?target=_2.11
|
CC-MAIN-2019-43
|
refinedweb
| 299
| 56.86
|
ISSUE-61
namespace for non-prefixed values of @rel
- State:
- CLOSED
- Product:
- RDFa
- Raised by:
- Ben Adida
- Opened on:
- 2007-10-04
- Description:
We've been dancing around the following for a while: PROPOSAL - "RDFa parsers should ignore non-prefixed values of @rel that are not part o the reserved words." See telecon discussion record of 2007-10-04
- Related emails:
- ISSUE-61: namespace for non-prefixed values of @rel (from dean+cgi@w3.org on 2007-10-04)
- Re: ISSUE-61: namespace for non-prefixed values of @rel (from ivan@w3.org on 2007-10-04)
Related notes:
2008-02-06: resolved as follows: "@rel/@rev non-prefixed values other than reserved keywords are ignored. Reserved keywords resolve to vocab#[keyword]." as per telecon on 2008-01-24:
|
http://www.w3.org/2006/07/SWD/track/issues/61
|
CC-MAIN-2021-39
|
refinedweb
| 129
| 54.42
|
Recently, I was evaluating CLI frameworks in Java and went through some of the commonly tried ones like Apache Commons and args4j.
I found that most of these frameworks were good at parsing the input passed in the following statement:
public static void main(String[] args)
But, one still has to write a lot of code to recognise whether a particular option had been passed, and whether its value was present or not.
For example, in Apache Commons, one has to create an org.apache.commons.cli.Options object, add different options that this particular command expects, and then pass this to org.apache.commons.cli.DefaultParser. After this, one gets an org.apache.commons.cli.CommandLine object, and then you can start to figure out whether a particular user input had that option or not.
Options options = new Options(); options.addOption(new Option(u, username, true, The username for this account.)); .... CommandLineParser parser = new DefaultParser(); ... CommandLine cmd = parser.parse(options, args); ... if(cmd.hasOption(u)) { //Work on the username. }
Every option of each of the commands should result in the above output!
Some optimisation is possible here, but doing this for each command is a bit tiresome, and doesnt help when you want to do a quick UT of your Java API.
I was looking for a framework that would reduce my development time substantially, and give me a way to call my API quickly.
A further search on Google brought me to and I was smitten! By Clichés simplicity, ease-of-use, speed of development and the sheer fun of experimenting with it!
It creates a shell for you, from where you can fire commands. It doesnt exit the shell until you fire the built-in Exit command.
Cliche also offers some inbuilt commands to list existing commands, and a pretty decent help menu. Moreover, it adds your commands to this help menu automatically. It even creates an abbreviation for your commands.
Adding commands is ridiculously easyas you will see below!
Heres how you go about using Cliche:
- Download the JAR from the above link.
- If you use Maven as your build tool, you can add this as your dependency in the pom.xml. A little more of searching on Google can help you with bringing Cliche into your other build frameworks.
<groupId>com.googlecode.clichemaven</groupId> <artifactId>cliche</cliche> <version>110413</cliche>
- Create a console shell, give it your own name and the text you want on your shell prompt, and a class that lists all your commands.
try { ShellFactory.createConsoleShell(MyShellPrompt, MyShell, new MYCLIClass()).commandLoop(); } catch(IOException e) { e.printStackTrace(); } @Command(description=Fetch the version of blah-blah installed on this machine) public int getversion(String args) { return Integer.parseInt(MyAPI.getVersion()); }
- You can even add descriptions to your parameters as follows:
@Command(description=my command description) public int someCommand( @Param(name=param1, description=description of param1) int param1, @Param(name=param2, description=description of param2) int param2) { .... }
Basically, with just two steps (adding dependency/putting the JAR in your classpath) and by creating the shell and a function for your command, youre on your way!
Sample outputs
The green output below is all from the inbuilt features of the Cliche jar.
MyShell MyShellPrompt> ?la
h hello () hw hello-world (p1) MyShellPrompt> ?h hw Command: hello-world Abbrev: hw Params: (p1) Description: prints hello world and an integer ahead Number of parameters: 1 p1 int prime number MyShellPrompt> hw 13 Hello World: 13 MyShellPrompt>
Here is the sample code:
package cliché.trial; import java.io.IOException; import asg.cliche.Command; import asg.cliche.Param; import asg.cliche.Shell; import asg.cliche.ShellFactory; public class Trials { @Command(description=prints hello.) public int hello() { System.out.println(Hello); return 1; } @Command(description=prints hello world and an integer ahead) public void helloWorld(@Param(name=p1, description=prime number) int p1) { System.out.println(Hello World: + p1); } public static void main(String[] args) throws IOException { try { Shell myShell = ShellFactory.createConsoleShell(MyShellPrompt, MyShell, new Trials()); myShell.commandLoop(); } catch (IOException e) { throw e; } } }
Copyright information: The Cliche library is distributed under the MIT licence and written by Anton Grigoryev (ansgri@gmail.com).
|
https://www.opensourceforu.com/2015/09/cliche-speeding-up-command-line-interface-development/
|
CC-MAIN-2020-45
|
refinedweb
| 691
| 57.87
|
#include <playerclient.h>
Inherits ClientProxy.
List of all members.
FiducialProxy
beacons
[inline]
Constructor. Leave the access field empty to start unconnected.
[virtual]
All proxies must provide this method. It is used internally to parse new data when it is received.
Reimplemented from ClientProxy.
Print out latest beacon data.
Print the latest FOV configuration.
Print the latest geometry configuration.
Get the sensor's geometry configuration.
Get the field of view.
Set the fiducial identification value displayed by this device (if supported) returns the value actually used by the device, which may differ from the one requested, or -1 on error. Also stores the returned id in the proxy's data member 'id'.
Get the fiducial identification value displayed by this device (if supported). returns the ID or -1 on error. Also stores the returned id in the proxy's data member 'id'.
Set the field of view, updating the proxy with the actual values achieved. Params are: minimum range in meters, maximum range in meters, view angle in radians
Attempt to send a message to a fiducial. See the Player manual for details of the message packet. Use a target_id of -1 to broadcast. If consume is true, the message is sent only once. If false, the message may be sent multiple times, but this is device dependent. Note: these message functions use configs that are probably only supported by Stage-1.4 (or later) fiducial driver.
Read a message received by the device. If a message is available, the recv_msg packet is filled in and 0 is returned. no message can be retrieved from the device, returns -1. If consume is true, the message is deleted from the device on reading. If false, the message is kept and can be read again. Note: these message functions use configs that are probably only supported by Stage-1.4 (or later) fiducial driver.
The number of beacons detected
The pose of the sensor [x,y,theta] in [m,m,rad]
The size of the sensor [x,y] in [m,m]
The size of the most recently detected fiducial
the minimum range of the sensor in meters (partially defines the FOV)
the maximum range of the sensor in meters (partially defines the FOV)
the receptive angle of the sensor in degrees (partially defines the FOV)
The latest laser beacon data.
|
http://playerstage.sourceforge.net/doc/Player-1.6.5/player-html/classFiducialProxy.php
|
CC-MAIN-2015-48
|
refinedweb
| 387
| 60.01
|
Hi,
I am trying to do the text adventure project (), and I’m having some problems. I’ll paste the code below. Note that I am using filler text here:
#include <iostream> int main () { std::cout << "\nLorem ipsum\n\n"; char choice1; std::cout << "Make a choice: A, B or C?"; std::cin >> choice1; while (choice1 != 'A', 'a', 'B', 'b', 'C', 'c') { std::cout << "Invalid entry. Try again!"; std::cin >> choice1; } if (choice1 == 'A' or choice1 == 'a') { std::cout << "\nYou chose A.\n\n"; } else if (choice1 == 'B' or choice1 == 'b') { std::cout << "\nYou chose B.\n\n"; } else if (choice1 == 'C' or choice1 == 'c') { std::cout << "\nYou chose C.\n\n"; } }
I am coding in notepad and compiling/executing in Windows, as Codecademy keeps disconnecting on me, at least in this exercise. In any case, when I execute the program I get to the “Make a choice” line, but when I try to make an input, I get the “Invalid entry” line no matter what I type, whether I type “A” or “b” or “x” or “1”. And if I type several characters, like “ax”, I get the “Invalid input” line an equal number of times, repeatedly. After a while, the program crashes.
What I want is that the player will get the “Invalid entry” line (one of them, not one for each character they type), no matter what they type unless it’s one of the six charcters I have entered, and that they will get this indefinitely until they enter a valid character. Then I want them to get the “You chose X” line, corresponding to what character they typed.
I have tried several alternatives, including:
while (choice1 != 'A' and choice1 != 'a' and choice1 != 'B' and choice1 != 'b' and choice1 != 'C' and choice1 != 'c')
But I can’t get it to work, so I imagine I must be doing something fundamentally wrong.
Any help would be greatly appreciated.
|
https://discuss.codecademy.com/t/text-adventure-cant-get-this-while-loop-to-work/481669
|
CC-MAIN-2020-50
|
refinedweb
| 321
| 83.05
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Ur problem solved - Remove ; in for loop
Posted by Jeganathan S on October 20, 2000 at 2:59 AM
import java.io.*;
public class a2n2{ public static void main (String [] args)throws Exception { String s;
BufferedReader kb = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter your Name:"); s = kb.readLine();
int count= s.length(); int pos=0; char chs; for(pos = 0; pos < count; pos++) { chs = s.charAt(pos); System.out.println("Character :"+ chs); } } }
Also, u r comparing the integer pos with character chs and there is a logical error that u r incrementing ur count(which is the length of the string), if u increase the count then automaticallyu will lose the length of the string and if u try accessingthat it will throw u StringOutofBoundsException as u r trying outof the String. And one more error i found is while incrementingcount u have done like count+ and it should be count++.
r u happy nowJeganathan S
|
http://www.artima.com/legacy/answers/Oct2000/messages/97.html
|
CC-MAIN-2017-43
|
refinedweb
| 190
| 62.58
|
Bem-vindo(a) ao Scribd!
Explorar E-books
Categorias
Explorar Audiolivros
Explorar Revistas
Explorar Podcasts
Gênero
Instrumento
Dificuldade
Explorar Documentos
General Editor
In Cooperation with
Founding Editor
Heiko A. Oberman
VOLUME 165
By
Gergely M. Juhsz
LEIDEN | BOSTONCover illustration: Jan de Gheets view of Antwerp, from Unio pro conservatione rei publice (Antwerp:Jan de Gheet, 1515), fo. 20v. (Tabularium, Centrale Bibliotheek, KU Leuven, shelfmark: R2B2529).
BR350.T8J84 2013236.809dc23
2013031671
This publication has been typeset in the multilingual Brill typeface. With over 5,100 characters coveringLatin, ipa, Greek, and Cyrillic, this typeface is especially suitable for use in the humanities.For more information, please see brill.com/brill-typeface.
issn 1573-5664isbn 978 90 04 24894 6 (hardback)isbn 978 90 04 25952 2 (e-book)
Acknowledgments.......................................................................................... xiList of Illustrations.......................................................................................... xiiiAbbreviations................................................................................................... xv
5.Conclusion................................................................................................... 427 The Inappropriateness of the Conservative Consensus................ 427 An Exegetical Debate in Its Context................................................... 428 The Legacy of the TyndaleJoye Debate............................................ 429
Appendices....................................................................................................... 433 1.George Joye to Hugh Latimer (29 April 1533).............................. 433 contents ix
Bibliography..................................................................................................... 453Index of Biblical References........................................................................ 525General Index................................................................................................... 532 Acknowledgments
Fig. 5.Signature from the second letter described in Fig. 2.............. 312
Common Abbreviations
bornd. diedE Erasmus Greek text or Erasmus Latin translationed. edited (by) or editorfl. flourishedJ1534 Joyes 1534 Antwerp New Testament edition [ Joye]J1535 Joyes 1535 Antwerp New Testament edition [ Joye]ms (mss) manuscript(s)n. note (footnote or endnote)no. numberNT New Testament or Novum TestamentumOT Old TestamentT1526 Tyndales 1526 Worms New Testament edition [Tyndale]T1534 Tyndales 1534 Antwerp New Testament edition [Tyndale]T1535 Tyndales 1535 Antwerp New Testament edition [Tyndale]TG1534 Tyndales 1534 Genesis translation [Tyndale]TP1530 Tyndales 1530 Pentateuch transalation [Tyndale]trans. translated (by) or translator or translationUP University Press (for sake of brevity, the name of the place of the university has been omitted if it coincided with the place of the publication. The word order may also vary. e.g. Cambridge: UP = Cambridge: Cambridge University Press UP Pennsylvania = University of Pennsylvania Press The Catholic UP of America = The Catholic University of Amer- ica PressVg Vulgate
1References in square brackets (e.g. [Joye]) contain the name of the author or editorunder whose name the book is listed in the Bibliography. Names in regular type indi-cate books listed among the Primary Sources (p. 453), those in small capital lettersindicate works listed among the Secondary Sources (p. 478). References starting with ISindicate Internet Sources (p. 523).xvi abbreviations
Bibliographical Abbreviations
A Tumultuous World
It was a cold Saturday in late winter, the feast of the Conversion of SaintAugustine, the second-to-last day of the month of February, the vigilof the third Sunday of the Lenten season in the year of our Lord 1535.After the warm summer of 1534, winter arrived early, with violent storms,winds, and floods in Antwerp during November and the first snow alreadyfalling at the end of the month; winter lasted an unusually long time thatyear.1 On that cold winters day a slim little book of barely forty-four smalloctavo pages emerged in Antwerp from the printing press of Catherinevan Ruremund, widow of the late printer Christoffel van Ruremund fromEndhoven.2 The widow knew that the book was not going to be her best-selling publication, although it could certainly count on some interest,being clandestine, controversial, and scandalous. Such ingredients alwaysspice up even the dullest stories and make even the worst books sell moreeasily, she knew. She also realized that the publication was not withoutrisk; her own husband had lost his life while imprisoned in the Tower ofLondon for the printing, smuggling, and sale of heretical books.3 But theauthor had been employed by the firm for some time, and as a widowed
de LUniversit de Louvain, (Index des livres interdits 2), Sherbrooke and Geneva: Univer-sit de Sherbrooke, 1986, n. 15). 4John Logan Allen, E. Julius Dasch & Barry Gough, Explorers From Ancient Times tothe Space Age, vol. III, New York: Macmillan Library Reference, 1998, pp. 1215. Antonio deAlcedo & Aaron Arrowsmith, The Geographical and Historical Dictionary of America andthe West Indies Containing an Entire Translation of the Spanish Work of Colonel Don Antoniode Alcedo, with Large Additions and Compilations from Modern Voyages and Travels andfrom Original and Authentic Information (London: James Carpenter, Longman, Hurst, Rees,Orme and Brown, White, Cochrane and Co. and Murray, Parker, Oxford; and Deighton,Cambridge, 1812, vol. 2, p. 378) gives the date of 6 January 1535. 5Coleccin de Documentos Inditos relativos al Descubrimiento, Conquista y Organizacionde las Antiguas Posesiones Espaolas de Amrica y Oceania, vol. XLI/II, Madrid: Manuel G.Hernandez, 1884, pp. 54041; Jos Antonio del Busto, El descubrimiento de las islas Gal-pagos por el obispo Fray Toms de Berlanga, in Boletn del Instituto Riva-Agero 12 (1982),pp. 8591; Alfredo Luna Tobar, Historia poltica internacional de la Islas Galpagos, (Biblio-teca del Pensamiento Interncionalista del Ecuador), Quito: Abya Yala, 1997, pp. 35, 34344. the tyndalejoye debate in the literature 3
6On the life and voyages of Cartier, see: Charles Bourel de La Roncire, Jacques Cart-ier et la dcouverte de la nouvelle-France, (Les grandes figures coloniales 2), Paris: Plon, 1931;Marius Barbeau, The Language of Canada in the Voyages of Jacques Cartier (15341538), inNational Museum of Canada Bulletin 173 (1959), pp. 108229; Jacques Chabannes, JacquesCartier, (Meneurs dhommes 7), Paris: Table Ronde, 1960; Yves Jacob, Jacques Cartier: deSaint-Malo au Saint-Laurent, Paris: Maritimes et dOutre-Mer, 1984; Michel Mollat andFernand Braudel, Le monde de Jacques Cartier: laventure au XVIe sicle, Paris: Berger-Levrault, 1984. 7The first account of the New World in English was the anonymous compilation Ofthe newe landes and of ye people founde by the messengers of the kynge of portyngale namedEmanuel: Of the. x. dyuers nacyons crystened. Of pope Iohn and his landes, and of the costelykeyes and wonders molodyes that in that lande is, printed in Antwerp by Iohn of Does-borowe around 1511. It was republished in 1885: Edward Arber (ed.), The First Three EnglishBooks on America, (?1511)1555 A.D.: Being Chiefly Translations, Compilations, &c. by Rich-ard Eden from the Writings, Maps, &c. of Pietro Martire...Sebastian Munster...SebastianCabot...with Extracts, &c. from the Works of other Spanish, Italian, and German Writers ofthe Time, Birmingham: s.n., 1885. 8For the European reaction to the expansion of the Ottoman Empire, see: C.A. Patrides,The Bloody and Cruell Turke. The Background of a Renaissance Commonplace, in Studies inthe Renaissance 10 (1963), pp. 12635; Harry Clark, The Publication of the Koran in Latin.A Reformation Dilemma, in SCJ 15 (1984), pp. 312; Gerald Maclean, Looking East. EnglishWriting and the Ottoman Empire Before 1800, Basingstoke: Palgrave Macmillan, 2007.4 chapter one
divided into factions and parties hostile to one another. And these diversereligious upheavals (collectively known as the Reformation) had theirpolitical consequences, too. The followers of the New Learning weredetermined to challenge and change the prevailing religious and politicalorder. Luthers stand against papal authority led, albeit against Luthersown will, to the Peasants War in Germany in 152425, which left morethan 100,000 dead according to contemporary estimates.9 When the peas-ants revolt spread into Alsace, true panic broke out: the Parlement ofParis believed that 14,000 Lutheran peasants intended to descend onFrance.10 For their contemporaries, this provided proof that the new doc-trine endangered the social order.11 In Mnster, the Anabaptists seizedcontrol of the city on 5 January 1534 and introduced their violent rule.12On Easter Sunday, however, the Anabaptist Jan Matthys and his thirtyfollowers were slain during a sortie against the troops of the expelledBishop Franz von Waldeck (14911553). Matthys was followed by Jan Beu-kels from Leiden (c.150936), whose name has been immortalized by theDutch proverb zich met een Jan(tje) van Leiden van iets afmaken becausehe justified his arbitrary and cruel actions (including the beheading ofone of his sixteen wives by his own hand in the marketplace) with divineinstructions received in visions.13 He carried on with the Anabaptist rulein the New Jerusalem, as they regarded Mnster, until Saint John the Bap-tists Feast in 1535, when Bishop von Waldecks troops finally took thecity and restored order. But the Anabaptists seemingly destabilizing andhorrific movement was not confined to the city of Mnster. The Antwerp
9E.g. There were slain within the time of three months above an hundred thousandpersons. And what followed further thereof? Great dearth of victual, great hunger andpenury? Thomas Cranmer, Miscellaneous Writings and Letters of Thomas Cranmer, Arch-bishop of Canterbury, Martyr, 1556, ed. John Edmund Cox for the Parker Society, Cambridge:UP, 1844, pp. 199200. On the Peasants War, see: Adolf Waas, Der Bauernkrieg. Die Bauernim Kampf um Gerechtigkeit 1300 bis 1525, Wiesbaden: Panorama, 1995; Peter Blickle, Derdeutsche Bauernkrieg von 1525, (Wege der Forschung 460), Darmstadt: WissenschaftlicheBuchgesellschaft, 1985; Leo Sievers, Revolution in Deutschland. Geschichte der Bauernk-riege, Stuttgart: Deutsche Verlags-Anstalt, 1978. 10Will Grayburn Moore, La Rforme allemande et la littrature franaise. Recherchessur la notorit de Luther en France, (Publications de la Facult des Lettres de lUniversitde Strasbourg), Strasbourg: lUniversit, 1930, pp. 24752. 11 David Nicholls, Heresy and Protestantism, 15201542. Questions of Perception andCommunication, in FrHist 10 (1996), p. 186. 12For the Anabaptist movement, see infra on p. 276. 13Elton, G.R., The New Cambridge Modern History, vol. II The Reformation 152059,Cambridge: UP, 1958. Reprint: (Blackwell Classic Histories of Europe), Cambridge: Black-well, 2000. p. 128 [abbrev. NCMH]. the tyndalejoye debate in the literature 5
pamphlets that recount the events in Mnster were on the street within afew weeks time, both in English and in Dutch. By that time Antwerp hadbanned several individual adherents of the Anabaptist movement, and on25 February 1534 all Anabaptists were banned from the town. Nonethe-less, a year later the Schout (royal bailiff) would charge several individu-als with Anabaptism, and on 17 February 1535, just ten days prior to thepublication of the Antwerp pamphlet, Ieronymus Pael, droogscheerder,van Keulen, was executed in Antwerp. His execution would be followedby others in March 1535 and January 1536. In Amsterdam, only a weekbefore the publication of the widows booklet, twelve Anabaptists, menand women, were detained after having stripped off their clothesas asign, they said, that they proclaimed the naked truth of the New Edenand run naked through the streets crying, Woe! Woe! The Wrath of God!14They were beheaded. The political conflicts on the European Continent, often a result ofthe split in Christianity, were no less distressing. In 1519 Spain invadedNavarre, a fief of France. This gave a pretext for Francis I of France (14941547) to enter into war with the Habsburg Emperor Charles V.15 After aseries of defeats on the Italian peninsula, the French king was imprisonedin Madrid (1525) and forced to yield his Italian territories. But a year later,in 1526, he formed the League of Cognac with Venice, Florence, and thePapacy against Charles V. The Emperor gained the upper hand once againand conquered Florence, sacked Rome (1527), and imprisoned Pope Clem-ent VII. Unfortunately, the Treaty of Cambrai (1529), which was supposedto put an end to the Italian wars, was short-lived. Francis I marched intoItaly in 1535. In response, Charles V invaded Provence, and thus began theseries of Great Italian Wars, which lasted until 1559. Denmark was entangled in the Grevens Fejde (Counts Feud, 153436).The rule of the Protestant pretender Christian of Gottorp (150359), pro-claimed first as regent (1533) and then as King Christian III (1534), wascontested by the count Christopher of Oldenburg (c.150466), who sup-ported the imprisoned reconverted Catholic King Christian II (14811559).16
14NCMH, vol. II, p. 127. George Huntston Williams, The Radical Reformation, Philadel-phia: Westminster, 1962, p. 359. 15See Paul Arblaster, Cat. 20 in Gergely Juhsz & Guido Latr (eds.), Tyndales Testa-ment, Turnhout: Brepols, 2002 [abbrev. TT ], p. 75. 16After his earlier interest in humanism and reform Catholicism, Christian II con-verted to Lutheranism in 1524 and became a good friend of Luther. He sponsored thetranslation of the NT into Danish. In 1533, he reconverted to Catholicism to obtainthe support of Charles V in reclaiming his throne. According to Lausten, this was not a6 chapter one
genuine reconversion, and Christian remained Lutheran in his conviction and maintainedhis correspondence with Luther until the latters death. See: Arblaster, Cat. 22 in TT,p. 78; Martin Schwarz Lausten, Christian 2. Mellem paven og Luther. Tro og politik omkringden rde konge i eksilet og i fangenskabet (15231559), (Kirkehistoriske Studier III,3),Copenhagen: Akademisk Forlag, 1995, pp. 46367. See also: Wayne te Brake, Shaping His-tory. Ordinary People in European Politics (15001700), Berkeley, Los Angeles & London: UPCalifornia, 1998; Victor E. Thoren & John Robert Christianson, The Lord of Uraniborg.A Biography of Tycho Brahe, Cambridge: UP, 1991; Ole Peter Grell, Scandinavia, in AndrewPettegree (ed.), The Reformation World, London & New York: Routledge, 2000, pp. 25860; Janus Mller Jensen, Denmark and the Crusades 14001650, Ph.D. thesis, University ofSouthern Denmark, 2005. 17R. Dyboski, O. Halecki, J.H. Penson & W.F. Reddaway (eds.), The Cambridge His-tory of Poland. From the Origins to Sobieski (1696), Cambridge: UP, 1950, pp. 31015. the tyndalejoye debate in the literature 7
18Eugen von Gyalkay, Die Schlacht bei Mohcs (29. August 1526), Berlin: de Gruyter,1926; Gza Perjs, The Fall of the Medieval Kingdom of Hungary: Mohcs 1526Buda 1541,trans. Maria D. Fenyo, (Atlantic Studies on Society in Change 56, War and Society inEast Central Europe 26), Boulder: Social Science Monographs, Highland Lakes: AtlanticResearch and Publications, Columbia UP, 1989; Tta, Pter Benedek, Hungary Overrun.A Source of Fortitude and Comfort, in Moreana, 40 (2003), pp. 1740. 19Patrides, The Bloody and Cruell Turke, pp. 12635; Clark, The Publication of theKoran in Latin, pp. 312; Sndor ze, Bneirt bnteti Isten a magyar npet. Egy 16. szzadibibliai prhuzam elemzse a nyomtatott egyhzi irodalom alapjn, Budapest: Magyar Nem-zeti Mzeum, 1991. 20Arblaster, Cat. 17 in TT, pp. 7173; Gergely Juhsz & Gilbert Tournoy, Cat 18. inTT, pp. 7374. 21 PRO, Acta inter Angliam et Belgium (15311546) Cotton Library MSS, Galba B.x. fo. 43.Published in L&P VI, p. 518.8 chapter one
22Flegge reports also that he succeeded in compelling the friar to appear on the samepulpit the following Sunday in order to recant and apologize for his words insulting theKing and Queen of England. Cotton Library MSS, Galba B.x., fo. 62. 23More accurately, Vilvoorde was a town in the Duchy of Brabant and not in the Countyof Flanders, but the designation Flanders is often used indiscriminately to indicate thewhole of the Southern Low Countries (or sometimes even the whole of the Low Coun-tries). On the date of Tyndales execution, see: Arblaster, Cat. 119 in TT, pp. 17677. 24Tyndale did not die on Henrys orders. While in his The obedie[n]ce of a Christen man,Tyndale supported Henrys claim over the power of the Pope, nonetheless he criticizedHenrys divorce in The practyse of Prelates. And even if there is evidence that Cromwelltried to intervene on behalf of Tyndale during the imprisonment of the latter, Henry prob-ably rejoiced in the death of the arch heretic Tyndale. In his Answer to Luther Henry wrotethat Luther fell in deuyce with one or two leude persons, borne in this our realme, for the tyndalejoye debate in the literature 9
the translatyng of the Newe testament in to Englysshe, as well with many corruptions ofthat holy text, as certayne prefaces, and other pestylent gloses in the margentes, for theaduancement and settyng forthe of his abhomynable heresyes, entendynge to abuse thegode myndes and deuotion, that you oure derely beloued people beare, towarde the holyscrypture & to enfect you with the deedly corruption and contagious odour of his pestylenterrours (Henry VIII, A copy of the letters, wherin the most redouted & mighty prince oursouerayne lorde kyng Henry the eyght [...] made answere vnto a certayne letter of MartynLuther, London: Richard Pynson, [1526/27], sig. A5r). 25Korey D. Maas, The Reformation and Robert Barnes. History, Theology and Polemicin Early Modern England, (Studies in Modern British Religious History 23), Woodbridge:Boydell Press, 2010, p. 23. On Barnes see infra in n. 265 on p. 344. 26Maas, The Reformation and Robert Barnes, p. 28. 27See infra on p. 344. 28John Stephenson, Wittenberg and Canterbury, in CTQ 48 (1984), pp. 16667. 29On the Antwerp origins of the Coverdale Bible, see: Guido Latr, The 1535 Cover-dale Bible and its Antwerp Origins, in Orlaith OSullivan (ed.), The Bible as Book. The10 chapter one
Bible was Jacobus van Meterens nephew, Leonard Ortels (d. 1539), fatherof Abraham Ortelius (152798), the famous Humanist geographer andcartographer.30 They were both arrested in the same year on suspicionof possessing heretical books.31 The English Bible, however, could not bestopped, and it was reprinted within a few months in England with royalprivilege. Henrys efforts to establish and extend his authority were not confinedto matters of religion and matrimony. In 1535 he annexed Wales, andhis troops under the command of Sir William Skeffington (14651535),Lord Deputy of Ireland, bombarded Maynooth and retook Dublin fromthe insurgents of the 22-year-old Thomas FitzGerald (Toms an tSoda,151337), 10th Earl of Kildare. To finance the wars and Henrys exces-sive lifestyle, Thomas Cromwell was authorized by Parliament to drawup an inventory in preparation for the dissolution of the monasteries.32The measures were met with some resistance (especially after a failedcrop in 1534, the year in which the break with Rome became definite,
eformation, London & New Castle: BL & Oak Knoll Press in association with The Scripto-Rrium: Center for Christian Antiquities, 2000, pp. 89102. 30For Ortelius, see: M.P. Gnard, La gnalogie du geographe Abraham Ortelius, inBulletin de la Socit Royale de Gographie dAnvers, 18801881, pp. 540; Henri EmmanuelWauwermans, art. Abraham Ortels ou Wortels, dit Ortelius, gographe et antiquaire, inBiographie nationale de Belgique, vol. XVI, Acadmie Royale des Sciences, des Lettres et desBeaux-Arts, Bruxelles: H. Thiry-Van Buggenhoudt, 1901, cols. 291332; Jan Denuce, Oud-Nederlandsche Kaartmakers in Betrekking met Plantijn, (Uitgaven der Antwerpsche Bibliophilen 28), Antwerp, 1913; C. Koeman, The History of Abraham Ortelius and His TheatrumOrbis Terrarum, Lausanne, 1964; R. Boumans, The Religious Views of Abraham Ortelius, inJWCI 7 (1954), pp. 37477; Iain Buchanan, Drer and Abraham Ortelius, in The BurlingtonMagazine 124 (1982), pp. 73441; Marcel van den Broecke, Abraham Ortelius, grondleg-ger van de moderne kartografie, in Kartografisch Tijdschrift 24 (1998), pp. 48; Marcel vanden Broecke, Ortelius as a Scientist, Collector and Merchant, in Journal of the InternationalMap Collectors Society 77 (1999), pp. 2131; Paul Binding, Imagined Corners. Exploringthe Worlds First Atlas, London: Headline Book, 2003; Marcel van den Broecke, OrteliusTheatrum Orbis Terrarum (15701641). Characteristics and Development of a Sample of onVerso Texts, (Netherlands Geographical Studies 380), The Hague: Koninklijk NederlandsAardrijkskundig Genootschap, 2009. 31Wauwermans, art. Abraham Ortelius, col. 293. 32In 1535 the Valor Ecclesasticus was prepared, a thorough document identifying thebenefices paying first fruits to the Pope, which Henry claimed as head of the Church inEngland. On the dissolution of the monasteries, see: David Knowles, The Religious Ordersin England, vol. 3, Cambridge: UP, 1959, pp. 195417; Eamon Duffy, The Stripping of theAltars. Traditional Religion in England, 14001580, New Haven: Yale UP, 1992; ChristopherHaigh, The Last Days of the Lancashire Monasteries and the Pilgrimage of Grace, Man-chester: Chetham Society, 1969; Christopher Haigh, Reformation and Resistance in TudorLancashire, London: Cambridge UP, 1975; Christopher Haigh, English Reformations. Reli-gion, Politics, and Society under the Tudors, Oxford: Clarendon, 1993. the tyndalejoye debate in the literature 11
and another bad harvest the following year), but Henry was determinedto carry out his plans.33 The closure of religious houses, convents, andabbeys, together with their schools, hospices, and charitable institutions,would result in England undergoing a tremendous social transformation.Overnight the country would lose more than 800 libraries, hospitals, andschools; 8000 religious men and women would be expelled from theirhomes; and many more individuals who used to work in or for the mon-asteries would become unemployed. Furthermore, the sick would be leftunattended, and the poor and destitute would have no place to turn foralms, food, or clothing. The suppression of the monasteries undoubtedlyplayed a significant role in the social instability of late Tudor Englandcaused by the masses of sturdy beggars.34 Due to the dissolution, Britainalso became deprived of female teachers, and for the next half-centurygirls would receive little education unless their family could afford to payprivate tutors, could send them abroad, or were willing to risk persecutionand stiff penalties by supporting unlicensed schools. Centres of pilgrim-ages, where no other source of income was readily available for the locals,became devastated and impoverished. The whole known world was in turmoil. Its inhabitants had more ontheir minds than taking notice of the publication of the van RuremundPress. The widows pamphlet was received with hardly any interest atthe time. The generations that followed essentially ignored the booklet,too. The fact that the Proclamation of 8 July 1546 listed the author amongthose writers whose works were forbidden did not help boost the recogni-tion and the availability of the book either.35 Only one copy is known tohave survived, and it is located in Cambridge University Library.36
33For example, the Lincolnshire Rising and the Pilgrimage of Grace. See: Haigh, TheLast Days of the Lancashire Monasteries and the Pilgrimage of Grace; Haigh, Reformation andResistance in Tudor Lancashire; Richard Rex, Henry VIII and the English Reformation, Lon-don: Macmillan, 1993; Ethan H. Shagam, Popular Politics and the English Reformation, Cam-bridge: UP, 2003, pp. 89130; Robert E. Scully, The Unmaking of a Saint. Thomas Becketand the English Reformation, in The Catholic Historical Review 86 (2000), pp. 579602, esp.58789; W.G. Hoskins, The Age of Plunder. The England of Henry VIII, 15001547, London,1976; Peter Marshall, Religious Identities in Henry VIIIs England, (StAndrews), Aldershot:Ashgate, 2006, passim, esp. pp. 21648; Hugh Loughran, Henry VIII and the Pilgrimage ofGrace (1537), in Catholic Insight 5 (1997), pp. 2426. 34Arthur F. Kinney, Rogues, Vagabonds & Sturdy Beggars. A New Gallery of Tudor andEarly Stuart Rogue Literature Exposing the Lives, Times, and Cozening Tricks of The Elizabe-than Underworld, Barre: Imprint Society, 1973. 35Paul L. Hughes & James Francis Larkin (eds.), Tudor Royal Proclamations, vol. 1 TheEarly Tudors (14851553), New Haven and London: Yale UP, 1964, no. 272. 36Shelfmark: Syn.8.53.75.12 chapter one
The Pamphlet and Its Author: The Debate on the Doom of the Dead between George Joye and William Tyndale
Having briefly described the worrisome and daunting world in which thebook saw the light of day, it is time to reveal the title and the author ofthe widows pamphlet. The book is entitled An Apologye made by GeorgeIoye to satisfye (if it maye be) w. Tindale: to pourge & defende himself ageinstso many sclaunderouse lyes fayned vpon him in Tindals vncheritable andvnsober Pystle so well worthye to be prefixed for the Reader to induce himinto the vnderstaning of hys new Testament diligently corrected & printed inthe yeare of oure lorde. M. CCCCC. and xxxiiij. in Nouember. The author,as the title reveals, is a certain George Joye (c.14951553), an English Prot-estant writer and Bible translator, a refugee at the time, living and work-ing in Antwerp.37 The occasion for the publication was his debate withanother English Protestant Bible translator, William Tyndale (c.14941536),also living at the time in Antwerp.38 Their debate is the subject matter ofthis present work, for which Joyes book (further referred to as: Apologye)will form one of the key sources.
William TyndaleWilliam Tyndale (also called Hutchins) is undoubtedly the better knownof the parties. Therefore, his life will only be reviewed succinctly for thesake of introduction. He was born in Gloucestershire around 1494, waseducated in Oxford where he was ordained as a priest, and may also havestudied in Cambridge. His disappointing university experience, the igno-rance and malice of his provincial fellow clergymen, and Luthers worksprompted him to answer Erasmus call for the preparation of a fresh
37On Joyes life, see: Charles C. Butterworth & Allan G. Chester, George Joye (1495?1553). A Chapter in the History of the English Bible and the English Reformation, Philadelphia:UP of Pennsylvania, 1962 [abbrev. BC, George Joye]; Helen L. Parish, art. George Joye in ISODNB; IS ASC Renhold. 38For accounts of Tyndales life, see Andrew J. Brown, William Tyndale on Priests andPreachers. With New Light on His Early Career, London: Inscriptor Imprints, 1996; RobertDemaus, William Tyndale. A Biography. A Contribution to the Early History of the EnglishBible, London: Religious Tract Society, 1871; reprinted and revised by Richard Lovett,Amsterdam: J.C. Giben, 1971; James Frederic Mozley, William Tyndale, London & NewYork: SPCK/Macmillan, 1937; reprinted 1971; David Daniell, William Tyndale. A Biography,New Haven & London: Yale UP, 1994; Gergely Juhsz & Guido Latr (eds.), TyndalesTestament, Turnhout: Brepols, 2002. the tyndalejoye debate in the literature 13
39Despite the ad nauseam repeated claim that the Church forbade the translation orthe reading of the Scriptures in the vernacular, translating (let alone reading) per se wasnot forbidden at all. In fact, the Continent knew a wealth of vernacular Bible translationsfrom the early Middle Ages on, the Bible had already been translated into Old Englishin the 8th century, and the Bible was translated into Anglo-Norman in the 11th century.Erasmus call for vernacular translations for the ploughboy, which inspired Tyndale soprofoundly, was, in fact, pushing at an open door, at least where the Continent was con-cerned. In Germany, for example, the Mentel Bible, a High German version, had alreadybeen put out in 1466, before Luther was even born. There were altogether at least eigh-teen complete printed Low and High German editions of the Bible, ninety editions of theGospels and the Sunday readings, and some fourteen German Psalters before Luthers NTwas published (Juhsz, Cat. 57 in TT, pp. 11617). Some Provincial Councils, such as thatat Toulouse in 1229, did locally regulate the dissemination and translation of the Biblewhere it was being used to attack the established religious and social order. This happenedwith the translations of John Wycliffe (c.132084), John Purvey (c.13531428), and Nicholasof Hereford (active 13701417) too (138084, 1396), and consequently episcopal approvalwas required by the Constitutions adopted by the Provincial Council at Oxford in 1408for any new, unauthorized translations of the Bible. In practice it did come down to nonew translation being made after that date, until Tyndales Cologne publication. (The textof the Constitution has been published: Alfred W. Pollard, Records of the English Bible.The Documents Relating to the Translation and Publication of the Bible in English, 15251611,Henry Frowde, London: Oxford UP, 1911, pp. 7980.) Thomas More attests to having seenacceptable English translations in manuscript form (Thomas More, A dyaloge of syr ThomasMore knyghte [...] touchyng the pestylent sect of Luther and Tyndale, London: John Rastell,June 1529, III, 14, fos. 8890). These, according to the majority of scholars, were probablyWycliffite manuscripts. For further information, see: Ian C. Levy (ed.), A Companion toJohn Wyclif, Late Medieval Theologian, (Brills Companions to the Christian Tradition 4),Leiden: Brill, 2006; G.W.H. Lampe (ed.), The Cambridge History of the Bible. The West fromthe Fathers to the Reformation, vol. 2, Cambridge & New York: Cambridge UP, 1969.40In contrast to Tyndale, More, or Fisher, Tunstall was more of a pragmatist than anidealist and avoided conflict at all cost. He was the counsellor of Catherine of Aragonduring the divorce, but he tried to dissuade her from appealing to Rome. Although he wasnot content with Henrys break with Rome, he accepted Henrys claim to be head of theChurch and took the Oath of Succession. He banned Tyndales New Testament and SimonFishs Supplication for the Beggers, but he took no harsh steps against heretics and wasrenowned for being lenient in order to encourage recantation. During the reign of EdwardVI, Tunstall was criticized by fellow bishop Stephen Gardiner (14831555) for his indulgentcompliance with changes in religious and civil matters that they both despised. Eventuallyhe voted against the Kings policy and was imprisoned, but when he was re-establishedin his bishopric under Mary I, he was reluctant to persecute Protestants. At the age ofeighty-five, when Elizabeth I came to power, however, Tunstall refused to take the Oath ofSupremacy, and he was imprisoned again, where he died within a few weeks. On Tunstall,see: Charles Sturge, Cuthbert Tunstal. Churchman, Scholar, Statesman, Administrator,14 chapter one
London: Longmans Green, 1938; D.G. Newcombe, art. Cuthbert Tunstal in IS ODNB; art.Cuthbert Tunstall in IS CE. 41 The matriculation-register of the University of Wittenberg contains an entry Guil-lelmus Daltici Ex Anglia 27 Maij 1524. This has been suggested to refer to Tyndale. See:Preserved Smith, Englishmen at Wittenberg in the Sixteenth Century, in EHR 36 (1921),pp. 42233. 42Richard Rex has correctly pointed out that the common opinion, which ascribes theabortive Cologne printing to Peter Quentell, the leading Catholic printer and publisher ofthe decade, is mistaken. (Richard Rex, The English Campaign against Luther in the 1520s.The Alexander Prize Essay, in Transactions of the Royal Historical Society, 5th Ser., 39 (1989),p. 103). Relying on secondary literature, I also followed this erroneous attribution in a for-mer publication. (Juhsz, Cat. 93 in TT, p. 149). With this note I would like to correct myearlier position. See also infra on p. 249. 43The community of and around the English Merchant Adventurers was the largestforeign natio in Antwerp. See Oskar de Smedt, De Engelse Natie te Antwerpen in de 16deEeuw (14961582), 2 vols., Antwerp: De Sikkel, 1954. 44On the role of Antwerp in the early Reformation period, see: Paul Arblaster, TotiusMundi Emporium Antwerp as a Centre for Vernacular Bible Translations, 15231545, in Arie-Jan Gelderblom, Jan L. de Jong & Marc Van Vaeck (eds.), The Low Countries as a Cross-roads of Religious Beliefs, Leiden: Brill, 2004, pp. 931; Guido Latr, The First English Biblesin Print (Antwerp, 152638), in TSJ 19 (August 2001), pp. 3537; Gergely Juhsz, Antwerpenszerepe a nyugat-eurpai korareformcis bibliafordtsok trtnetben, in Pter Losonczi the tyndalejoye debate in the literature 15
& Gza Xeravits (eds.), Vita s prbeszd. A monoteista hagyomny trtneti perspek-tvban, Budapest: Goldziher Intzet-LHarmattan, 2004, pp. 87118; TT. 45William Tyndale, The obedie[n]ce of a Christen man and how Christen rulers ought togoverne/ where in also (yf thou marke diligently) thou shalt fynde eyes to perceave the craftyconveyaunce of all iugglers, At Marlborow in the lande of Hesse: Hans luft [vere Antwerp:Merten de Keyser], 2 October 1528. A modern spelling edition was prepared by DavidDaniell, published in the Penguin Classics series in 2000. A critical edition is being pre-pared by Amanda Piesse and Paul Arblaster and is to be published in Manchester by UP. 46For more information, see Arblaster, Cat. 98 in TT, pp. 15556. 47William Tyndale, The parable of the wicked mammon, Malborowe in the londe offHesse: Hans luft [vere Antwerp: Merten de Keyser], 8 May 1528. 48On Tyndales The practyse of Prelates see: Arblaster, Cat. 107 in TT, pp. 16364. 49See Juhsz, Cat. 96 in TT, pp. 15355.16 chapter one
pestylent sect of Luther and Tyndale (London: John Rastell, June 1529). Inhis An answere vnto Sir Thomas Mores dialoge, from the press of SymonCock in 1531, Tyndale defends his methods of biblical interpretation andhis choice of words in the translation.50 After his clarification, he refutesMores arguments chapter by chapter. Tyndales Answer was matched byMores voluminous The confutacyon of Tyndales answere, but Tyndale leftit unreciprocated.51 In April 1535 he was betrayed and arrested. He wascharged with Lutheran heresy and was imprisoned at Vilvoorde. Aftermore than a year in prison, Tyndale was strangled and his body burned,probably on 6 September 1536. Although many of his theological stances were not followed by theChurch of England (or any other later Protestant offshoot), there is nodenomination among English Protestantism that would not claim its ori-gin in one way or another in Tyndales efforts.52 Today, his legacy largelyremains in his translations. They testify to Tyndales extraordinary linguis-tic talents: smooth, eloquent, rhythmic, and uncomplicated, his phrasessound well even half a millennium later. They influenced every singlesubsequent English Bible translation, and his effect on the developmentof the English language is inestimable.
George JoyeWhile William Tyndale needs little introduction, his opponent in thedebate is much less celebrated. George Joye was born around 1495 toa well-off intellectual family at Salpho Bury (Bedfordshire, about sixkilometres northeast of Bedford), the only mentioned Renhold manorin the Domesday Book.53 Until the dissolution of the monasteries, the
50William Tyndale, An answere vnto Sir Thomas Mores dialoge made by Uvillyam Tin-dale, Antwerp: Symon Cock, 1531. Modern critical edition: William Tyndale, An Answerevnto Sir Thomas Mores Dialoge, eds. Anne M. ODonnell & Jared Wicks, (The IndependentWorks of William Tyndale 3), Washington (DC): Catholic UP of America, 2000. [hereafter:ODonnell]. 51 Thomas More, The confutacyon of Tyndales answere, London: William Rastell, 153233.On the debate between Tyndale and More, see: Arblaster, Cats. 10810 in TT, pp. 16467. 52For more information on how Tyndales memory has changed in the past, see:Gergely Juhsz & Paul Arblaster, Can Translating the Bible Be Bad for Your Health?William Tyndale and the Falsification of Memory, in Johan Leemans & Jrgen Mettepen-ningen (eds.), More Than a Memory. The Discourse of Martyrdom and the Construction ofChristian Identity in the History of Christianity, (ANL 51), Leuven, Paris, and Dudley: Peeters,2005, pp. 31540. 53William Page (ed.), The Victoria History of the County of Bedford, vol. I, p. 380; vol. III,p. 216. the tyndalejoye debate in the literature 17
manor together with the tithe of entire Renhold was held by the Prior ofNewnham Abbey, the most ancient religious foundation in Bedfordshire.54 The wealth, loyalty to the King, and piety of the Joye family is exemplified by the foundation of Joyes Charity in the Parish of St Pauls, Bedford, in 1503, established by the testament of the lawyer William Joye of Bedford, George Joyes grandfather.55 Georges father, John Joye (d. 1521), was a yeo- man of Renhold. Henry Joye, the brother of George, became attorney in the Common Plea to the Newnham Priory, Bedford.56 The mansion remained in the hands of the Joye family. In 1581, Buryssteede or Salphobury was recorded to be occupied by William Joye of Renhold.57 George Joye was educated at Cambridge. Around 1508 he entered Christs College, where he graduated as a Bachelor of Arts in 1513 or 1514. The following year, on 3 March 1515, Georgius Ioye de Rownhall was ordained subdeacon at the Augustinian Priory of Newnham, Bedford, and three weeks later he was ordained priest at the Benedictine Abbey of Humberston, Lincolnshire.58 In early 1517 he obtained the degree of Master of Arts and was inceptor in arte.59 He lost his father in 1521. On 27 April of the same year he was elected Fellow of Peterhouse. His name Geo. Joye appears on the mutilated list of Artium professores of
54Page, The Victoria History of the County of Bedford, vol. III, p. 216. 55Joyes Charity provided for a priest to sing daily mass for the souls of Henry VII(1457, reigned 14851509) and his wife, Elisabeth of York (14661503), whose marriage on18 January 1486 ended the Wars of the Roses and was responsible for the creation of theTudor Rose (the joining of the white rose of York and the red rose of Lancaster). IS ASCRenhold. 56IS ASC Renhold. 57James Frederic Mozley, George Joye, or Gee, in N&Q 185 (1943), pp. 25253. 58The Register of the bishop of Lincoln is quoted by BC, George Joye, p. 17. Butterworthand Chester state that he was ordained for Humberston Abbey. This is unlikely, as he wasin all probability a diocesan priest. They also present Joye as subject to the Augustin-ian prior Ashwell of Newnham Priory, which is almost as unlikely (p. 38). Cf. Thomas M.Parkers review in EHR 79 (1964), pp. 83839. When Newnham Abbey was suppressed,some of the estates were bought by John Drake, who was at the time steward of the abbey.(See: Louis Stoughton Drake, The Drake Family in England and America 13601895 and theDescendants of Thomas Drake of Weymouth, MA 16351691, Boston: private edition, 1896.)The stones of the abbey were probably used for other buildings, inter alia for the WillingtonDovecote & Stables, a stone dovecote containing nesting boxes for over 1500 pigeons (ISWillington Dovecote). The dovecote was finished in 1541 and Joye still might have seen it, nodoubt feeling somewhat contented about Ashwells priory ending as a stable and nestingboxes for doves. The abbeys hall church still exists as St Pauls in Bedford. On NewnhamAbbey, see: Houses of Austin canons. The priory of Newnham, in Page, The Victoria Historyof the County of Bedford: vol. I, pp. 37781. 59BC, George Joye, p. 19.18 chapter one
60L&P Addenda, vol. I/1, no. 357. Butterworth and Chester suggest that the list mighthave been drawn up for the visit of Henry VIII to Cambridge that year. BC, George Joye, p. 19. 61 Just a few who were present in Cambridge while Joye was there: George Stafford(Pembroke College, fellow in 1515), Nicholas Ridley (c.150055, Pembroke College, fellowc.1524), Thomas Arthur (Pembroke College, BD in 1523), Thomas Bilney (c.14911531, TrinityHall, BD in 1524), John Rogers (Pembroke College, BA in 1526), Edward Foxe (c.14961538, apersonal friend of Joye, Kings College), John Frith (150333, Kings College), Richard Bayfield(Benet Hall, d. 1531), Matthew Parker (150475, Benet Hall, BA in 1525, fellow in 1527),Richard Taverner (150575, Benet Hall), Thomas Cranmer (14891556, Jesus College, reac-cepted fellow in 1523), John Bale (14951563, Jesus College, BD in 1529), Stephen Gardiner(14971555, Trinity Hall, JCD in 1521), Hugh Latimer (c.1485/901555, fellow of Clare Col-lege, BD in 1521), Robert Barnes (14951540, DD in 1523), Simon Smith (Gonville Hall, MA).Having assumed his vows as Augustinian friar, Myles Coverdale (c.14881568) was also liv-ing in the Cambridge priory where Robert Barnes was the prior. Many of them read Greek,and almost all of them became involved in one way or another in the translation and dis-semination of the Scriptures. The presence of such an illustrious company at Cambridgeis probably the reason behind Tyndales alleged stay there. For further information, see:BC, George Joye, pp. 2331; Arthur Tilley, Greek Studies in Early Sixteenth-Century England,in EHR, vol. 53, No. 211 (July 1938), pp. 43856; Marcus Lawrence Loane, Masters of theEnglish Reformation, London: Church Society, 1954; and the corresponding ODNB entries. 62George Joye, The refutation of the byshop of Winchesters derke declaration, London,1546, fo. lxxxiv. The incriminating book was: Joannes Chrysostom, Divi Ioannis Chrysostomi/archiepiscopi Constantinopolitani/ in totum Geneseos librum homili sexagintasex, Ioanne the tyndalejoye debate in the literature 19
Oecolampadio hoc anno uers. Habes prterea textum Geneseos/ iuxta septuaginta inter-pretes ditionem qua authores prisci ferme omnes usi sunt eodem interprete, Basileae: ApvdAndream Cratandrvm, Anno 1523. Mense Septembri. 63On their trials, see: John F. Davis, The Trials of Thomas Bylney and the English Refor-mation, in The Historical Journal 24 (1981), pp. 77590. 64Joye, The refutation of the byshop of Winchesters derke declaration, fo. lxxxiv. 65Joye himself gives the points of accusation by Ashwell, as well as an account of hissummons to London and how he decided to emigrate to the Continent, in his The let-ters which Iohan Ashwel Priour of Newnham Abbey besids Bedforde, sente secretely to theBishope of Lyncolne/ in the yeare of our lorde M.D.xxvij. Where in the sayde priour accusethGeorge Ioye that tyme beinge felawe of Peter college in Cambridge, of fower opinio[n]s: withthe answer of the sayed George vn to the same opinions, Straszburge [vere Antwerp: Mertende Keyser], 10. daye of June [1531]. 66For a discussion on Joyes presence in Strasbourg, see: BC, George Joye, pp. 4750.Strasbourg at the time was not only the home for mainstream Reformers (e.g. MartinBucer, Matthus Zell and Wolfgang Capito) but was also a safe haven for various refugeesof the Radical reformation (e.g. Melchior Hoffman, Caspar Schwenckfeld and ClemensZiegler). Eventually these Anabaptists and other sectarians were expelled from the city(see infra on pp. 208 and 277). 67Eventually William Tyndale, Robert Barnes, Myles Coverdale, George Constantine(c.1500c.1561), Simon Smith, Simon Fish (d. 1531), William Roye (d. 1531), Jerome Barlow(d. 1568), and John Rogers all went to Antwerp, although they were not necessarily allthere at the same time.20 chapter one
before 1500.68 During the first four decades of the 16th century, the cityhad some sixty-odd printers active who were issuing high-quality worksat relatively low cost in Latin, Greek, Dutch, English, French, Italian,Spanish, Danish, and German.69 As this type of work required accuracy,patience, and, not unimportantly, considerable intellectual and linguisticabilities, the cheap labour of well-trained illegal English immigrant clericsseeking some source of income was readily exploited. Their precariousposition reassured the printer that they were not going to turn him in tothe authorities for the lucrative black market publications. Furthermore,their new writings and translations could satisfy the demand for suchclandestine books. Joye, too, seems to have earned his living by proofread-ing, translating, and writing for various Antwerp printers. During his firstperiod of exile he wrote defences against his accusers, composed prayerbooks, and translated a considerable portion of the Old Testament (OT).His first publication was a primer, a popular devotional book containingprayers and guidance for piety.70 Though not the first English primer,Joyes was certainly the first Protestant devotional manual ever pub-lished in the English language.71 No copy has survived, but based on its
68Maria Elizabeth Kronenberg, Notes on English Printing in the Low Countries (EarlySixteenth Century), in The Library, s4-IX (1928), p. 140; E. Gorden Duff, Fifteenth CenturyEnglish Books. A Bibliography of Books and Documents Printed in England and of Books forthe English Market Printed Abroad. Oxford: UP for the Bibliographical Society, 1917. 69Cf. Frederick C. Avis, Englands Use of Antwerp Printers, Gutenberg-Jahrbuch 1973,p. 234. Avis mistakenly mentions Hebrew and leaves out Dutch in his list of languages.Daniell followed Avis mistaken list (Daniell, William Tyndale, p. 169). 70The name primer was originally used to denote the Book of Hours of the Blessed Vir-gin Mary in the 14th century. Later, other prayers were added. Compiled from materialsused in church and monastery, the Primer was intended specially for the laity, to guide thedevout layman in his private daily devotions or to help him bear his part in the services ofthe Church (Charles C. Butterworth, The English Primers (15291545). Their Publicationand Connection with the English Bible and the Reformation in England, Philadelphia: UPPennsylvania, 1953, p. 2). 71 William A. Clebsch, Englands Earliest Protestants 15201535, (Yale Publications inReligion 11), New Haven: Yale UP, 1964, reprinted: Westport: Greenwood, 1980. See alsoChristopher Haigh, The English Reformation Revised, Cambridge: UP, 1987, p. 208. Earlierprimers according the Salisbury (Sarum) rite had been circulating in English in manuscriptform. Henry Littlehales edited two such manuscripts for the Early English Text Society(Original Series 105 and 109): The Prymer, or Prayer-Book of the Lay People in the MiddleAges, dating about 1400 A.D., London, 1891, and The Prymer or Lay Folks Prayer Book, Lon-don, 189597. The first known primer to contain prayers in English was published in 1494by Caxton. In 1523 Christopher van Ruremund published a primer which contained theOur Father, the Hail Mary, the Creed, and The x.v. ooes in englighe (sic) (the Fifteen Oswere popular supplications ascribed to St Bridget), as well as various rubrics: headingsand indulgences connected with the prayers and the number of aves, paternosters, andcredos to be said: Hore beate mari virginis secundum usum Sarum: cum varijs orationibus/cuiliber deuoto commodis, [Christopher van Ruremund for] Peter Kaetz, 1523. For prim- the tyndalejoye debate in the literature 21
ers that contained English prayers prior to Joyes Primer, see: Butterworth, The EnglishPrimers, pp. 110. 72E.g. More, The confutacyon of Tyndales answere, sig. Bb2r, and the Publick Instrumentdrawn up by a royal commission in May 1530, printed in David Wilkins, Concilia MagnaeBritanniae et Hiberniae, a synodo Verolamiensi a. D. 446 ad Londinensem a. D. 1717, acceduntconstitutiones et alia ad historiam ecclesiae anglicanae spectantia...A Davide Wilkins col-lecta, vol. 3, London, 1737, reprint: Brussels: Culture et civilisation, 1964, p. 727. 73The English word Dirge, referring to the Office for the Dead, is derived from the firstwords of the first antiphon of the Matins in the Officium defunctorum: Dirige, Domine,Deus meus, in conspectu tuo viam meam (Ps. 5:9(8)). Besides its tendentious omissions, thePrimer was also criticized for propagating heretical positions. See infra on p. 296. 74George Joye, Ortulus anime. The garden of the soule: or the englisshe primers, Argen-tine: Francis Foxe [vere Antwerp: Merten de Keyser], 1530, K7vK8v. The only known copyin the British Library was discovered in 1949. 75Joye, Ortulus anime, K8v. 76George Joye (trans.), The Psalter of Dauid purely and faithfully translated aftir thetexte of Feline: euery Psalme hauyinge his argument before/ declarynge brefly thentente &substance of the wholl Psalme, Argentine: Francis foxe [vere Antwerp: Merten de Keyser],16 January 1530, A1v. On Bucers Psalter published under the name Aretius Felinus, seeinfra on pp. 215ff.22 chapter one
85George Joye (trans.), Ieremy the Prophete/ translated into Englisshe: by George Ioye:some tyme felowe of Peter College in Cambridge. The songe of Moses is added in the ende tomagnif ye our Lorde for the fallof our Pharao the Bisshop of Rome, [Antwerp: Catherine vanRuremund], Anno. M.D. and .xxxiiii. in the monthe of Maye. 86George Joye (trans.), Dauids Psalter/ diligently and faithfully translated by GeorgeIoye/ with breif Arguments before euery Psalme/ declaringe the effect therof, [Antwepen:]Martyne Emperowr [= Merten de Kesyer], 1534. 87According to a letter by Tyndale preserved in Foxes Actes and Monuments, Joye evenintended to print a complete Bible and sent Henry and Anne Boleyn each a copy of twoleaves of Genesis in a great form to obtain royal approval in 1533 (John Foxe, A&M, 1563,p. 521). If the information is correct, Joyes hopes were not completely unfounded, as Car-dinal Wolsey had been dismissed from all of his posts of power, was charged with treason,and died in 1530. Henry, more and more under the influence of Cromwell, was clearlyheading for a breach with Rome. In 1531 Cromwells envoy, Stephen Vaughan (c.15021549),attempted to come to an accord with Tyndale about returning to England. Later he alsoreported about Joye to Cromwell that he lerned of one George Gee fled out of Englond[...] who undoubtedly is a right honest and true subiect to the Kyng (State Papers,vol. VII, p. 489). Only a year after Joyes alleged petition, in 1534, Joyes 1530 translation ofthe Psalms could already be reprinted by Thomas Godfray in London cum privilegio regali(although this did not mean that Henry licensed the book), and in 1541 it was printedagain by Edward Whitchurch. On 19 December 1534, the English bishops petitioned foran English Bible (Pollard, Records of the English Bible, p. 177). Tyndale wrote frowninglyto Frith that the result of Joyes petition was only a search for English books among theAntwerp printers and for an English priest who would translate the Bible. It is much morelikely, however, that the search was not conducted for an English Bible or for Joye (whowas in contact with Vaughan), but to seize the Franciscan William Peto of Greenwich(later Cardinal, d. c.1558) and a certain Elston of Canterbury, who were superintending apublication of a treatise defending Catherine of Aragons rights under Catholic Canon Law.This bit of information was communicated to Cromwell precisely by George Joye throughStephen Vaughan. State Papers vol. VII, pp. 489 and 516. See also: infra on p. 316 and BC,George Joye, pp. 10104.24 chapter one
sources of information, the website indicates the Papers in Bedfordshire County RecordOffice and original research by Neil Hickman, which I could not verify. 93Helen L. Parish, Clerical Marriage and the English Reformation. Precedent Policy andPractice, (StAndrews), Aldershot, Burlington, Singapore & Sydney: Ashgate, 2000, p. 58.In one way or another, all Reformers were convinced that they were living in apocalyptictimes and interpreted contemporary historical events as signs of the times. See, e.g., PhilipD.W. Krey, Luther and the Apocalypse: Between Christ and History, in Carl E. Braaten &Robert W. Jenson (eds.), The Last Things. Biblical and Theological Perspectives on Eschatol-ogy, Grand Rapids: Eerdmans, 2002, pp. 13545. 94George Joye, The exposicion of Daniel the Prophete gathered oute of Philip Melanch-ton/ Johan Ecolampadius/ Conrade Pellicane & out of Johan Draconite. &c. By George Joye.A prophecye diligently to be noted of al Emprowrs & kinges in these laste dayes, Geneue:G.J. [vere Antwerp, Catherine van Ruremund], 1545. 95George Joye, A contrarye (to a certayne manis) Consultacion: That Adulterers oughtto be punyshed wyth deathe. Wyth the solucions of his argumentes for the contrarye. Madeby George Joye, Prynted at London: By [Steven Mierdman? for] George Joye, [1549] (STC14822). 96For the negative judgement of the majority of scholars on Joye, see infra on pp. 33ff. 97IS ASC Renhold. the tyndalejoye debate in the literature 27
Joyes frequently neglected legacy lies foremost in his Psalters and Prim-ers. These were reprinted in London more than once, and they were usedby later compilers and editors, among them, not unimportantly, ThomasCranmer for the compilation of the Book of Common Prayer. Being themost popular prayerbooks of popular piety, Joyes texts influenced pri-vate Protestant devotion of the early Reformation period (partly throughthe Book of Common Prayer) more than any other publication. Secondly,Joyes legacy can be found in his biblical translations. His translations ofPsalms, Isaiah, Jeremiah, Proverbs, Ecclesiastes, and Lamentations werethe first publications of these books of the Bible ever printed in English.These were perhaps of less poetic value and did not make it into latertranslations in such high proportions as Tyndales did. Nonetheless, someof Joyes wordings were retained or rediscovered in later versions.98 Cov-erdales familiarity with and use of Joyes translations is unquestionable.We also encounter some of his renderings in the Matthew Bible, in theGeneva Bible, and later in the King James Version,99 and even Tyndalehimself followed a number of Joyes alterations to the NT translation.100
Having met the main actors in the debate, let us now briefly introduce thesources of the controversy. The discussion between Tyndale and Joye in Antwerp has five directcontemporary written pieces of evidence, the primary sources of the actualdebate: (1) two letters from 1533 among the State Papers, originally written
98E.g. The expressions sauing helthe (Ps. 67:2), backslide (Jer. 3:6.12.14.22), anda mess of pottage (Prov. 15:17), or the proverb Pryde goth before a fall/ and a fall folowetha proude mynde (Prov. 16:18). It was Joyes translation of Ps. 91:5 (Thou shalt not nede tobe afrayde of nyght bugges) in his first Psalter based on Bucer that originated the famousbugges (bogies), or evil spirits, a peculiar expression, one that was copied by Coverdale(1535) and by Rogers in the Matthew Bible (1537) and survived until the Great Bible (1539).Based on this expression these Bibles are sometimes referred to as the Bugge Bibles.See BC, George Joye, pp. 139, 142, and 145, n. 25. R. Gerald Hobbs, Martin Bucer and theEnglishing of the Psalms: Pseudonymity in the Service of Early English Protestant Piety, inD.F. Wright (ed.), Martin Bucer. Reforming Church and Community, Cambridge: UP, 1994,pp. 16970. 99E.g. Mk. 15:40; Lk. 2:19; Jn. 1:21, 6:23, and 12:25; 1 Cor. 4:3; and Rev. 22:2. See BC, GeorgeJoye, pp. 15960. 100E.g. Lk. 16:2223; Jn. 5:45; 1 Cor. 4:16; and Heb. 13:21. See BC, George Joye, p. 158. Seealso Gergely Juhsz, Antwerp Bible Translations in the King James Bible, in The King JamesBible after Four Hundred Years. Literary, Linguistic and Cultural Influences, eds. HannibalHamlin and Norman W. Jones, Cambridge: UP, 2011, pp. 10023.28 chapter one
A Status Quaestionis
Joyes falling-out with Tyndale has certainly had its consequences on hisreputation, and as a result not only their debate but also George Joyesperson in general have been for the most part ignored by the scholarlyworld. The topic has never been studied satisfactorily. A survey of theliterature available on the issue gives us the opportunity to familiarize thereader with the main stream of scholarship. I have divided the materialinto three sections: (1) the first biographical references by Joyes contem-poraries, (2) the conservative consensus and some exceptions to it, and(3) a shift in the study of Joye.
101 More, The confutacyon of Tyndales answere, sig. Aa4r (CWTM VIII, pp. 78). Cf. sig.Bb2r, cited supra in n. 81 on p. 22. 102Thomas More, The apology of syr Thomas More knight, London: William Rastell, 1533,sig. Dd4v. The following year Joye replied to the accusation, claiming that all he taughtthe child was the Our Father, the Hail Mary, the Creed, and the prayers before and aftermeals. (Joye, The Subuersion of Moris false foundacion, G3v). Joye is also accused by Moreof providing a safe house for apostate nuns in Antwerp: George Iaye or Gee otherwysecalled Clerke, whyche is a preste, and is now for yt wedded in Antwarpe/ into whosehowse there, the two nonnys were brought, which Iohan Byrt otherwyse called Adryanstale out of theyr cloyster to make them harlottes (More, The apology of syr Thomas Moreknight, sig. Dd4v). 103Cf. Edward Halle, The vnion of the two noble and illustre famelies of Lancastre &Yorke, beyng long in continuall discension for the croune of this noble realme: with al theactes done in both the tymes of the princes, both of the one linage & of the other..., London:Rychard Grafton, Prynter to the Kynges Maiestye, 1550, fo. 186v. 104Pollard, Records of the English Bible, p. 131.30 chapter one
105On his life, see Leslie P. Fairfield, John Bale: Mythmaker for the English Reformation,West Lafayette: Purdue UP, 1976; John N. King, English Reformation Literature. The TudorOrigins of the Protestant Tradition, Princeton: Princeton UP, 1982; Peter Happ, John Bale,New York: Twayne, 1996; John N. King, art. John Bale in IS ODNB. 106GEORGIUS IOYE, Bedfordiensis, de domo Petri Cantabrigiae, post liberaliumartiu[m] professione[m] theologicae facultatis bacchalaureus, utraque lingua Latina &Graeca peritus, in Aristotelicis delirijs non consenuit. Sed dum adhuc florenti esset aetate,exorta ueritatis luce, manum admouit caelestis doctrinae aratro. Spiritualem enim & omniex parte synceram Christi philosophiam, ex purissimis Euangeliorum fontibus haurie[n]s, arida multorum corda ea humectabat. Vnde & incommoda nonnulla sub Eboracensitunc Cardinale, Moro, Roffense, atque alijs adhuc Antichristi propugnatoribus pertulit,compulsus tu[m]demum in Germaniam cum alijs plaerisque aufugere. Vbi accepta in Deiuerbo uxore christiana, in toto esse desijt corruptissimi monstri creatura. Varios iste Bib-liorum libros, ac alios christianorum autorum labores, Anglicos nobis dedit. Psalterium exfoelice, li.1. Prouerbia Salomonis, li.1. Ecciesiasten eiusdem, li.1. Esaie uaticinium, li.l. Hier-emiae prophetiam, li.1. Hortulum animae, li.1. Melanthonem de coniugio, li. 1. Zwingliumde religione, li.l. Ex Erasmo quoque, li.1. Composuit in Anglico sermone. Labefactatamecciesiam Mori, li.1. Postquam placuisset pijssimo, Ad priorem de Newenham, li.1. Patrinostro reuenderissimo, Compendium passionis Christi, li.1. Seruator noster Christus inult, Apologiam ad Tyndale, li.l. De coeni domini, li.1. Cum iudisset epulones Christus, Debaptismo & eucharistia, li.1. Quia constat homo ex duabus, Matrimonij defensionem, li.1.Cum populus Dei, Israel voce, Onera caeremoniarum, li.1. Paulus electum uas Dei, Com-mentarios in Danielem, li.l. Haec cum in bruma scriberem, Contra Gardineri articulos, li.1.Quosdam casu articulos inue, Refutationem eorundem, li.1 Intelleges candide lector, quod,Et alia quaedam Praefatam in Danielem expositionem collegit ex Philippo Melanthone,Oecolampadio, Pellicano, Draconite, atque alijs scriptoribus probis. Huiusque perstatfidelis ac robustus ueritatis assertor, cum hostibus Christi fortiter dimicans, anno eiusdemseruaboris nostri (quo haec scripsimus 1548. sub rege Edwardo sexto. (John Bale, Illus-trium majoris Britanniae scriptorum summarium, Ipswich & Wesel: for John Overton, 1548fos. 239v240v.) 107Bale, Illustrium majoris Britanniae scriptorum summarium, fo. 240v. Bale also claimsthat Joye was skilled in Latin and Greek. the tyndalejoye debate in the literature 31
artyrs, the monumental work of John Foxe, entitled Actes and Monu-Mments of these Latter and Perillous Days, touching Matters of the Church.After two Latin martyrologies, Foxe published his first English version ofthe book in 1563.108 Later, three ever-expanding reworkings (1570, 1576,and 1583) by Foxe appeared. The book became a classic during the life-time of the author, shaped the general stance on the Reformation, haslargely contributed to many mis(in)formed Protestant views on theCatholic Church, and has frequently been used as a trustworthy histori-cal source.109 Leaving aside the question of the reliability of Foxes workas a whole, the treatment of Joye by Foxe is not quite adequate.110 Joyenever earned the ambiguous honour of martyrdom and had earlier had adisagreement with Foxe on how adulterous people should be punished.111The information on Joye therefore is only circumstantial and subjective.112Foxe vaguely mentions Tyndales row with Joye in his 1563 edition withoutmentioning Joyes name: After that he [i.e. Tyndale] had finished that woorke, then toke he in hande to conferre the newe testament with the Greake. And that fynyshed and put forth, then was in hand to declare his mynde vpon a place in the newe Testament, where one had altered it, otherwyse then maister Tyndall hadde translated it, or as he sayd was translated by any other translation, in any
has been said, their treatment of Joye as one of the key figures and authorsof the early Reformation period. That Foxe is an exception to this rule canbe explained by his personal agenda based on his own conflict with Joye.Unfortunately, Foxes disregard of Joye has been decisive in creating theconservative consensus on Joye.
119Many books on the early Reformation period or on the history of the English Biblesimply ignore Joye and his translations altogether. A few examples of such otherwise use-ful studies: Richard Simon, Critical Enquiries into the Various Editions of the Bible Printedin Diverse Places and at Several Times Together with Animadversions upon a Small Treatiseof Dr. Isaac Vossius concerning the Oracles of the Sybills. And an Answer to the Late CriticaSacra Written Originally in Latin Translated into English by N.S., London: Tho. Braddyll,1684; H.W. Hoare, The Evolution of the English Bible, London: John Murray, 1902; John V.Madison, English Versions of the New Testament: A Bibliographical List, in JBL 44 (1925),pp. 26188; Hillaire Belloc, How the Reformation Happened, London & Toronto: JonathanCape, 1928; Vernon Faithfull Storr (ed.), The English Bible. Essays by Various Writers, Lon-don: Methuen, 1938; Roland H. Bainton, The Reformation of the Sixteenth Century, Boston:Beacon, 1952; Frederick C. Grant, Translating the Bible, Edinburgh: Nelson, 1961; JoyceYouings, Sixteenth-Century England, (The Pelican Social History of Britain) (11984) Lon-don: Penguin Books, 1991 Euan Cameron, The European Reformation, Oxford: Clarendon,1991; Christopher Hill, The English Bible and the Seventeenth-Century Revolution, London:Allen Lane, 1993; John D. Long, The Bible in English. John Wycliffe and William Tyndale,Lanham, New York & Oxford: UP America, 1998; Diarmaid MacCulloch, The Reformation.A History, New York: Viking, 2004; David Norton, A Textual History of the King James Bible,Cambridge: UP, 2005. The historian Bishop of Salisbury Gilbert Burnet (16431715) refersto Joye only in one sentence: The bishops were much offended at the translations of theNew Testament by Tyndale, Joye, and others; and proceeded severely against those whoread them: yet it was not easy to put a stop to the curiosity and zeal of the people (GilbertBurnet, The History of the Reformation of the Church of England, rev. and ed. NicholasPocock, Oxford: Clarendon, (11680) 1865, p. 128). In his more than 750-pagelong abridge-ment, Burnet mentions only that Tindall and some others at Antwerp, were every Yeareither translating or writing Books against some of the received Errors, and sending themover to England. But his Translation of the New Testament gave the greatest Wound, andwas much complained of by the Clergy, as full of Errors (Gilbert Burnet, The Abridge-ment of the History of the Reformation of the Church of England, London: Ric Chiswell, 1682,p. 126).34 chapter one
120Cf. e.g. Early associate of William Tyndale, who produced a translation of MartinBucers Latin version of the Psalms (1530 and 1534), Isaiah (1531), Jeremiah (1534), Prov-erbs and Ecclesiastes (1535). Except for Proverbs and Ecclesiastes, most of his work wasprinted abroad, probably in Antwerp and such were his relations with Tyndale that it isnot always clear just how much was his. Lacking scholarship and a nicety of taste he hasbeen described as an interesting minor figure in the story of the English Bible. Whenthere was increasing demand for Tyndales Translation some pirate printings took place,often with words altered. Joye was responsible for some of these and Tyndale admonisheshim in the prologue to his revised New Testament 1534 (art. George Joye, in Alec Gilmore,A Dictionary of the English Bible and its Origins, (Biblical Seminar 67), Sheffield: SheffieldAcademic Press, 2000, pp. 9697). 121Gervase E. Duffield, The Work of William Tyndale, Appleford: Sutton CourtenayPress, 1964, p. xxvii. 122IS SwordSearcher. Cf. David Daniell, who dedicates his recent book on the EnglishBible: To the memory of William Tyndale, ?14941536, translator of genius, martyred forgiving English readers the Bible from the original languages (David Daniell, The Bible inEnglish. Its History and Influence, New Haven & London: Yale UP, 2003, p. v). On the com-monly claimed charge that Tyndale was executed for translating the Bible into English,see infra p. 423, esp. n. 638, and Juhsz & Arblaster, Can Translating the Bible Be Bad forYour Health?, pp. 31540. 123Duffield, The Work of William Tyndale, p. xxvii. Cf. Brooke Foss Westcott, AGeneral View of the History of the English Bible, rev. ed. William Aldis Wright, New York:Lemma, 1972, p. 45. 124Duffield, The Work of William Tyndale, pp. xxviixxviii. John Eadie, The EnglishBible. The External and Critical History of the Various Translations of the Scriptures, WithRemarks on the Need for Revising the English New Testament, vol. I, London: Macmillan, 1876,p. 217. the tyndalejoye debate in the literature 35
130Bruce, History of the Bible in English, p. 44. Demaus, William Tyndale, p. 360. 131 Edgar, in his Plain Account for Plain People, plainly claims that George Joye [...]took the liberty of amending the translation in several places. This liberty was keenlyresented by Tyndale, and as it was never graciously apologised for, it was never altogetherforgiven (Edgar, The Bibles of England, p. 72). 132Cf. Anderson, The Annals of The English Bible, vol. I, pp. 133 and 39398; Duffield,The Work of William Tyndale, p. 309. Demaus, William Tyndale, pp. 130 and 376; Parish,art. George Joye in IS ODNB. 133Duffield, The Work of William Tyndale, p. xxviii. Anderson (inaccurately) reproachesJoye for publishing his Apologye after the imprisonment of Tyndale: Though the Apologymade by him to satisfye, if it may be, W. Tyndale, &c., dated the 28th of February, (1535)in itself a contemptible production, became peculiarly offensive, from its being put forthafter our Translator had been actually and at last apprehended, and in prison! (Ander-son, The Annals of The English Bible, vol. I, p. 396. Cf. p. 398). In reality, Tyndale was onlyapprehended in April (or perhaps May) 1535. 134Demaus, William Tyndale, pp. 361362; Mozley, William Tyndale, 1New York: Mac-Millan, 1937, reprWestport: Greenwood, 1971, pp. 26970. Mozley suspects that it was alsoJoye who supplied intimate information about Tyndales plans and secured a copy of Tyn-dales Answer to More for Stephen Vaughan, the English envoy in Antwerp, early in 1531(Mozley, William Tyndale, p. 192). Cf. Vaughans letter to Cromwell dated from Antwerp,25 March 1531, PRO, Cotton MSS, Galba B.x., fos. 78). This, however, presupposes that Joyewas an assistant to Tyndale, of which there is no evidence. On Vaughan, see: Walter CecilRichardson, Stephen Vaughan, Financial Agent of Henry VIII. A Study of Financial Rela-tions with the Low Countries, (Louisiana State University Studies, Social Science Series 3).Baton Rouge: Louisiana State UP, 1953. 135Duffield, The Work of William Tyndale, p. xxviii. Cf. Fry, A Bibliographical Descrip-tion, p. 38. the tyndalejoye debate in the literature 37
the credit brought him, but Tyndale naturally did not like it to be assumedthat he himself had authorized this and similar changes.136 (3) Joye is alsoguilty of such piracy and plagiarism as any modern laws of copyrightwould interdict or punish.137 (4) Joyes greediness financially underminedTyndale by filling the market with a cheaper and inferior translation, andso curtailing the circulation of the new and improved version.138 (5) Joyedid not keep his word and broke the agreement when he published hissecond edition of the NT with his correction and his Apologye. (6) Joyetampered with Tyndales text, and his changes were wilful and out-right corruption of the Bible, juggling with the text of the Scripture.139 It is hardly ever mentioned that Joye translated and published almostone-fourth of the OT that had never been put into print in English before.When these translations are deemed worthy of a footnote or even a lineor two, they are often dismissed with scorn. Eadie, for example, remarksthat Joye had already been attempting a translation from the Latin text,and had published a Psalter at Strasbourg in 1530, the Prophet Isaiah in1531, and Jeremiah in 1534.140 He is keen to observe in a satirical foot-note that Joye describes his version of Isaiah as Isaye speakinge playneEnglissche.141 Joyes intellectual, linguistic, and scholarly capacities are generallyderided. His style as a writer and his erudition are oftentimes the target ofcriticism. He is presented as foolish and ignorant, and he is characterizedas quarrelsome, dishonest, mean, and malicious. By way of illustration,a few excerpts from the mainstream scholarly literature on the EnglishReformation should suffice. According to Duffield, Joye shows himself small-minded, mean andrather hypocritical.142 Anderson sees Joye as rash and incompetent,a man of very inferior calibre, whether in regard to learning or soundjudgment.143 Townley, though uniquely recognizing Joyes erudition, calls
136Bruce, History of the Bible in English, p. 44. Contrary to the general trend, Demausrecognizes that Joye, indeed, took care not to connect Tyndales name with his edition(Demaus, William Tyndale, p. 358). Mozley remarks that Joyes name does not appear inthe book, nor does Tyndales (Mozley, William Tyndale, p. 270). 137Demaus, William Tyndale, p. 359. See also Betteridge, From Prophetic to Apocalyp-tic, p. 218. Bruce, History of the Bible in English, pp. 4344. 138Demaus, William Tyndale, p. 372. Bruce, History of the Bible in English, p. 43. 139Gerald Snare, Reading Tyndales Bible, in Journal of Medieval and Early Modern Stud-ies 35 (2005), p. 300. 140Eadie, The English Bible, p. 217. 141 Eadie, The English Bible, p. 217, n. 2. 142Duffield, The Work of William Tyndale, p. xxix. 143Anderson, The Annals of the English Bible, vol. I, p. 395.38 chapter one
Joyes integrity into question.144 Eadie calls him a careless and unschol-arly editor.145 Joyes alterations betray great weakness of judgement, andfrequently depart widely from the meaning of the original text.146 Joyesbiographers call his style peculiar, idiosyncratic, and parochial: plainly,this is not translation of a high literary excellence, it is crude pioneeringrather.147 It seems that Joye could not do anything right. Before the discoveryof the only complete copy of Tyndales 1526 Worms NT edition, the title ofJoyes NT edition (being an exact copy of Tyndales) is characterized asa pompous and affected title.148 Once the title page was discovered,he was criticized for copying even the title page from Tyndales original.While the tract on The Souper of the Lorde was attributed to Tyndale, itwas described as having a tone reverent in the extreme, and it might havetaught More, had he been more willing to listen, that his antagonist wassomething better than a mere spoiler of the past.149 The work was judgedas too able, too well-written for Joyes pen.150 After Joyes authorship hadbeen demonstrated, it was characterized as a flimsy little tract in com-parison with the sacramental works of Frith and Tyndale.151 ApparentlyThe Souper of the Lorde is either too good or it is just bad enough to havebeen written by Joye.152 He is even held responsible for the lack of uni-formity in the spelling of his name by others: to a footnote alleging Joyesignorance Eadie disdainfully appends: He had a wealth of namesJoye,Jaye, Gee, and More adds, otherwise called Clarke.153
144Though a learned man, he does not appear to have possessed that conscientiousintegrity which would have given Christian dignity to his character; and it is to be regret-ted that while he defended the truth, the truth does not seem to have made him freefrom guile and deception (James Townley, Illustrations of Biblical Literature Exhibitingthe History and Fate of the Sacred Writings from the Earliest Period to the Present Century,Including Biographical Notices of Translators and Other Eminent Biblical Scholars, vol. 2,New York: G. Lane and P.P. Sandford, 1842, p. 96). 145Eadie, The English Bible, vol. I, p. 218. 146W.F. Moulton, The History of the English Bible, London: Charles H. Kelly, s.d.[c.1930], p. 64. 147BC, George Joye, p. 58. Cf. pp. 5960, 7173, 134, 143, and passim. 148Demaus, William Tyndale, p. 359. For other scholars derogatory opinions on Joyestitle, see infra p. 322. 149Mozley, William Tyndale, p. 254. 150James Frederic Mozley, Tyndales Supper of the Lord, in N&Q 183,11 (1942), p. 306. 151 Stephen M. Foley, in CWTM 11, New Haven & London: Yale UP, 1985, p. 36. 152OSullivan, The Authorship of The Supper of the Lord, p. 212. 153Eadie, The English Bible, vol. I, p. 221, n. 1. By way of analogy, Tyndale could bereproached because his name had even more variants: Tindalus in his own autography,Tindal, Tindall, Tyndale, and Tyndal, not to mention Hytchins, Huchyns, and Hochyns. the tyndalejoye debate in the literature 39
154Daniell, William Tyndale, pp. 100 and 192. Daniell does emphasize that Tyndaleused the original Hebrew and Greek texts, which could suggest some awareness of theBible being more than the English Bible. Nonetheless, the importance of the use ofthe original texts seems to be only an element in the canonization of Tyndales work.Characteristically, having detailed the pre-Reformation translations into German, French,Italian, Catalan, Spanish, Portuguese, and Dutch, Daniell goes on to claim that the Churchwould never permit a complete printed New Testament in English from the Greek, becausein that New Testament can be found neither the Seven Sacraments nor the doctrine ofPurgatory, two chief sources of the Churchs power (Daniell, William Tyndale, pp. 9293and 100). But as we have written earlier, setting aside the false suggestion that the Vulgatecontains explicit references to the sacraments and to Purgatory which are absent from theGreek text, it would be interesting to know why the power of the Church would be under-mined by a translation into English but not by translations into the languages of Conti-nental Western Europe. The only plausible explanation is that for Daniell, subconsciouslyat least, the Bible means the English Bible, of which the Greek and Hebrew Scriptures arebut the sources (Juhsz & Arblaster, Can Translating the Bible Be Bad for Your Health?,p. 338). Daniells is not an unusual attitude in the English-speaking world, where somesixty years ago an English newspaper editor could write of the Authorized Version as thesacred English original (quoted by Dorothy L. Sayers, The Man Born to Be King, San Fran-cisco: Ignatius Press, 1990 (1London: Victor Gollancz, 1943), pp. 1213). 155Anderson speaks about Tyndale as having compared the Sacred Text once morewith the Greek (Anderson, The Annals of The English Bible, vol. I, p. 395). Cf. also: Thefact was, that Joye, in his ignorance, was contributing to the corruption of the Sacred Text(Anderson, The Annals of The English Bible, vol. I, p. 396). Later, the King James Versionwill achieve a similar status: Cf. Sayers, The Man Born to Be King, pp. 1213. 156This, of course, does not apply to Tyndale himself. When modern authors see a con-nection between correctness in syntax and use of vocabulary, this is in fact a continuationof Erasmus and the Humanists attitude: correct grammar mirrors and engenders moralrectitude. Cf. Latr, The 1535 Coverdale Bible and its Antwerp Origins, pp. 8991.40 chapter one
provided by Foxe and More (mentioning Joyes Primer without the Litanyand the Dirge and the Psalter).161 He attests that the late Mr HumphreyWanley (16721726), antiquary, dean and chapter of St. Pauls at London,claimed to have seen a fragment which seemed to him to be Part of anentire Bible, and to be older than Coverdales Bible, printed in 1535.162 Lewisproposes the identification of this fragment with the first page of Genesisthat Joye printed at Barrow (Bergen-op-Zoom) and sent to Henry VIIIand Anne Boleyn, according to a letter from Tyndale to Frith publishedin Foxes Actes and Monuments. But Lewis information seems not to beexclusively secondhand: he exhibits an intimate familiarity with a numberof Joyes Antwerp publications. Some of these are described with meticu-lous bibliographical information, and he quotes large portions of them(usually from the prologue). (1) He notes that Joye published a translationof the Book of Isaiah under the pseudonym Balthaser Backneth [sic] withthe (false) printing address of Strasbourg.163 (2) He describes The Psalterof Dauid, imprinted at Argentine, January 16 [1530], by Francis Foye [sic]in 12mo,164 reprints its prologue by Johan Aleph (vere Joye), and explainsthat Feline is the faigned Name Aretius Felinus, which Martin Bucerused for his Latin version of the Psalter of 1526.165 (3) After giving thebibliographical details of Davids Psalter (1534),166 Lewis indicates thatthe Latine out of which Joye translated, was that of Frier Felixs of theOrder of Heremites of St. Austin, which was printed ad 1515 and again 1522.
Bishop Gilbert Burnet suggesting corrections to his History of our Reformation (see supran. 119 on p. 33). Bishop Burnets answer to Thomas Baker about the suggestions dated atWindsor Castle, 23 July 1700, was donated by C.M.P. Johnson, senior bursar in 1980 toSt Johns College Library, Cambridge (St Johns Library, Misc. Box 4, BU3), the very libraryof which the first history was written by the same Thomas Baker (Thomas Baker, Historyof the College of St. John the Evangelist, Cambridge, 2 vols., ed. John E.B. Mayor, Cambridge,1869). The letter was reproduced with an article by N. Long Brown, the original owner ofthe letter, in the magazine of St Johns College, The Eagle, issue XLVI (December 1930),pp. 74ff. Apparently Baker suggested, among other things, additional information on Joye. 161 Lewis, A Complete History of the Several Translations, pp. 7980. 162Lewis, A Complete History of the Several Translations, p. 80. His reference for Wan-leys claim: Biblic. Litera. No. 4. p. 40. On Wanley, see: Peter Heyworth, art. HumfreyWanley in IS ODNB. 163According to Lewis, the book was at that time in the Library of Lord Oxford (Lewis,A Complete History of the Several Translations, p. 78). 164Lewis, A Complete History of the Several Translations, p. 86. He also indicates thatthe book is found in the Public Library, Cambridge with the shelf number A-7-43. Lewisdoes not seem to recognize that the pseudonym Francis Foxe hides Joye. 165Lewis, A Complete History of the Several Translations, p. 87. 166Present at that time in the Public Library, Cambridge under the shelf number A-7-42.Lewis, A Complete History of the Several Translations, p. 87.42 chapter one
In this, Lewis deems Tyndale expresses a great deal too much passion andresentment against Joye, particularly for the manner of his translating theWord Resurrectio.175 The newly added note The dead are ignorant of Godat 1 Pt. 4:6 as a reaction to Joye is also quoted by Lewis.176 Tyndales sec-ond foreword, in its turn, occasioned Joye to write and publish a Vindica-tion of himself. Lewis exhibits thorough knowledge of the contents of theApologye, of which he gives the lengthy title in full.177 The bibliographicaldescription of Tyndales Worms NT edition (1526), for example, is clearlybased on Joyes description in the Apologye, a fact acknowledged by Lewishimself in the reference note.178 But the Complete History includes severalextensive excerpts taken verbatim from the Apologye. Lewis quotes Joyesdescription of the widows persistence, how she tried to persuade him totake the job, and Joyes account of the financial side of their agreement.He also quotes Joyes assertion of the ignorance of the printer about Tyn-dales own revision of the NT and how Joyes words were corroborated byTyndales testimony.179 Finally, Lewis illustrates Joyes effect on Tyndalesthird NT edition (given by Lewis as 1536 instead of 1535): how Tyndalemended the translation of Mt. 1:18 and the gloss upon 1 Jn. 3 according tothe critique and suggestions of Joye.180 Among the modern authors, Henry Cotton (1821) is the first to standout in his treatment of Joye. He enumerates all of the biblical transla-tions by Joye that were known to him in his Editions of the Bible andParts Thereof in English, with numerous excerpts and selections from theworks.181 His short account of the TyndaleJoye controversy is also limitedto mentioning that Tyndale complained heavily of George Joye for alter-ing his translation in many important instances, particularly in rejectingthe word resurrection, and (concealing his own name) still uttering it as
the term, and substituted for it the phrase life after this, which was more in accordancewith his own opinions (Demaus, William Tyndale, p. 360). 189Demaus, William Tyndale, p. 376. 190Demaus, William Tyndale, pp. 37677. 191 Demaus, William Tyndale, p. 377. 192Demaus, William Tyndale, p. 377. 193Demaus, William Tyndale, p. 377. 194Demaus, William Tyndale, pp. 37778.46 chapter one
of Joyes suggestion, Tyndales third and final edition of the NT was pub-lished without notes.195 In 1876 John Eadies The English Bible. The External and Critical His-tory of the Various Translations of the Scriptures appeared in London. He,too, makes an attempt to present Joye and the controversy with Tyndalewith more accuracy. To this end, he tells the story of how Joyes modifi-cations came about and how Tyndale reacted to them, mainly by quot-ing Tyndales and Joyes own words. Eadie quotes extensively both fromJoyes Apologye in modernized spelling and Tyndales second foreword.Unfortunately, Joyes words are mainly used to give the chain of eventswith regard to the circumstances of the surreptitious, badly printed vanRuremund editions, and are heavily commented upon by Eadie.196 Hispresentation of the story leaves the reader in no doubt about whose sideEadie is on: To have wantonly touched and retouched a common treatise without authority was wrong; but it was an act of no common daring so to handle the translation which Tyndale regarded as the labour and crown of his life, on which also rested his critical repute and his means of blessing the English people.197Joyes changes, according to Eadie, were insignificant: Joye did not affixTyndales name to the reprint, though the book was really his with somechanges, none of any value, or suggested by the original, but only insertedto eke out the sense by unneeded and clumsy supplements.198 A couple ofsentences later, however, Eadie does think that Joyes version was differ-ent from Tyndales: the result of his effort is a poor, marred, and dilutedversion.199 The fact that Joye did not spot Tyndales error in Mk. 14:5,where Tyndale had two hundred pence (for the Greek ,Vg: trecentis denariis), proves in the eyes of Eadie that Joye was work-ing carelessly.200 Eadie does accredit Joye with the wish for a pure text
ithout glosses or notes, and in one long paragraph running more thanwtwo pages he focuses on the theological background of the debate. Heclaims that Joye changed the translation of resurrection to life after thisor some similar expression though he retained it in cases where the risingof the body is distinctly intended, as in 1 Corinthians xv, and Philippiansiii.201 Eadies incautious formulation, however, might suggest to the casualreader that these are the exceptions, while on the whole the word resur-rection was as good as blotted out. According to Eadie, the reason behindJoyes modification of the word was his dispute with Tyndale about thenature of the soul-life, between death and resurrection.202 Eadie clarifiesthat Joyes view was the common one, that the souls pass into a higherlife at death.203 This, however, was not disputed by Tyndale, whose ownopinion wavered.204 True, Eadie avows, Tyndale had maintained earlierin his controversy with More that the souls lay dead and were asleep untildoomsday, but Tyndale changed his opinion and his more recent view isin harmony with Scripture, which teaches not simply the immortality ofthe soul, but the immortality of the man.205 This unwarranted assertionof an evolution in Tyndales view of the afterlife creates the basis for anattempt to harmonize the traditional Protestant theology on the escha-thon with some new exegetical approaches of Eadies own time read intoTyndales words. For the biblical view, according to Eadie, lays far morestress on the resurrection than our popular theology supposes; looks onthe separate existence of the soul after death as an insignificant paren-thesis in our existence, and takes almost no notice of it when it is out ofthe physical organism created it. Eadie maintains that an unembodiedspirit, though in the service of the Divine, is always imperfect, regard-less of its brightness or happiness. Perfection and glorification will comeonly on Judgement Day, when nature in all its spheres will be perfectedin Christ, and prepared for, and admitted into everlasting blessedness.206This amalgam of irreconcilable ideas is, in my opinion, a misinterpreta-tion of Tyndales own view. Francis Frys excellent and still indispensable A Bibliographical Descrip-tion of the Editions of the New Testament Tyndales Version in English with
207Francis Fry, A Bibliographical Description. The book was reprinted in June 1999 byGreyden Press. But the reprint contains only the first xxiii + 83 pages out of the originalxxiii + 196 pages + 73 plates. The reprint includes, oddly, the entire table of contents ofthe original work (pp. vviii), despite the fact that almost two thirds of it is not containedin the book! 208Fry, A Bibliographical Description, pp. 3843. Fry was as yet unaware of Joyes sec-ond edition of the NT, which was only discovered in 1905. See infra on p. 48. 209Fry, A Bibliographical Description, pp. 4143. 210 George Joy, An Apology made by George Joy to satisfy, if it may be, W. Tindale. 1535,ed. Edward Arber, Westminster: Archibald Constable, 1882 (further: Arber, Apology). Arberconsequently spells the names of the parties as Tindale and Joy (he points to Tyndalesautograph in his letter from the prison of Vilvoorde, where his signature reads Tindalus,p. 5). (In the University Library of the K. U. Leuven, the book was originally cataloguedunder the name George Joyce.) The book was reprinted in 1895. 211 Arber, Apology, p. vi. 212 Arber, Apology, p. vi. the tyndalejoye debate in the literature 49
and Joye as our Carlstadt, Arber safely passes over to the bibliographi-cal details.213 After a reprint of Tyndales second foreword from his sec-ond NT edition (November 1534), the text of the Apologye is presentedin original spelling and with the original punctuation (e.g. using slashes/ instead of commas). The marginal notes and the running titles arekept and presented at the appropriate places. Wherever Joye abbrevi-ates Tyndales name (T. or Tyn.), the abbreviation is expanded in squarebrackets: T[indale]. Arber silently structures Joyes text into two sections,starting with nicely decorated initial letters A (After that w. Tindale...)and B (But let us now...). Unfortunately, a few mistakes slipped into histranscription.214 Arber introduces half a dozen notes and clarifications, mainly with regard to the dates and explanation of words. He also uses cross-reference page numbers for Joyes quotations from Tyndales second foreword as they are found in Arbers reprint. Although the book appeared in a limited edition (in 1895 it was reissued), it has made it possible for scholars all over the world to form a more founded opinion on the ques- tion by reading Joyes Apologye. In 1905, Alfred W. Pollard published the news about the discoveryof the second edition of the NT with George Joyes alterations.215 In hisarticle Pollard gives a short account of the facts according to the con-servative consensus. He, however, reprints Joyes epilogue in full, mak-ing it available for research for the first time since the 16th century. In1911 another important work appeared in the field of Reformation studies,Pollards Records of the English Bible.216 The book, as its title and subtitleindicate, is a compendium of important documents relating to the historyof the Bible in English. The book contains a seventy-page-long introduc-tion that includes two pages on Joye.217 Nothing is mentioned about hisindividual translations. The facts of controversy are enumerated, but theirinterpretation is debatable.218 More importantly, Pollard publishes manyoriginal documents, and thus makes possible a study of the early English
219 Pollard, Records of the English Bible, pp. 17475 and 17896. 220Henry G. Graham, Where We Got the Bible. Our Debt to the Catholic Church, St Louis:Herder Book, 1911. 221 The passage in the chapter A Deluge of Erroneous Versions is short and entertain-ing enough to quote it in its entirety: So long as Henry made no objection, any printer orpublisher or literary hack, who thought he saw a chance of making a little money out of theventure, would take in hand the publishing of a new version of the Bible. George Joye, forexample, took this course in regard to Tyndales Bible, and in consequence (1535) broughtdown upon himself a volley of bitter and un-Christian reproaches from that worthy who(as I have said before) was a man of uncontrollable temper and scurrilous language whenthwarted or resisted. In reply to this tirade, George Joye published an Apology, in whichhe showed that the printer had paid him only 4 d. for the correction of every 16 leaves,while Tyndale had netted 10 pounds for his work; and besides, he exposed in fine stylethe departure from the truth of which Tyndale had been guilty in boasting of his transla-tion and exposition as if it were his own, whereas Joye shows it was really Luthers all thetime; that Tyndale did not know enough Greek to do it, and had only added fantasies andglosses and notes of his own imagination to the work of others. However, we have no timeto dwell on the quarrels of these amiable Bible translators, else we should never reach theend of our historical review. (IS Graham, Where We Got the Bible.) 222Graham is quite useful for the earlier periods, but the presentation of the Reforma-tion period is less adequate. 223Mozley, William Tyndale, London & New York: SPCK & Macmillan, (11937) repr1971.See also his numerous contributions in Notes and Queries: Mozley, George Joye, or Gee,pp. 25253; Mozley, Tyndales Supper of the Lord in N&Q 183,11 (1942), pp. 30506; JamesFrederic Mozley, Tyndales Supper of the Lord in N&Q 185,3 (1943), p. 87; James FredericMozley, The Supper of the Lord. 1533, in Moreana 10 (1966), pp. 1116. 224Esp. Mozley, William Tyndale, pp. 26884. the tyndalejoye debate in the literature 51
in the debate. He draws attention to the fact that the Reformers denial ofthe validity of the prayers to the saints and, as a consequence, their denialof the saints being already in Heaven, posed a serious question, viz. thequestion of where the departed souls are between death and the resur-rection of the body preceding the day of judgement?225 Tyndale, Moz-ley maintains, claimed ignorance on the issue. More and Joye, however,undoubtedly but mistakenly believed that Tyndales cautious ignorancecame dangerously near to the doctrine that the souls sleep.226 However,for his part Tyndale was no less certain that the belief that the souls arealready in glory in Heaven diminishes the need and the value of the bodilyresurrection.227 Mozley uniquely also presents (and partially reprints inmodern spelling) Joyes letters, the early sources of the controversy. He is,however, incorrect in stating that one of the letters was written by JohnCoke, the secretary of merchant adventurers, who, as Mozley believed,sided with Tyndale on the question. Mozley is also mistaken in believingthat the addressee of that letter was Tyndale.228 He correctly recognizesthat Joye is the author of the letter to Latimer, which is preserved on thesame sheet of paper among the State Papers from the reign of Henry VIIIin the Public Record Office.229 He also quotes at length from Arbersreprint of Joyes Apologye. Nonetheless, Mozleys interpretation of thepeace agreement of the parties is also doubtful.230 This misinterpretationof the treaty gives Mozley the opportunity to claim that Joye not onlydid not respect the agreement when he published his second edition ofJ1535 crowned with a spiteful postscript, but that Joye also withholds allknowledge of this fact from his readers.231 And despite all of the virtuesof his biography, his description of Joyes character, as quoted above, isfar from impartial.232 He judges that the ignorance and levity of [Joyes]attack upon Tyndales translation leave a very bad impression upon the
241 Duffield, The Work of William Tyndale, pp. 30922. The following extracts are con-tained from the apology: III. Joyes Apology (pp. 31618): Apology, p. 2, li. 1 to p. 6, li. 18; IV.Joyes Explanation (pp. 31822): Apology, p. 38, li. 5 to p. 45, li. 25. 242Duffield, The Work of William Tyndale, pp. xxviiixxix. 243Duffield, The Work of William Tyndale, p. xxix. 244Duffield, The Work of William Tyndale, p. xxix. 245Gervase E. Duffield, First Psalter Printed in English (Bucer-Joye) Psalter, in Church-man 85 (1971), pp. 29193. 246The Psalter of David, ed. Aretius Felinus (Martin Bucer) 1530, introd. by GervaseE. Duffield (Courtenay Facsimile 1) Appleford: Sutton Courtenay Press, 1971 [hereafter:Duffield, Psalter of David]. Unfortunately, the publication was limited to only 250 copies. 247Duffield, Psalter of David, p. 15. 248Duffield, Psalter of David, p. 17.54 chapter one
from that of his latest book.249 He has also written several articles andstudies where the controversy is mentioned.250 (1) Daniells view in hisTyndale biography and his studies corresponds to the conservative con-sensus as described above. These works are marked with tendentious-ness and a lack of historical insight. He presents Joye as a quarrelsome,imprudent, dim-witted person who irritated everyone and was the causeof schisms within the early English Protestant community.251 According toDaniell, Joye was a second-rate editor with foolish philosophy and gener-ally bad work, who with his tinkering threatened the harmony and unityof the Scripture, the very foundation of reformist thought.252 (2) In hisrecent book on the history of the English Bible, however, Daniells treat-ment of Joye is somewhat different.253 Daniell, probably influenced by thenew scholarly approaches to Joye, presents a less partial picture of him.Joye is no longer ignorant but is introduced to the reader as an Englishscholar living in Antwerp.254 The debate itself is summarized in four orfive concise sentences, and the wording is much less derogatory than inhis earlier studies.255 In the next chapter (somewhat misleadingly called
After Tyndale), Daniell devotes a section to Joye and Roy, where Joyereceives a much fairer handling.256 According to Daniell, early on he [i.e.Joye] showed a certain gift with trenchant English.257 Joye is creditedfor his OT translation, for the publication of his Primer, and for coiningthe expressions saving health and backslide.258 Daniell points out thatJoye was an innovator in that all the books he translated into Englishhad not been touched by Tyndale.259 Daniell even acknowledges, to acertain degree, Coverdales indebtedness to Joye.260 Nonetheless, Joyestranslational strategy is summarized by Daniell as he was not trying forany literal accuracy, and he liked to fill out the text with words and ideasof his own.261 And strangely, after having underlined that Joyes transla-tions and his Primer were the first ever put into print in English, Daniellstates that Joye did not break new ground.262 He also believes that hadJoye been able to translate into English an entire Bible, it would have beeninadequate.263 Even so, Daniell admits that Joyes translations certainlyfilled a gap, and there are moments in them which have merit, and asa sign of goodwill he concludes his treatment of Joye by allowing thatwhatever his personal faults, Joye did endure two long and difficult exilesfor his religion.264
The Bible in English, p. 151). He does not give any further details as to why and how theResurrection (apparently he still has not realized that the debate was not on resurrection)was debated, and why it aggravated Joyes crime. 256Daniell, The Bible in English, pp. 16768. 257Daniell, The Bible in English, p. 167. 258Daniell, The Bible in English, p. 167. 259Daniell, The Bible in English, pp. 16768. 260Daniell, The Bible in English, p. 168. 261 Daniell, The Bible in English, p. 167. 262Daniell, The Bible in English, p. 167. 263Daniell, The Bible in English, p. 168. 264Daniell, The Bible in English, p. 168. 265The first short study was perhaps by L.A. Sheppard, who published a short bib-liographical description of Joyes Ortulus anime. L.A. Sheppard, The Hortulus Animae inEnglish, 1530, in The Library s5-VI, 34 (1951), pp. 10915.56 chapter one
perspective on Joye and his works during the last decades of the previ-ous century. Scholars became interested in the person and the writingsof Joye, regardless or independently of his quarrel with Tyndale. Joye(re)gained more and more recognition as an important figure of the firstdecades of the English Reformation. These new studies coexisted with theestablished, conservative consensus, on which they have exercised verylittle effect.
textual changes made by Joye are very useful, Joyes reasons for alter-ing Tyndales resurreccion are less than satisfactory. Joyes convictionabout the fate of the souls of the saved is seen as amounting almost toan obsession.272 Joye was advancing one of his own theological viewswhen he wilfully mistranslated an important word. And to make mat-ters even worse, by not acknowledging the translation as his own [Joye]had fathered the mistranslation upon Tyndale.273 The biography claimsthat Neither etymologically nor historically was there authority for Joyesfigurative rendering the life after death. Joyes chief offencethe only onewhich Tyndale could not condonewas an offence against theologicaland biblical scholarship.274 The Apologye is described as intemperate,marred by repetitiousness and incoherence.275 And according to thebiography, Joye does not succeed in vindicating himself against Tyndaleschargeshow could he? The other chapters of the book, in spite of anumber of historical and interpretative flaws, are more useful and creditJoyes works with some of their merits.276 The book contains ample analy-sis of Joyes scriptural translations and excerpts from them.
William ClebschWilliam Clebschs study on Englands Earliest Protestants represents alandmark in Reformation studies.277 Although his treatment of Tyndalehas frequently been the subject of criticism for being too one-sided dueto Clebschs stress on Tyndales dependence on Luther, the book is stillindispensable.278 Chapter 12 in the book is entitled The Practical Piety ofGeorge Joye, and it is probably the most sympathetic lengthy treatmentof Joye the Protestant author has ever received.279 Clebsch presents a
detailed biography of Joye listing and describing his literary activities. Thefirst section examines Joyes biblical translations and his Primers. Clebschemphasizes the neglected but profound influence Joye exercised on thereligious practice of the early Protestant community with his transla-tions of the prophets, the Psalter, and his Primers: Joye compiled the firstprinted English primer with such skill that it set the standard for thesebooks for at least a decade and a half, and its influence continued through-out the first Reformation generation [...] Joye earned credit as a shaper ofEnglish Protestant religiosity.280 Clebsch also underlines the importanceof Joyes choice of the biblical books to be translated: the Psalms and theprophetic books, upon which in every age Christians have centered per-sonal and family, as well as monastic, devotion.281 Joyes first translationof the Psalms lodged itself in various English primers of the 1530s andstamped its verbiage on the minds and souls of Protestants who prayedby these books.282 Joyes second Psalter was no less influential, for nofewer than thirty-eight individual psalms from this version were quoteddirectly in Robert Redmans Prayer of the Bible, printed early in 1535.283Clebsch points out that Joye, unlike Tyndale, never specified certain partsand themes of the Bible as keys to unlock the whole.284 He always heldthat the common reader should feed his soul on scriptural and devotionalmaterials with minimal assistance from translator or editor.285 The second section in Clebschs chapter on Joye is a comprehensiveand accurate presentation of Joyes theology in his various tracts. Clebschaptly shows how Joye adopted and defended the Zwinglian view onvarious theological topics ranging from the Zwinglian notion of doublejustification to his views on the Lords Supper.286 The final section in the chapter on Joye is Clebschs innovative presen-tation of the TyndaleJoye debate. Clebsch relates the events objectively.He identifies the theological roots of the debate correctly: the state of thesouls departed: did resurrection of the dead with their bodies await the lasttrumpets call, or were the souls of the faithful departed already livinga resurrected life?287 This question, as he pointed out, had slumbered
Joye cut close to the bone with the prayer God forbyd that T. shuldeso thinke of hymself/ that he hathe so exquysitly/ (ye and that at firste)translated the testament that yt cannot be mended.297 Clebsch high-lights how Joye pleaded against Tyndale that a variety of scriptural inter-pretations was necessary and desirable,298 and that he genuinely hopedthat Tyndale would overcome the notion that the Holy Ghost spoke inhis own translation.299 As there was no sign of Tyndales promised revi-sion, Joye justly accused Tyndale of having slept from 1526 to 1534 withrespect to the New Testament project; he was sincere when he declaredthat he only sought to eliminate the misprints and to clarify some pointsof misunderstanding, and was acting correctly when he did not append hisname to what was essentially Tyndales work, lest he be guilty of the veryvainglory of which Tyndale accused him.300 Tyndales second foreword,Clebsch points out, was perceived as feigning humility and charity whileactually castigating a former friend.301 Clebsch contrasts Tyndales praiseof his own works with Joyes crediting their literal accuracy to Frith andLuther.302 He contrasts Tyndales worry that someone would steal awayhis glory and the name of his translation with Joyes yearning for the daywhen other men would edit all the early translations into versions of thefull English Bible.303 Finally, the reception of Joyes embittered style isset in sharp contrast to the reception of similar sentiments exhibited byTyndale during their debate: Joye wrote in the bitterness of personal controversy with a former friend, and confessed it; modern commentators have roundly blamed him for it. Joye pointed out that Tyndale had written in the same bitterness, and had struck the first blow; Tyndales biographers have absolved him. In fact, Joye was not without fault. Neither was Tyndale.304In a similar vein he observes the incorrect treatment Joye has receivedin the scholarly literature: modern writers have bent upon magnifyingTyndale, often by minifying his associates. Joyes accusations against Tyn-dale have been written off as the fulminations of a near crank against an
always patient and godly man.305 Clebschs final conclusion with regardto Joye is that Like him or not, the man translated into acceptable and influential English much of the Old Testament: Psalms, Proverbs, Ecclesiastes, Song of Solo- mon, Isaiah, Jeremiah, and Lamentations; all these he was the first to put into modern English, maybe also Job. He neither knew nor claimed to know Hebrew well, working usually from some Reformation Latin version. Both Rogers and Coverdale incorporated parts of his work into their complete Bibles, although Joye was not a major source of either editor. He worked on those parts of scripture to which Tyndales efforts did not extend. But his chief interest was to provide English Protestants with usable books of devotion. On that ground he recommended the prophetic and wisdom lit- erature which he translated, and to that purpose he compiled the first Prot- estant devotional manuals in English. Theologically clever but not profound, polemically strident but effective, Joye left a legacy that enriched the piety and shaped the worship of English Christians. He eluded martyrdom under Henry VIII, unlike Tyndale, Frith, and Barnes. So did Cranmer, Latimer and Ridley, but they became martyrs under Mary Tudor. Joye died an apparently natural death, in an age when to do so was, for leaders of English religion, unheroic.306Clebsch unmistakably sets a new tone on appreciation of Joye. Throughhis equitable analysis of Joyes Primers and his Psalms translations as wellas their effects on the newborn Protestant piety, he draws attention to thepre-eminence of Joye in making possible and fundamentally shaping theEnglish evangelical devotion. He examines the cardinal points of Joyesevangelical theology and demonstrates their predominantly Zwinglianorigins. His original, unbiased account of Joyes dealings with Tyndalesheds new light on their debate. He shows how Joyes personal argumentsagainst Tyndale are corroborated by Tyndales own writings and howJoyes Apologye was an able defence. It is only a pity that Clebsch pays solittle attention to Joyes arguments concerning the heart of the matter.
Recent StudiesThe new assessment of Joye proposed by Butterworth, Chester, and, mostimportantly, Clebsch has apparently induced other writers to produce aseries of other studies dedicated to Joye. A commonly studied topic is theauthorship of The Souper of the Lorde, with contributions made in almost
every decade since the 1940s.307 The increasing scholarly interest in Joyesown works, translations, and devotional and polemical writings goes handin hand with a growing appreciation of his oeuvre and recognition of hisimportance among the early Reformers. In the 1970s and 1980s Rainer Pineas published a number of articles onJoye.308 His main interest was Joyes controversy with More (Pineas hadpreviously studied the MoreTyndale controversy) and with Catholics ingeneral. Pineas shows how, with his oratorical skills and wide culturalbackground, Joye could use almost anything as an argument in a contro-versy. And although Pineas condemns Joyes practice to put the trwth[truth] in the texti.e. using hyponyms and hyperonyms, and insertingexplicatory remarks in the text for his readers (for Pineas this is corrupt-ing the text)he points out how successful Joye was in advancing thecause of the Reformation with his polemical writings.309 In a volume on Martin Bucer (1994), Gerald Hobbs studied the use ofBucers Psalters in two English biblical translations: in Joyes first transla-tion of the Psalms published in 1530, and in John Rogers emendationsof the Coverdale Psalms in the Matthew Bible of 1537.310 According toHobbs, Joye translated Bucers text according to Bucers own principle, viz.
307Even before Clebschs publication, the topic had been studied by Mozley (and someother Tyndale scholars) in order to prove Tyndales authorship. The most important con-tributions were: Mozley, Tyndales Supper of the Lord in N&Q 183,11 (1942), pp. 30506;Mozley, Tyndales Supper of the Lord in N&Q 185,3 (1943), p. 87; Clebsch, More EvidenceThat George Joye Wrote the Souper of the Lorde, pp. 6366; Mozley, The Supper of the Lord.1533, pp. 1116; M. Anderegg, The Probable Author of The Souper of the Lorde: George Joye,in Thomas More, The Answer to a Poisoned Book, eds. S.M. Foley & C.H. Miller (CWTM11), New Haven & London: Yale UP, 1985, pp. 34374; C. Davies & J. Facey, A Reforma-tion Dilemma. John Foxe and the Problem of Discipline, in JEH 39 (1988), pp. 3765; RainerPineas, Polemical Technique in Thomas Mores The Answere to the Poysoned Booke, inMoreana 100 (1989), pp. 385393; OSullivan, The Authorship of The Supper of the Lord,pp. 20732. 308Rainer Pineas, George Joyes Polemical Use of History in his Controversy with StephenGardiner, in Nederlands Archief voor Kerkgeschiedenis 55 (1974), pp. 2131; Rainer Pineas,George Joye: Exposicion of Daniel, in RQ 28 (1975), pp. 33242; Rainer Pineas, George JoyesUse of Rhetoric and Logic as Weapons of Religious Controversy, in Essays in Literature 2(1975), pp. 1023; Rainer Pineas, Thomas More as an Anti-Catholic Weapon in ProtestantPolemics, in Moreana 18, 70 (1981), pp. 4548. See also his works on the TyndaleMore con-troversy: Rainer Pineas, Thomas More and Tudor Polemics, Bloomington: Indiana UP, 1968;Pineas, Polemical Technique, pp. 38593; Rainer Pineas, The Answer to a Poisoned Book,in RQ 40 (1987), pp. 11618. Further: Rainer Pineas, John Bales Nondramatic Works of Reli-gious Controversy, in Studies in the Renaissance 9 (1962), pp. 21833; Rainer Pineas, WilliamTyndales Influence on John Bales Polemical Use of History, in ARg 53 (1962), pp. 7996. 309On Joyes translational strategy, see infra on pp. 414ff. 310 Hobbs, Martin Bucer and the Englishing of the Psalms, pp. 16175. I have contactedProf. Hobbs via e-mail asking for some clarifications and help with regard to Joyes depen-dence on Bucer, but to my regret, he was reluctant to help and directed me only to this the tyndalejoye debate in the literature 63
article, which, as I had indicated to him, was already known to me. He also warned menot to take Joye too seriously. 311Hobbs, Martin Bucer and the Englishing of the Psalms, p. 167. 312Hobbs, Martin Bucer and the Englishing of the Psalms, pp. 16669. See also GeraldHobbs, Exegetical Projects and Problems. A New Look at an Undated Letter from Bucer toZwingli, in Edward J. Furcha, H. Wayne Pipkin & Jean and Dikran Hadidian, Prophet, Pas-tor, Protestant. The Work of Huldrych Zwingli after Five Hundred Years, (Pittsburgh Theo-logical Monographs-New Series), Allison Park: Pickwick Publications, 1984, pp. 89107. 313Hobbs, Martin Bucer and the Englishing of the Psalms, p. 167. 314Hobbs, Martin Bucer and the Englishing of the Psalms, p. 172. 315Hobbs, Martin Bucer and the Englishing of the Psalms, p. 173. 316OSullivan, The Authorship of The Supper of the Lord, pp. 20732. 317OSullivan, The Authorship of The Supper of the Lord, pp. 20911. 318The fact that she misinterprets Thomas Mores Catholic vision (among other thingson Sacred Tradition) does not take away from the validity of her arguments. Cf. OSullivan,The Authorship of The Supper of the Lord, p. 216. 319Orlaith OSullivan, The Bible Translations of George Joye, in OSullivan, The Bibleas Book, pp. 2538.64 chapter one
320Gordon Jackson, Surprised by Joye. Parallel Selections from George Joyes Two Psal-ters, Lincoln: Asgill, 1998. Jackson used Joyes 1530 translation from Bucers Latin text (withvariants in square brackets from the 1542 reprint) and the 1534 translation from ZwinglisLatin text. 321 Jackson, Surprised by Joye, p. vi. 322Jackson, Surprised by Joye, p. vi. 323Jackson, Surprised by Joye, p. vi. 324Claire Cross, No Continuing City: Exiles in the English Reformation 15201570, in His-tory Review 32 (1998), pp. 1722. 325Cross, No Continuing City, pp. 1718. 326Cross, No Continuing City, 18. 327HParish, Clerical Marriage and the English Reformation, passim, esp. pp. 5759 and13135. 328Vivienne Westbrook, Long Travail and Great Paynes. A Politics of Reformation Revi-sion, (Studies in Early Modern Religious Reforms 1), London: Kluwer Academic, 2001. the tyndalejoye debate in the literature 65
John Bale counted him among the most illustrious writers of Britain.Joyes 1530 Psalter (based on Bucer) was reprinted in 1534 in London byThomas Godfrey, who also (re)printed Joyes translation of Proverbs andEcclesiastes in the same year. The Psalter was reprinted again as late as1541. His Primers were taken as a model for later devotional books andshaped the language and the praxis of Protestant piety more than anyother book (partly through the Book of Common Prayer). Rogers andCoverdale deemed Joyes translation useful for their own edition of theBible, and Coverdale retained a considerable portion of Joyes renderings.Even Tyndales third NT edition contains wordings from Joyes NT. Joyespersonal adversary John Foxe recognized the importance and effect of hiswritings. The evaluation of Joye has undergone a major change in the secondhalf of the 20th century. In the last few decades, there has been a renewedinterest in studying Joyes achievements independently of his quarrelwith Tyndale. His works and person have become the subject of schol-arly research. Some of his polemical writings have received the attentionof scholars like Pineas and Parish, but his debate with Tyndale and theApologye remains neglected. Even his biographers and Clebsch are cur-sory on the topic, concentrating on circumstantial evidence rather thanon Joyes real arguments.331 This study fills the gap in the new interest inJoye by presenting an original view of the TyndaleJoye debate based onfirst-hand evidence available from Joyes Apologye and placing it into itsproper historical and theological context.
1.A clear bias in favour of Tyndale and against Joye. This can go as far as completely ignoring (or being ignorant of) the Joye sources.
331Cf. Parishs remark: The works of Protestant and Catholic polemicists in the mid-Tudor period often receive superficial treatment in biographies of the authors, wherepolemical writings are glossed over as embarrassing lapses into populism (Parish, Cleri-cal Marriage and the English Reformation, pp. 56). the tyndalejoye debate in the literature 67
Clearly, the first and the last points are the result of a subjective attitudeand are closely related to each other. Apparantly Tyndale has achievedsome kind of an infallible, saintly status in his treatment by some scholars.By trying to ignore or condone what they would see as Tyndales shortcom-ings (especially Tyndales attitude in the debate with Joye), these authorsimplicitly canonize the Apostle of Britain and the Father of the EnglishBible. These authors give the impression that they feel that acknowledg-ing facts that could be interpreted as human weaknesses would somehowdiminish Tyndales achievements. Accordingly, the veneration of Tyndaleby these writers is explicitly hagiographic, rather similar to that of theBlessed Virgin in the Catholic Church, or even that of Christ: a personwithout blemish, incapable of doing anything wrong.332 This, in the prac-tice of some writers, has to be emphasized by passing a negative judge-ment on Joyes personality. The other points, however, are of an objective kind and are shortcom-ings that result in an anachronistic, chronocentric, and uneven view ofthe controversy. Consequently, in order not to fall into the same trap, therelevant theological issues and the general historical and theological con-text of the controversy, especially the quest of Christians to grasp theissues of an existence after this earthly life, will form the background ofmy presentation of the Joye-Tyndale debate. Accordingly, in the second chapter I present a short historical overviewabout how the post-mortem fate of the human person has been conceived
332It is no accident that he is sometimes compared to Jesus. Cf. The Lord Jesus wasbetrayed by a man who was supposed to be his friend, and the same thing happened to Tyn-dale. Tyndales Judas was a man named Phillips, a man Tyndale trusted, believing that hewas faithful and true (IS The Book of Books. A General Introduction to the Bible, Chapter 13.How We Got Our Bible). They had, of course, reckoned without Phillips, who had, Judas-like, shared the sop with Tyndale at supper-time (Daniell, William Tyndale, p. 366).68 chapter one
throughout the centuries. The scope of this work limits our possibilitieswith regard to the scale and details of this survey. Therefore, I have torestrict my survey to the extent that these concepts have been relevantand effective to my principal theme, namely, the TyndaleJoye contro-versy. Only major influential ideas are treated, and only to the degree thatthey bear relevance to the controversy. It is therefore not my intentionto present an up-to-date evaluation on the subjects treated, but rather toshow how they were conceived in the 16th century. The immensity of theavailable data on the issue makes it virtually impossible to accomplishthoroughness. Nor is it possible within the present work to examine thedevelopment of these ideas, how they influenced each other, and whatthe present-day scholarly evaluation of these is. The sole purpose of theinitial historical overview is to present the main concepts that have playeda role in the debate, in the form they were understood at the time ofthe debate. Chapter three concentrates on the quest for an understanding of after-life issues in the 16th century, the immediate historico-theological contextof the debate between Tyndale and Joye. I present the interpretative solu-tions to the problems of translation of the NT texts and how they causeddogmatic disagreements at the dawn of the early Reformation period.I present the ideas of, among others, Wessel Gansfort, Desiderius Erasmusof Rotterdam, Jacques Lefvre dtaples, Martin Luther, Andreas Boden-stein of Karlstadt, Gerhard Westerburg, Philipp Melanchthon, HuldrychZwingli, Martin Bucer, Bartholomus Westheimer, Heinrich Bullinger,and Thomas More. Here, too, the principles of reference and relevanceto the TyndaleJoye controversy are primordial in selecting and present-ing the material. My main focus is the contextualization of the TyndaleJoye controversy in its immediate religious and exegetical context of theearly 16th century as it was understood by the parties, and not the pre-sentation of a modern scholarly evaluation on the various authors. I showthat not only was the question of soul sleep vs. immortality of the soul amuch debated issue at the time, but also that many beliefs concerning apost-mortem existence were called into question, and that it is against thisbackground that the TyndaleJoye debate has to be understood. Thesequestions have never been studied with regard to the TyndaleJoye con-troversy. Nonetheless, as I demonstrate, most of these theological workshad a direct influence on the debate, and Joye explicitly refers to many ofthem in his Apologye. Although it may seem circumstantial, occasionallyI pay some attention to a number of personal arguments, subjective com-ments, ad hominem charges, and polemical remarks in various debates on the tyndalejoye debate in the literature 69
this subject at the time of Tyndale and Joye. These are given as samples ofthe language and style of the contemporary way of debating such issues,to familiarize the reader with the tone of such debates at that time inorder to enable him or her to make a better assessment of arguments ofthe kind that were used in the TyndaleJoye debate and help the reader toplace Tyndales and Joyes very similar notes of harsh accusation in theirwider context. The fourth chapter treats the actual controversy between Tyndale andJoye. I present Tyndales translational strategy in his NT editions. I discussthe earliest traces of the controversy preserved only in manuscript form(Joyes letter to Hugh Latimer under the name of John Coke, interceptedby a spy of Cromwell). In this letter Joye already points to his exegeti-cal arguments on the subject. I present the circumstances that led to thepublication of Tyndales NT with Joyes corrections and the actual varia-tions he brought about in the work. I examine Tyndales unfriendly letterprinted in his second NT edition. Based on the available evidence I recon-struct an original and plausible scenario for the documented attempt toreach a concord between Tyndale and Joye and how it was doomed to fail.I describe briefly Joyes second NT revision with its concluding remarks onthe debated issue. I present a detailed study of Joyes Apologye, in whichthe following aspects are treated: (1) Joyes non-theological arguments;(2) Joyes theological arguments: the belief of the Sadducees, Joyes under-standing of the term resurrection in passages where he altered Tyndalestranslation, Joyes understanding of the term resurrection in passages thatare left unaltered, and Joyes other exegetical arguments; (3) Joyes schol-arship and use of sources; and (4) Joyes style and translational strategy. As most of my research in the third and the fourth chapters is basedon primary sources, I will not often refer to the secondary literature thathappens to mention the same topic for a different purpose. Naturally, allideas, concepts, and insights originating from others are duly credited. Mysomewhat extended study of the status quaestionis spares me also fromreflecting in too repetitive a fashion on the difference between my find-ings and those resulting from approaches previously taken. Nevertheless,when this is relevant for a better understanding of my argument, I willmake references to the opinions of other scholars. Finally, a word on transcribing the source material. I have kept theoriginal spelling everywhere, but I resolved all abbreviations except (for), the & sign (for et or and), and superscript e-s in German (e.g. geho rt).Supplied letters are italicized or put within square brackets (e.g. a[n]dfor d). CHAPTER TWO
Is death the definitive end of human life? If not, what happens to thehuman being after death? These questions have always fascinated human-kind. As there is no uncontested first-hand information available, theanswer to them has to be based on traditions, beliefs, and human reason-ing. Developing and revising previous ideas, every age and every genera-tion have tried to formulate and reformulate an answer in the languageand paradigm of its own time. The 16th-century interest in these subjects isthus neither exceptional nor without precedent. In order to illustrate andposition the debate between Tyndale and Joye on the fate of the dead,and its broader ideological context within the 16th century, I include herea brief birds-eye view of the eschatological ideas that have influenced thedebate. The problem of post-mortem existence had occupied some of the atten-tion of the Greco-Roman world as well. In pagan Antiquity, no universallyprescribed dogmatic position was held with regard to the post-mortemexistence of the human being, and therefore several, sometimes contra-dictory theories were postulated propagating the transmigration of thesouls (metempsychosis) and/or personal immortality.1 These ranged from
1On the Greco-Roman views on afterlife, see: Franz Cumont, After-life in Roman Pagan-ism, New York: Dover, 1959; Francis R. Walton, art. After-life, in Nicholas Geoffrey Lem-prire Hammond & Howard Hayes Scullard (eds.), Oxford Classical Dictionary, Oxford:Clarendon, 21979, pp. 2324; Robert Garland, The Greek Way of Death, Ithaca: Cornell UP,1985; Alexander J.M. Wedderburn, Baptism and Resurrection. Studies in Pauline Theologyagainst Its Greco-Roman Background, (WUNT 44), Tbingen: J.C.B. Mohr Siebeck, 1987,especially pp. 181210; Segal, Life after Death. A History of the Afterlife in the Religions of theWest, New York: Doubleday, 2004, pp. 20447; Jan N. Bremmer, The Early Greek Concept ofSoul, Princeton: UP, 1987; Sarah Iles Johnson, Hekate Soteira. A Study of Hekates Roles inChaldean Oracles and Related Literature, (American Classical Studies 21), Atlanta: ScholarsPress, 1990; Peter G. Bolt, Life, Death and the Afterlife in the Greco-Roman World, in RichardN. Longnecker (ed.), Life in the Face of Death. The Resurrection Message of the New Testa-ment, Grand Rapids: Eerdmans, 1991; Jan N. Bremmer, Greek Religion, (Greece and Rome.New Surveys in the Classics 24), Oxford: UP, 1994; Christiane Sourvinou-Inwood, Read-ing Greek Death to the End of the Classical Period, Oxford: Clarendon, 1995; N. ClaytonCroy, Hellenistic Philosophies and the Preaching of the Resurrection (Acts 17:18, 32), in NT39 (1997), pp. 2129, esp. p. 29; Sarah Iles Johnson, Restless Dead. Encounters between theLiving and the Dead in Ancient Greece, Berkeley: UP California, 1999.
(1) the early Elysian fields of the blessed and (2) the democratic Homericview of a common for everyone, through (3) the Orphic and Platonicclear-cut dualism (claiming that the soul, imprisoned in the body in life, isset free by death only to be reincarnated in another body until it is com-pletely purified) and (4) the Aristotelian hylomorphism (proposing some-what dubiously the immortality of active intellect, the intellectus agensof the later commentaries), to (5) Stoic ambiguity on the subject (gen-erally allowing for a temporal survival of the soul until the cataclysmalConflagration () and (6) Epicurean monist materialism denyingall possibility of the survival of the person. Early Christian theology wasprobably most influenced by (7) Neo-Platonism, with its interest in divineemanations and a strong ethical dualism coupled with the metaphysical.In pagan Antiquity, the idea of a once-and-for-all resurrection of the bodyfor eternal life is absent.
2On afterlife beliefs in ancient Israel, the Hebrew Bible and Judaism, see: AlexanderHeidel, The Gilgamesh Epic and Old Testament Parallels, (Phoenix Books 136), Chicago:UP, 1963; Oscar Cullmann, Harry Austryn Wolfson, Werner Jaeger & Krister Stendahl,Immortality and Resurrection, New York: Macmillan, 1965; Nicholas J. Tromp, Primitive Con-ceptions of Death in the Nether World in the Old Testament, Rome: Pontifical Biblical Institute,1969; George W.E. Nickelsburg. Resurrection, Immortality and Eternal Life in lntertestamen-tal Judaism, (HTS 26), Cambridge (MA): Harvard UP, 1972; Klaas Spronk, Beatific Afterlife inAncient Israel and in the Ancient Near East, NeukirchenVluyn: Neukirchener, 1986; BruceVawter, Intimations of Immortality and the Old Testament, in JBL 91 (1972), pp. 15871; JohnF.A. Sawyer, Hebrew Words for the Resurrection of the Dead, in VT 23 (1973), pp. 21834;Theodore J. Lewis, The Cults of the Dead in Ancient Israel and Ugarit, (Harvard SemiticMonographs 39); Atlanta: Scholars Press, 1989; Elizabeth M. Bloch-Smith, The Cult ofthe Dead in Judah. Interpreting the Material Remains, in JBL 111 (1992), pp. 21324; Mark S.Smith, The Invocation of Deceased Ancestors in Psalm 49:12c, in JBL 112 (1993), pp. 10507;mile Puech, La croyance des Essniens en la vie future: immortalit, rsurrection, vie ter-nelle? Histoire dune croyance dans le judasme ancien, 2 vols. (tudes bibliques. N.S. 2122),Paris: Lecoffre, 1993; Brian B. Schmidt, Israels Beneficent Dead. Ancestor Cult and Necro-mancy in Ancient Israelite Religion and Tradition, (Forschungen zum Alten Testament 11),Tbingen: J.C.B. Mohr (Paul Siebeck), 1994; Christian Herrmann, Unsterblichkeit der Seeledurch Auferstehung. Studien zu den anthropologischen Implikationen der Eschatologie,(FsTh 83), Gttingen: V&R, 1997; Segal, Life after Death; Casey D. Elledge, Life afterDeath in Early Judaism, (WUNT 2. Reihe 208), Tbingen: Mohr, 2006; David C. Mitchell, post-mortem existence prior to the reformation 73
God Will Redeem My Soul from Sheol. The Psalms of the Sons of Korah, in JSOT 30 (2006),pp. 36584. See also the literature infra in n. 11 on p. 76. 3See infra on pp. 218ff and p. 268.74 chapter two
4Enoch and Elijah are possible exceptions. Of Enoch, the genealogy in Gen. 5:24does not say that he died but he was not, for God took him. Elijah is recorded to havebeen taken to Heaven in a chariot of fire (2 Kgs. 2). Both of them were assumed tohave been taken into Heaven in their bodily form. 5For more on the meaning and usage of , see: art. shel; in TWAT; PhilipJohnston, Shades of Sheol. Death and Afterlife in the Old Testament, Leicester: Apollos,2002; Mitchell, God Will Redeem My Soul from Sheol, pp. 36584. 6Isaiah 19:3 testifies to the Egyptian practice of necromancy. Isaiah rebukes the Jewsfor practicing necromancy in Is. 8:19; 19:3; 29:4. Manasseh is reported to have practiced post-mortem existence prior to the reformation 75
necromancy in 2 Kgs. 21:6 and 2 Chron. 33:6. The reality of the apparition was sometimesdisputed (e.g. by Jerome) or attributed to the devil (e.g. Basil, Gregory of Nissa, Tertullian).But Josephus Flavius and the majority of the Church Fathers accepted it as real (e.g. Justin,Origen, Ambrose, Augustine). See art. necromancy in IS CE. 7In contrast, Eccl. 2:14 seems to confirm the forsakenness of the souls, much like insome of the texts referring to the dead in . 8On the theology of indulgences, see infra on p. 114. 9Also, Sir. 3:3 confirms the possibility of atonement for the sins of the fathers by theirsons. It is no accident that the canonicity of the deuterocanonical books was contested byLuther and the Reformers.76 chapter two
10Alhough the book was not recognized as part of the Roman Catholic canon, it is con-tained in the LXX and Jerome translated it, and thus it made its way into the Vulgate. TheChurch Fathers frequently cited it (especially Ambrose). The introitus Requiem ternam inthe Catholic funeral is based on 2:3435: Ideoque vobis dico, gentes quae auditis et intelle-gitis: expectate pastorem vestrum, requiem ternitatis dabit vobis, quoniam in proximo estille, qui in finem sculi adveniet. parati estote ad prmia regni, quia lux perpetua lucebitvobis per ternitatem temporis (emphasis mine). The book is now recognized as part ofthe Bible in the Ethiopian Orthodox Church as well as in the Russian Orthodox Church. 11 Other apocryphal writings also display various vivid imageries and descriptionsabout the afterlife and resurrection (cf. 1 Enoch 22; Apocalypse of Zephaniah 10; Testamentof Abraham 11:20; Jubilees; 4 Macc.; etc.). On Jewish apocalyptic literature, see: RobertHenry Charles, A Critical History of the Doctrine of a Future Life in Israel, in Judaism, andin Christianity or Hebrew, Jewish, and Christian Eschatology from Pre-Prophetic Times till theClose of the New Testament Canon, London: Black, 1899 (reprinted as a paperback: Eschatol-ogy. The Doctrine of a Future Life in Israel, Judaism and Christianity. A Critical History, NewYork: Schocken Books, 1963); Paul Volz, Die Eschatologie der jdischen Gemeinde im neu-testamentlichen Zeitalter nach den Quellen der rabbinischen, apokalyptischen und apokry-phen Literatur, Tbingen: Mohr Siebeck, 1934; Harold Henry Rowley, The Relevance ofApocalyptic. A Study of the Jewish and Christian Apocalypses from Daniel to the Revelation,London: Lutterworth, 1944; Martinus Adrianus Beek, Inleiding in de Joodse apocalyptiekvan het Oud- en Nieuw testamentisch Tijdvak, (Theologia: een bibliotheek van leerboeken6), Haarlem: Bohn, 1950; Joshua Bloch, On the Apocalyptic in Judaism, (JQR MS 2), Phila-delphia: The Dropsie College for Hebrew and Cognate Learning, 1952; Joseph Klausner,The Messianic Idea in Israel from Its Beginning to the Completion of the Mishnah, London:Allen and Unwin, 1956; Michael Edward Stone, Jewish Writings of the Second TemplePeriod. Apocrypha, Pseudepigrapha, Qumran Sectarian Writings, Philo, Josephus, (Compen-dia rerum iudaicarum ad NT. Section 2. The Literature of the Jewish People in the Periodof the Second Temple and the Talmud 2), Assen: Van Gorcum, 1984; Henning Revent-low, Eschatology in the Bible and in Jewish and Christian tradition, (JSOT Supplementseries 243), Sheffield: Sheffield Academic Press, 1997; Steven M. Bryan, Jesus and IsraelsTraditions of Judgement and Restoration, (SNTS MS 117), Cambridge: UP, 2002; GeorgeW.E. Nickelsburg, Jewish Literature between the Bible and the Mishnah. A Historical andLiterary Introduction, Minneapolis: Fortress Press, 2005; Ben Zion Wacholder, The NewDamascus Document. The Midrash on the Eschatological Torah: Reconstruction, Translationand Commentary, (Studies on the Texts of the Desert of Judah 56), Leiden: Brill, 2007. post-mortem existence prior to the reformation 77
12See Emil Schrer, The History of the Jewish People in the Age of Jesus Christ 175 B.C.A.D. 135, vol. 2, English version rev. and ed. Gza Vermes, Fergus Millar & Mathew Black,Edinburgh: Clark, 1979, p. 496. 13Schrer, The History of the Jewish People, p. 514. 14Schrer, The History of the Jewish People, p. 539. 15On the afterlife beliefs in the NT, see: Cullmann, Wolfson, Jaeger & KristerStendahl, Immortality and Resurrection; Nickelsburg, Resurrection, Immortality and Eter-nal Life in lntertestamental Judaism; Murray J. Harris, Raised Immortal. Resurrection andImmortality in the New Testament, Grand Rapids: Eerdmans, 1985; John W. Cooper, Body,Soul, and Life Everlasting. Biblical Anthropology and the Monism-Dualism Debate, GrandRapids: Eerdmans, 1989; Herrmann, Unsterblichkeit der Seele durch Auferstehung; Jean-Bosco Matand Bulembat, Noyau et enjeux de leschatologie paulinienne. De lapocalyptiquejuive et de leschatologie hellnistique dans quelques argumentations de laptre Paul. tuderhtorico-exgtique de 1 Co 15,3558; 2 Co 5,110 et Rm 8,1830, (Beihefte zur Zeitschrift fr dieneutestamentliche Wissenschaft und die Kunde der lteren Kirche, 84), Berlin: de Gruyter,1997; Ernest Austin Adams, The Development of Biblical Views on the General Resurrection ofthe Dead, Ph.D. thesis, Rand Afrikaans University, (Promotor: Jan Du Rand), October 2001;Ed Condra, Salvation for the Righteous Revealed. Jesus amid Covenantal and MessianicExpectations in Second Temple Judaism, (Arbeiten zur Literatur und Geschichte des hel-lenistischen Judentums 51), Leiden: Brill, 2002; Arland J. Hultgren, Eschatology in the NewTestament: The Current Debate, in Carl E. Braaten & Robert W. Jenson (eds.), The LastThings. Biblical and Theological Perspectives on Eschatology, Grand Rapids: Eerdmans, 2002,pp. 6789; Joseph Verheyden, The Fate of the Righteous and the Cursed at Qumran and inthe Gospel of Matthew, in Florentino Garca Martnez (ed.), Wisdom and Apocalypticismin the Dead Sea Scrolls and in the Biblical Tradition, (BETL 168), Leuven: UP & Peeters, 2003,pp. 42752; Segal, Life after Death.78 chapter two
16On the tension between the present / now (prophetic or realized) and the future /not yet (apocalyptic or eschatological) aspects of Jesus message about the Kingdomof God, see: Charles Harold Dodd, The Parables of the Kingdom, London: Nisbet, 1936;Reinhard Nordsieck, Reich GottesHoffnung der Welt. Das Zentrum der BotschaftJesu, (Neukirchener Studienbcher 12), Neukirchen-Vluyn: Neukirchener, 1980; HeinzSchrmann, Gottes Reich, Jesu Geschick. Jesu ureigener Tod im Licht seiner Basileia-Verkndigung, Freiburg: Herder, 1983; Willem van Bruggen, Futurum en eschathon. Overde verhouding van het handelen van God en van de mens in de geschiedenis met het oog opde toekomst, Nijkerk: Callenbach, 1983; Bruce David Chilton, The Kingdom of God in theTeaching of Jesus, (Issues in Religion and Theology 5), Philadelphia: Fortress, 1984; WalterSimonis, Jesus von Nazareth: seine Botschaft vom Reich Gottes und der Glaube der Urge-meinde. Historisch-kritische Erhellung der Ursprnge des Christentums, Dsseldorf: Patmos,1985; Clayton Sullivan, Rethinking Realized Eschatology, Macon: Mercer UP, 1988; MartinHengel & Anna Maria Schwemer (eds.), Knigsherrschaft Gottes und himmlischer Kultim Judentum, Urchristentum und in der hellenistischen Welt, (WUNT 55) Tbingen: MohrSiebeck, 1991; Christian Walther, Eschatologie als Theorie der Freiheit. Einfhrung inneuzeitliche Gestalten eschatologischen Denkens, (Theologische Bibliothek Tpelmann 48),Berlin: de Gruyter, 1991; Leonhard Hell, Reich Gottes als Systemidee der Theologie. Histo-risch-systematische Untersuchungen zum theologischen Werk B. Galuras und F. Brenners,(Tbinger Studien zur Theologie und Philosophie 6), Mainz: Grnewald, 1993; HeinzGiesen, Herrschaft Gottes, heute oder morgen? Zur Heilsbotschaft Jesu und der synoptischenEvangelien, (Biblische Untersuchungen 26), Regensburg: Pustet, 1995. post-mortem existence prior to the reformation 79
breathing), and can even be touched.17 At the same time, the resurrectedbody is not restricted by the laws of nature: it can appear and vanish atwill, can pass through closed doors, and can easily bridge great distances(Lk. 24:1343; Jn. 20:1129; 21:114). Yet, Jesus resurrection is not limited to His person alone, but has itsimplications for all humankind (1 Cor. 6:14; Rom. 8:11; 1 Pt. 1:3). He prom-ised that He would come back at the end of the world to gather His electedpeople and to judge the universe. At this final judgement everyone shallbe resurrected and shall receive eternal punishment or bliss according totheir deeds (Mt. 19:28; 25:3146; Acts 17:31; 24:15; 1 Cor. 6:23; 2 Cor. 5:10;Rev. 1922).18 Thus, the resurrection of the individual is clearly affirmed.Yet, the individual always remains part of the Christian community andis not self-sufficient for salvation. To express this, Jesus uses the imageof the vine and the branches (Jn. 15:15), and Paul symbolizes it throughthe metaphor of the body, in which each part is equally important andunited by Christ (1 Cor. 10:17; 12:1227). The parables of the royal banquet(Mt. 22:110; Lk. 14:1624) and of the wedding dress (Mt. 22:1114), exem-plifying the Kingdom of God, depict the future life as a communal meal.It is therefore in the apocalyptic Kingdom of God that the eschatologicalhope of the community is vested, where the saved will all be partakers ofthe communal heavenly meal.19
17Paul is the only exception, who on his way to Damascus meets the risen Lord in avision after the ascension (Acts 9:18). 18On the final judgement, see: Egon Brandenburger, Das Recht des Weltenrichters.Untersuchung zu Matthus 25,3146, (Stuttgarter Bibelstudien 99), Stuttgart: KatholischesBibelwerk, 1980; Marius Reiser, Die Gerichtspredigt Jesu. Eine Untersuchung zur escha-tologischen Verkndigung Jesu und ihrem frhjdischen Hintergrund, (NeutestamentlicheAbhandlungen N.F. 23), Mnster: Aschendorff, 1990; H.-Konrad Harmansa, Die Zeit derEntscheidung. Lk 13,19 als Beispiel fr das lukanische Verstndnis der Gerichtspredigt Jesuan Israel, (Erfurter theologische Studien 69), Leipzig: Benno, 1995; Ulrich Luz, The FinalJudgment (Matt 25:3146). An Exercise in History of Influence Exegesis, in David RobertBauer & Mark Allan Powell, Treasures New and Old. Recent Contributions to MattheanStudies, (Society of Biblical Literature. Symposium Series 1), Atlanta: Scholars Press, 1996,pp. 271310; Verheyden, The Fate of the Righteous and the Cursed at Qumran and in theGospel of Matthew, pp. 42752; Brian Han Gregg, The Historical Jesus and the Final Judg-ment Saying in Q, (Wissenschaftliche Untersuchungen zum Neuen Testament. 2. Reihe207), Tbingen: Mohr, 2006, and the literature in these works. 19On how the Messianic feast and the meal imagery with its communal eschatologi-cal aspects have been used as symbols for the life of the Kingdom, and by extension thelife of the community, see: Fergus John King, More Than a Passover. Inculturation in theSupper Narratives of the New Testament, doct. diss. at the University of South Africa, 2005,esp. pp. 199238.80 chapter two
Besides the belief in the bodily resurrection, there are passages in theNT that have traditionally been interpreted as a proof of the survival ofthe soul separated from the body after death. Jesus parable about therich man and the poor Lazarus (Lk. 16:1931) is probably the most com-monly cited proof of the immortality of the soul.20 Equally common arethe references to Jesus promise on the cross to the repentant criminalthat the thief would be with Jesus in Paradise on that same day ()(Lk. 23:43) and to Pauls desire to depart and be with Christ ( ) as opposed to live and remain in the flesh ( , [] ) (Phil. 1:18b26).21 Similarly, in 2 Cor. 5:110Paul speaks about his desire to be away from the body and be at homewith the Lord ( )after having put down the earthly tent and moved into a mansion not builtby human hands. This, too, has been seen as a reference to the soul leav-ing the body at death and entering into a Paradise. Finally, while it is notreferring to a post-mortem state, Pauls description in 2 Cor. 12:24 aboutbeing caught up into the third Heaven ( ) hasalso been used as an argument for the possibility of an extra-corporealexistence of the soul.22
20Most modern exegetes reject the idea that theological truths can be deduced fromthis parable with regard to the conscious state of the dead after death or to the effect ofthe immortality of the soul. See e.g. Alfred Plummer, A Critical Exegetical Commentary onthe Gospel According to St. Luke, (International Critical Commentary 30), Edinburgh: T&TClerk, (11922) 1977, p. 252; Ferdinand O. Regalado, The Jewish background of the Parableof the Rich Man and Lazarus, in Asia Journal of Theology 16 (2002), p. 344; Joel B. Green,Eschatology and the Nature of Humans. A Reconsideration of Pertinent Biblical Evidence,in Science and Christian Belief 14 (2002), pp. 3350. To the contrary: Cooper, Body, Soul,and Life Everlasting, pp. 13639; A.J. Mattil, Luke and the Last Things, Dillsboro: WesternNorth Carolina Press, 1979, pp. 2829; I. Marshall, Commentary on Luke, Grand Rapids:Eerdmans, 1978, p. 636. 21 On the exegesis, for the bibliography of the passage and the interpretation of theexpression , see: Gergely Juhsz, Being with Christ. An Exegetical Analy-sis of Philippians 1,18b26 in Perspective of Pauline Eschatology, (unpublished S.T.L. thesis;K. U. Leuven, Promotor: Reimund Bieringer), Leuven: 1996. More recently: Heinz Giesen,Eschatology in Philippians, in Stanley E. Porter, Paul and His Theology, (Pauline Studies3), Leiden: Brill, 2006, pp. 21782; Stefan Schreiber, Paulus im Zwischenzustand. Phil 1.23und die Ambivalenz des Sterbens als Provokation, in NTS 49 (2003), pp. 33659; EnriqueTreiyer, Sen aller et tre avec Christ. Philippiens 1:23, in Andrews University Seminary Stud-ies 34,1 (1996), pp. 4764. 22Paul writes that he does not know whether it happened in the body or out ofthe body ( , ), but the fact that heallowed for the possibility of this happening out of the body was seen as proof of suchan existence. post-mortem existence prior to the reformation 81
Although its canonicity was the subject of dispute for some time, theChurch Fathers and later theologians drew extensively on the visionsdescribed in the Book of Revelation with regard to the eschatologicalevents.23 The author, who calls himself John, describes the epiphany ofChrist to him in several cycles of visions.24 Among others, these includethe portrayal of the heavenly court with the Lamb (5:614) and the 144,000sealed (7:18 and 14:15). In chapters 1922, John describes his visions ofthe last things: the second coming of Christ (19:1116), the call to the heav-enly banquet (19:1718), the final battle, and the binding of Satan (19:19 to20:3), followed by the thousand-year reign (20:410), the Last Judgement(20:1115), the renewal of Heaven and earth, and the vision of the NewJerusalem (21:1 to 22:5).25 These descriptions in vivid imagery were some-times taken literally to identify theological truths. That the belief in an afterlife was not unproblematic for the contem-poraries of Jesus is also documented in the NT. According to the Syn-optic Gospels, Jesus is confronted by the Sadducees, who try to entraphim with the story of the seven brothers, who one after the other marriedthe same woman upon the untimely and childless death of the previousbrother (Mt. 22:2333 et par.).26 They refer to the law of Levirate marriage
(Dt. 25:56), according to which brothers living together should marry thewife of their brother who dies without leaving a son, in order to gener-ate a male heir who would keep alive the name of the deceased.27 It isnoteworthy that for the expression keeping alive the name, the Hebrewtext in Deuteronomy has using the verb , which is theusual term for rising, resurrecting. The Septuagint renders the expression , also using a verb etymologically relatedto but with another verbal prefix. In the Gospels the pun on theterm resurrection () is even more explicit, as Mark and Lukehave , and Matthew uses (raise off-springs), based on Gen. 38:8 ( : LXX: ).28 But,they ask, whose wife shall she be in the resurrection ( )?By reductio ad absurdum, their question ridicules the idea of resurrectionand seems to exclude any possibility of existence beyond death, imply-ing that physical death is the definitive end to human life. Jesus firstrebukes them for their ignorance of the Scriptures and the power of God( ). In the resurrection, Jesus explains, people neithermarry nor are given in marriage, but are like angels. Then, to prove theveracity of the resurrection, he replies with a quote from Exodus (3:6):I am the God of Abraham, the God of Isaac and the God of Jacob, andcombines it with a theological theorem: God is not the God of the deadbut of the living (see 4 Macc. 7:19; 16:25). Strictly speaking, Jesus answerdoes not prove the bodily resurrection. It rather shows that the patriarchsare not dead but are in some sense alive; thus, there must be some kindof continued existence after death in which the dead are like angels anddo not marry. The Sadducees are mentioned in a similar context in Acts,where Paul plays upon the Sadducees denial of afterlife beliefs in order todivide the Sanhedrin when he claims that he is being put on trial becauseof his belief in the resurrection of the dead:
(eds.), Josephus, the Bible, and History, Leiden: Brill, 1989, pp. 17395; Gnter Stemberger,Phariser, Sadduzer, Essener, (Stuttgarter Bibelstudien 144), Stuttgart: Katholisches Bibel-werk, 1991; Lester L. Grabbe, Judaism from Cyrus to Hadrian, vol. II The Roman Period,Minneapolis: Fortress, 1992, 463ff; Steve Mason, Josephus and the New Testament, Peabody:Hendrickson, 1992; Hillel Newman, Proximity to Power and Jewish Sectarian Groups ofthe Ancient Period. A Review of Lifestyle, Values, and Halakhah in the Pharisees, Sadducees,Essenes, and Qumran, (The Brill Reference Library of Judaism 25), Leiden: Brill, 2006. 27Keeping alive the name of the person was not meant to ensure the individualsfame, but rather to ensure the future of the nation. 28Cf. Alan Hugh MNeile, The Gospel according to St. Matthew. The Greek Text withIntroduction, Notes and Indices, London, Melbourne & Toronto: Macmillan, New York:St. Martins, 1965, p. 321. post-mortem existence prior to the reformation 83
29See Samuel Tobias Lachs, The Pharisees and Sadducees on Angels. A Reexaminationof Acts XXIII.8, in Gratz College Annual of Jewish Studies 6 (1975), pp. 3542; David Daube,On Acts 23. Sadducees and Angels, in JBL 109 (1990), pp. 49397; B.T. Viviano & JustinTaylor, Sadducees, Angels, and Resurrection (Acts 23:89), in JBL 111 (1992), pp. 49698;Floyd Parker, The Terms Angel and Spirit in Acts 23,8, in Biblica 84 (2003), pp. 34465. 30On Pauls eschatology, see: Larry J. Kreitzer, Jesus and God in Pauls Eschatology,(JSNT Sup 19), Sheffield: Sheffield Academic Press, 1987, pp. 93129; Martinus C. de Boer,The Defeat of Death. Apocalyptic Eschatology in 1 Corinthians 15 and Romans 5, (JSNT Sup 22),Sheffield: Sheffield Academic Press, 1988, pp. 18183. Craig A. Evans, Ascending andDescending with a Shout: Psalm 47.6 and 1 Thessalonians 4.16, in Craig A. Evans & JamesA. Sanders (eds.), Paul and the Scriptures of Israel, (JSOT Sup 83; Studies in Scripture inEarly Judaism and Christianity 1), Sheffield: JSOT, 1993, pp. 23853; James D.G. Dunn, TheTheology of Paul the Apostle, Edinburgh: Clark, 1998; Juhsz, Being with Christ. 31 Although Croy contests sarcasm, the text of v. 32 has traditionally been interpretedas a polite request for the deferment of further preaching on the subject of ad KalendasGraecas (Croy, Hellenistic Philosophies and the Preaching of the Resurrection, pp. 2139).See: Ernst Haenchen, Die Apostelgeschichte, (Kritisch-exegetischer Kommentar ber dasNeue Testament 3), Gttingen: V&R, 151968, p. 464; G.W. Bromiley, art. Stoics, in Interna-tional Standard Bible Encyclopedia Revised, vol. IV, Grand Rapids: Eerdmans, 1988, p. 621. 32Jol Delobel, The Fate of the Dead according to 1 Thessalonians 4 and 1 Corinthians15, in Raymond F. Collins (ed.), The Thessalonian Correspondence, (BETL 87), Leuven:UP-Peeters, 1990, pp. 34047; Jan Lambrecht, A Structural Analysis of 1 Thessalonians 45,in Karl Paul Donfried and Johannes Beutler (eds.), The Thessalonians Debate. Method-ological Discord or Methodological Synthesis?, Grand Rapids: Eerdmans, 2000, pp. 16378. 33Ascough has recently proposed that the underlying issue of the passage was a con-cern over identity and belonging in the community: whether the dead members can stillbe considered as part of the community (Richard S. Ascough, A Question of Death: PaulsCommunity-Building Language in 1 Thessalonians 4:1318, in JBL 123 (2004), pp. 50930).For a discussion of the various suggestions that have been put forth by scholars about84 chapter two
community that those who died before the Parousia are in no way dis-advantaged compared with those who will still be alive at the return ofChrist. The dead will be resurrected, just like Jesus, who died but roseon the third day (4:14). When he returns, the dead in Christ will rise first( ) (v. 16), and the living will betaken up () together with them to be with the Lord forever( ) (4:17). 1 Cor. 15 is the classic passage for the affirmation of the resurrectionof the body.34 Though far from being a systematic theological treatise onthe issue, this is the place where Paul treats the subject most extensively.In v. 12 Paul rebukes those in the Corinthian community ( )who denied the resurrection of the dead ( ).35For Paul, this makes no sense, because Jesus resurrection is the sine quanon of the Christian faith. If there was no resurrection, Paul argues, thenChrist was not resurrected and is dead, and the proclamation of the Gos-pel (), as well as their faith, is in vain () (vv. 1318). If thereis no resurrection of the dead, Paul claims, then Christians are the mostpitiable among all people ( ) (v. 19). In v. 20Paul stops rebuking his antagonists and sets out his own notions: Christ isrisen from the dead, and His resurrection has consequences for the faith-ful. In him all will be made alive ( ),just as all die in Adam (v. 22). This rising will take place at the end of theworld, when Christ will return ( ). As to the questionof how the dead will rise, Paul does not give a straight answer. He speaksabout a mystery () (v. 51) and uses the analogy of the grainthat is sown (cf. Jn. 12:24). God gives to each kind of seed its own body(v. 38), which differs from what is sown. Similarly, the natural body () is sown in corruption, in weakness, and in dishonour. But the
the possible problem in the Thessalonian community, see: Charles A. Wanamaker, TheEpistles to the Thessalonians. A Commentary on the Greek Text, (NIGTC), Grand Rapids:Eerdmans, 1990, pp. 16466; Earl J. Richard, First and Second Thessalonians, (SP 11), Colle-geville: Liturgical Press, 1995, p. 232; Abraham J. Malherbe, The Letter to the Thessalonians.A New Translation with Introduction and Commentary, (AB 32B), New York: Doubleday,2000, p. 264. 34Jol Delobel, The Corinthians (Un)Belief in the Resurrection, in Reimund Bieringer,Veronica Koperski & Bianca Lataire (eds.), Resurrection in the New Testament, FS JanLambrecht, (BETL 165), Leuven: UP, Leuven, Paris & Dudely: Peeters, 2002, pp. 34355. 35There have been many theories put forth by scholars about the precise background ofPauls opponents in the Corinthian community (ranging from pre- or proto-Gnosticism tosimple (neo)-Platonism) and their precise tenets. For a discussion of these, see: Delobel,he Corinthians (Un)Belief in the Resurrection, pp. 34355. post-mortem existence prior to the reformation 85
alone. Apart from texts referring to the resurrection, there are texts thattraditionally have been understood as references to an intermediate stateof the disembodied soul after death but prior to the end of the world.
38On the eschatological expectations of the Church Fathers, see: Adelin Rousseau,Lternit des peines de lenfer et limmortalit naturelle de lme selon saint Irne, in NRT99 (1977), pp. 83464; Adelin Rousseau, Lternit des peines de lenfer et limmortalitnaturelle de lme selon S. Irne, in NRT 100 (1978), pp. 399417; Luis F. Ladaria, El Esprituen Clemente Alejandrino. Estudio teologico-antropologico, (Publicaciones de la UniversidadPontificia Comillas. Serie 1: Estudios 16), Madrid: Universidad Pontificia Comillas, 1980;Brian Daley, Horacio E. Lona & Josef Schreiner, Eschatologie. In der Schrift und Patris-tik, (Handbuch der Dogmengeschichte. 4: Sakramente, Eschatologie 7a), Freiburg: Herder,1986; Paula Fredriksen, Apocalypse and Redemption in Early Christianity. From John ofPatmos to Augustine of Hippo, in Vigiliae Christianae 45 (1991), pp. 15183; Brian E. Daley,The Hope of the Early Church. A Handbook of Patristic Eschatology, Cambridge: UP, 1991;Caroline Walker Bynum, The Resurrection of the Body in Western Christianity, 2001336,(Lectures on the History of Religions N.S. 15), New York: Columbia UP, 1995, pp. 21114;Nicholas Constas, To Sleep, Perchance to Dream. The Middle State of Souls in Patristic andByzantine Literature, in Dumbarton Oaks Papers 55 (2001), pp. 91124; Andreas Merkt, DasFegefeuer. Entstehung und Funktion einer Idee, Darmstadt: Wissenschaftliche Buchgesell-schaft, 2005. 39Cf. Clement I, Ad Corinthios, XXIVXXVII; L,3; Ignatius, Ad Smyrnaeos III; Irenaeus,Adversus haereses V,7; Justin Martyr, Dialogus cum Tryphone, LXXX; Tatian, Oratio adGraecos VI,1. Unless otherwise indicated, all patristic quotations are from the PG and PLsereies of Migne, checked against early modern and modern editions (critical or other-wise), when relevant. These editions are contained in the Bibligoraphy among the PrimarySources. 40Cf. Polycarp, Ad Philippenses, II; IV; Tatian, Oratio ad Graecos XIII,1 and XV,1. 41 Cf. Clement I, Ad Corinthios, IX,1; XLV,8; Polycarp, Ad Philippenses IX,2; Justin Martyr,Dialogus cum Tryphone, LXII; Irenaeus, Adversus haereses V,4,1; 71,13; 13,3; Clement of Alex-andria, Stromata, V,14. post-mortem existence prior to the reformation 87
and the survival of the soul, several solutions are proposed, generallyallowing the souls of martyrs to enter Heaven immediately, with theirbodies rejoining them upon the general resurrection at the end of theworld. The wicked were believed to enter into the torments of Hell upontheir death. It seems that in their treatment of the post-mortem-but-prior-to-resurrection situation of the soul, the Latin Church Fathers focusedprimarily on punishment and satisfaction in a judicial sense (paying offthe debt to God). The Greek Fathers, rather, emphasized the cleansingof the soul by divinization through Gods indwelling.42 Accordingly, theidea of some kind of purgation of the unclean but worthy souls after deathseems to become the accepted orthodox stance both in the East and theWest. On the level of orthopraxis, the practice of praying for the deadis demonstrated from very early on.43 Examples of addressing the saintsfor their intercession and remembering the heavenly birthday of martyrsand collecting their relics can be also found in the Church Fathers andearly archaeological evidence.44 The Fathers position is often formulated in opposition to religious dis-sent and heterodox views. As a result, they are typically unsystematic andoften contradictory. At the same time, their writings testify to the manyproblems with regard to beliefs concerning the post-mortem existence ofthe human person. A cursory reading of the pre-Nicean Fathers showsthat they combated primarily on three fronts: Hellenistic pagan philos-ophy, Docetism, and Gnosticism. Polycarp (c.69155) reports that someheretics denied the post-mortem judgement and the resurrection.45 Jus-tin refutes the idea of the transmigration of souls and the idea that thesoul is not immortal in its own right.46 Tatian (c.110/120c.180) apparentlybelieved that the soul by itself is not immortal ( [...] ), but can die and be dissolved together with the body ifit does not know the truth (
Tertullian also refuted that the soul could sleep, because it is always inmotion, always active, and never succumbs to resta condition that isalien to immortality.58 Tertullian maintained that the bodily resurrection,although it can be traced remotely and confusedly in heathen teachings,is a Christian teaching (fiducia Christianorum).59 He confuted the vari-ous heretical positions concerning the resurrection in his De resurrectionecarnis. There, he explains that Christ refuted the Sadducees, who deniedsalvation for either the soul or for the body (neque animae, neque carnisadmittunt salutem).60 But Christs answer to them affirmed the resurrec-tion of the two natures of the human person (resurrectionem utriusquesubstantiae humanae).61 Tertullian claims that he, too, has to address theSadducees of his own time (ad alios sadducaeos praeparamur), just likethose in the time of Christ who denied the resurrection.62 Some of these,Tertullian reports, allow only for the resurrection of the souls becausethey despise the body (agnoscunt resurrectionem, solius scilicet animae;aspernati carnem).63 These heretics are like the heathens because theyvilify the flesh.64 But true Christians respect the body, which was createdprior to the soul, and which, together with the soul, forms the humanbeing, the chief work in creation.65 So at the judgement the body, too, willpartake in the rewards or the punishments.66 The Alexandrian Fathers were likewise concerned with the questionof the resurrection. Clement of Alexandria (c.150c.215) refuted the pre-existence of souls and claimed that sexual differentiation will disappearin the resurrection.67 Origen (c.185c.254) believed that at the end of theworld all creatures (even the enemies of God) will return to the originalharmony: a general and universal restoration () will takeplace.68 At the resurrection, the soul will create its own, suitable spiritual
58Tertullian, De anima, LVIII. Tertullian uses Aristotles argument that the soul is actu-ality (Cf. Aristotle, De anima, II,1). 59Tertullian, De resurrectione carnis, I and III. 60Tertullian, De resurrectione carnis, XXXVI. 61 Tertullian, De resurrectione carnis, XXXVI. 62Tertullian, De resurrectione carnis, II. Cf. Tertullian, Adversus Marcionem, IV,37. 63Tertullian, De resurrectione carnis, II. He mentions the Valentinus, Apelles, Marcion,and Basilides. 64Tertullian, De resurrectione carnis, IV. 65Tertullian, De resurrectione carnis, V. 66Tertullian, De resurrectione carnis, LVI. 67Clement of Alexandria, Stromata, III,14; VI,1213. 68Origen, De principiis, I,6,13. Origen has been accredited with believing in universalsalvation, viz. that in the general restoration even Satan would be saved. On his viewson afterlife, see: L.R. Hennessey, The Place of Saints and Sinners after Death, in Charles post-mortem existence prior to the reformation 91
form for the body (cf. 1 Cor. 15).69 Origen is unclear whether this spiritualbody is the ultimate or the penultimate stage of the soul in the ongoingprocess of self-transcending evolution ().70 Origen, as reportedby Eusebius (431594), encountered Arabian heretics who held that thehuman soul dies and perishes with the body at death and that body andsoul will be renewed and resurrected together.71 These heretics, whobased their doctrine on the OT, believed that the soul is contained bythe blood. Therefore, as the blood is shed or decomposed by death, thehuman soul, too, must die. Origen argued that the souls of the elect imme-diately enter Paradise unless they are not yet purified, in which case theypass into a state of punishment, a penal fire, which is to be conceived as aplace of purification.72 He also maintained that Christ, when he becamea soul, without the body (i.e. after His death on the cross), dwelt amongthe incorporeal souls and converted some of them.73 This has been takenlater as reference to Christs descent into Hell.74 Origen was also the firstto denounce Chiliasts as visionaries, deluded fools, and what was worse,
annengiesser and William L. Petersen (eds.), Origen of Alexandria. His World and Legacy,KNotre Dame: UP, 1988, pp. 295312; H.-J. Horn, Ignis Aeternus. Une interprtation morale dufeu ternel chez Origne, in Revue des tudes Grecques 82 (1969), pp. 7699; John R. Sachs,Current Eschatology. Universal Salvation and the Problem of Hell, in Theological Studies 52(1991), pp. 22754; John R. Sachs, Apocatastasis in Patristic Theology, in Theological Stud-ies 54 (1993), pp. 61740; Henri Crouzel, Lexgse orignienne de 1 Cor 3.1115 et la puri-fication eschatologique, in Jacques Fontaine & Charles Kannengiesser (eds.), Epektasis.Mlanges patristiques offerts au Cardinal Jean Danilou, Paris: Beauchesne, 1972, pp. 27383;Elizabeth A. Clark, New Perspectives on the Origenist Controversy. Human Embodimentand Ascetic Strategies, in Church History 59 (1990), pp. 14562. For a discussion and thereception of the idea by the Reformers, see: C.A. Patrides, The Salvation of Satan, in JHI28 (1967), pp. 467478. 69Origen, De principiis, III,6, 4. 70Constas, To Sleep, Perchance to Dream, pp. 9697. Cf. Daley, The Hope of the EarlyChurch, p. 54. Cummings, Coming to Christ, p. 97. 71 [...] , . (Eusebius, Historia Eccle-siastica, VI,37,1.) 72Augustine reiterates Eusebius story: dixerunt animas cum corporibus mori atquedissolvi et in fine saeculi utrumque resurgere. Sed hos disputatione Origenis praesentiset eos alloquentis celerrime dicit fuisse correctos (Augustine, De haeresibus liber unus adQuodvultdeum Liber unus, 83). Origen interpreted Pauls words in 1 Cor. 3:1115 as refer-ring to this post-mortem purification in several of his sermons (e.g. Homilia 6 in Exodum,Homilia in Psalmum XXXVI, Homilia 25 in Numeros, all in PG 12). 73Origen, Contra Celsum, II,43. 74For the tenet of Christs Descent to Hell, see infra on p. 96.92 chapter two
75Hans Bietenhard, The Millennial Hope in the Early Church, in SJT 6 (1953), p. 20.Justin Martyr (Dialogus cum Tryphone, LXXX), Irenaeus (Adversus haereses, V,3135),Tertullian and many others had argued for some kind of literal interpretation of thethousand-yearlong reign of Christ on earth together with the saints after their resurrec-tion (cf. Rev. 20:37). On the Chiliasts, see: Johann Nepomuk Schneider, Die chiliastischeDoctrin und ihr Verhltniss zur Christ Glaubenslehre, Schaffhausen: Hurter, 1859; Florenti-nus Alcaniz, Ecclesia patristica et millenarismus. Expositio historica, Granada: Caro, 1933;Bietenhard, The Millennial Hope in the Early Church, pp. 1230; Robert L. Wilken, EarlyChristian Chiliasm, Jewish Messianism, and the Idea of the Holy Land, in HTR 79 (1986), pp.298307; Charles E. Hill, Regnum Caelorum. Patterns of Future Hope in Early Christianity,(Oxford Early Christian Studies), Oxford: Clarendon, 1992. On their influence in the MiddleAges, the Renaissance, and the Reformation period, see: Norman Cohn, The Pursuit of theMillennium. Revolutionary Millenarians and Mystical Anarchists of the Middle Ages, NewYork: Oxford UP, (11957) rev.exp.1990. 76Origen, De principiis, II,11,2. Cf. Eusebius, Historia Ecclesiastica, III,39. The refusal ofhedonistic Chiliasm as a Jewish heresy became commonplace in Christian theology afterOrigen (cf. Thomas Aquinas, Summa Theologica. Ad emendatiores editiones impressa etaccuratissime recognita, Suppl. qu. 81. art. 4 ad 4) and was repeated by the Reformers (e.g.in the Augsburg Confession, XVII,4; Calvin, Institutiones religionis Christianae, III,25,5). 77Origen, De pricipiis, II,11,2. 78Epiphanius, Adversus haereses, LXXV,27. 79 , , , . (Epiphanius, Adversus haereses,III,29). Mani taught that only the hearers (not completely purified souls) are bound tometempsychosis, while the wicked (sinners) are punished, and the elect are shipped intothe Land of Light. The sect is condemned by many other Church Fathers, too (e.g. Johnof Damascus, Cyril of Jerusalem). Augustine, himself an ex-Manichaean, provides severalinteresting details on their teachings. See e.g. Augustine, Contra Faustum Manichaeum libritriginta tres, VI,3; XXXXI; Augustine, De Genesi ad litteram libri duodecim, VII,11,17; X,13,22.The literature on Manichaeism is abundant. See e.g.: A.V. Williams Jackson, The Doctrineof Metempsychosis in Manichaeism, in JAOS 45 (1925), pp. 24668; A.V. Williams Jackson,A Sketch of the Manichean Doctrine concerning the Future Life, in JAOS 50 (1930), pp. 17798; post-mortem existence prior to the reformation 93
Origen with spiritualizing the resurrection and denying that the resur-rected body is truly flesh.80 The issue would be taken up again by Jerome,who defended the position that the resurrected body (corpus) is true flesh(caro) against John of Jerusalem.81 For Jerome, the resurrection of the fleshand the immortality of the soul presuppose each other. In his Commen-tary on Matthew, he raised the question of what Jesus intention was inusing such an ambiguous citation in His discussion with the Sadducees inorder to prove resurrection (Mt. 22:32).82 Jerome remarked that althoughthere are better texts in the Scriptures that prove the veracity of the res-urrection (he quoted Is. 26:19 and Dan. 12:2), it would have been unwise(stultum) if Jesus had quoted them, since they are not found in the fivebooks of Moses, which the Sadducees held exclusively to be authoritative.Therefore, Jesus proves the immortality of the soul on the basis of a cita-tion from Exodus, Jerome explained, and from the immortality of the soulthe bodily resurrection should follow.83 In another controversy, Jeromedefended the veneration of relics and the belief that the saints can be bothin the tomb and with God at the same time.84 Jerome also maintainedthat justification has to be achieved in this world because after death thesouls of the departed can neither do good nor commit sin.85 Nestorians
and Jacobites believed that these souls sleep, i.e. lie unconscious withoutbeing punished or rewarded until the Day of Judgement, because punish-ment and reward have to be received in the same body in which the sinswere committed and merits earned.86 Macarius Magnes (fl. c.403) meetsthe opposition of the pagan philosophers in his Apocriticus.87 On theoccasion of the death of his brother Satyrus, Ambrose (c.34097) warnedagainst foolish speculations about the resurrection and the resurrectedbody but clearly asserted that prayer for the dead is helpful.88 Ambrosedistinguished between three kinds of death (spiritual, mystical, and physi-cal), and he argued that physical death should not be feared and that allthose who want to enter Paradise have to be cleansed by fire.89 He alsomaintained that Scripture affirmed the immortality of the soul.90 Basil the
Great (d. 379) is faced with the problem of perpetual bodily mutation.91Basils death would give the incentive to Gregory of Nyssa (c.335c.395),Basils elder brother, to write his De anima et resurrectione, reflecting on theimmortal nature of the soul and on bodily resurrection in a dialogue withtheir sister Macrina.92 Gregory refuted atheism, the Epicurean dissolutionof the soul into atoms, as well as the ideas of transmigration of the souland the pre-existence of the soul: these concepts are self-contradictory andthey result in immoral conclusions.93 The soul is not subject to the laws ofnature, is undimensional () by nature, and is immortal.94 Upondeath those souls that were detached from earthly desires and were puri-fied by the love of Wisdom ascend to God. But the purgation ()of the souls that adhered to carnal desires in life is a necessary require-ment for their divinization ( ).95 Yet, Christian hope isvested not only in the immortality of the soul but also in the resurrectionof the human person as a whole: soul and body together. For Gregory, theresurrection is the restoration of the human person to his or her originalcondition. The soul has an affinity to the body that ensures that the resur-rected body will be recomposed of the same particles as the earthly body.96His namesake, Gregory of Nazianzen (c.32589), will be frequently citedlater for his reflection on the fate of the infants who die without baptism.He argued that such unsealed infants will be neither admitted to theglory of Heaven nor condemned to suffer punishment, since they are notwicked.97 Consequently, there must be a third option, because if one does
not merit punishment, it does not follow that one would be worthy ofbeing honoured, or vice versa: one who is not worthy of honour does notnecessarily deserve to be punished.98 Nonetheless, he argues for infantbaptism only if there is any pressing danger, for it is better that thesechildren should be unconsciously sanctified ( ) thandepart unsealed and uninitiated ( ).99Chrysostom (c.349c.407) maintained that Christians should look forwardto their death with joy and that the custom of prayers at mass to help thesouls of the dead was instituted by the apostles themselves.100 The first official texts that professed Christs descent into Hell as anarticle of faith were the Apostolic Creed ( )101
102DH 75 (DS 39). In its complete form, the Athanasian Creed (also known as the Qui-cumque vult for its first words, or Fides Catholica for its opening and concluding sentences)first appeared only around the 9th century. It is one of the four authoritative Creeds ofthe Catholic Church, also recognized as such by the Anglican and Lutheran Churches andby some other Protestant churches. The traditional ascription to Athanasius is now dis-proved, since the Creed was unknown in the Eastern Churches until the 12th century andits language and structure are Western. In modern times the Quicumque vult has beenascribed to Ambrose, Fulgentius of Ruspe, and Caesarius of Arles. It is now believed tohave been composed in Southern France around the 5th century. See: literature in n. 100,and further: Andrew Ewbank Burn, The Athanasian Creed and its Early Commentaries,(Texts and Studies: Contributions to Biblical and Patristic Literature 4/1), Cambridge: UP,1896; George Druce Winne Ommanney, A Critical Dissertation on the Athanasian Creed,Oxford: Clarendon, 1897; C.H. Turner, A Critical Text of the Quicumque Vult, in Journal ofTheological Studies 11 (1910), pp. 1928; Josef Stiglmayer, Das Quicumque und Fulgentiusvon Ruspe, in Zeitschrift fr Katholische Theologie 49 (1925), pp. 34157; Andrew EwbankBurn, The Authorship of the Quicumque vult, in Journal of Theological Studies 27 (1926),pp. 40111; G. Morin, Lorigine du symbole dAthanase, in Revue Bndictine 44 (1932),pp. 20719; K.K. Kelley, Athanasian Creed, (The Paddock lectures 19621963), London:Black, 1964; Herbert W. Richardson & Jasper Hopkins, On the Athanasian Creed, in HTR60 (1967), pp. 48384; Volker Henning Drecoll, Das Symbolum Quicumque als Kompila-tion augustinischer Tradition, in Zeitschrift fr Antikes Christentum 11 (2007), pp. 3056. 103E.g. in the Christian apocryphal Odae Salomonis, XL,12; Jerome, Commentaria inIonam, ad II,67; Irenaeus, Adversus haereses, IV,22,1; Gregory I the Great, Moralia, XXIX;Hilary of Poitiers, De Trinitate, III,15; Augustine, De Genesi ad litteram libri duodecim,XXXIII,63. See: Werner Bieder, Die Vorstellung von der Hllenfahrt Jesu Christi. Beitrag zurEntstehungsgeschichte der Vorstellung vom sog. Descensus ad inferos, (Abhandlungen zurTheologie des Alten und Neuen Testaments 19) Zrich: Zwingli, 1949; Ralph V. Turner,Descendit ad Inferos. Medieval Views on Christs Descent into Hell and the Salvation of theAncient Just, in JHI 27 (1966), pp. 17394. Christs descent into Hell was most elaboratelydepicted by the apocryphal Gospel of Nicodemus. For the tremendous effect this accounthad in the Middle Ages, see: William Henry Hulme, The Middle English Harrowing of Helland Gospel of Nicodemus, (Early English Text Society, Extra Series 100), London: Oxford UP,1907; Irene Rima Makaryk, About the Harrowing of Hell, Ottawa: Dovehouse Editions, 1989;Karl Tamburr, The Harrowing of Hell in Medieval England, Woodbridge: DS Brewer, 2007. 104On Augustines views on the post-mortem existence, see: Robert J. OConnell, TheOrigin of the Soul in St. Augustines Later Works, New York: Fordham UP, 1987; MamertoAlfeche, Augustines Discussions with Philosophers on the Resurrection of the Body, Lovanii:Institutum Historicum Augustinianum, 1995.98 chapter two
those of the wicked enter into pain.105 Although the deceased souls ofthe righteous already enjoy Gods presence after death, this is not yet thebeatific vision of God.106 Augustine differentiated between lethal or gravesins (peccata lethales, grandes, gravia, or capitalia), which, unless dulyrepented of and remitted, are punished by damnation, and minute orminor sins (peccata minuta), which, although they do not merit damna-tion, if neglected can also lead to death.107 He also differentiated betweenguilt or fault (culpa) and debt of punishment (poena): while guilt can beremitted, punishment is still to be suffered.108 In this manner Augustinecan assert that during the interim between death and resurrection, thesouls are punished and purged for the sins they committed while on earth,but they may be helped by the prayers and alms of their friends and fami-lies, and that the Church prays and commands prayer for all who diedin the Christian and Catholic family, even without naming them all, in
109Verum et si aliqua necessitas vel humari corpora, vel in talibus locis humarinulla data facultate permittat, non sunt praetermittendae supplicationes pro spiritibusmortuorum: quas faciendas pro omnibus in christiana et catholica societate defunctis etiam tacitis nominibus eorum sub generali commemoratione suscepit Ecclesia; ut quibus ad ista desunt parentes, aut filii, aut quicumque cognati vel amici, ab una eis exhibean- tur pia matre communi. Si autem deessent istae supplicationes, quae fiunt recta fide ac pietate pro mortuis, puto quod nihil prodesset spiritibus eorum quamlibet in locis sanctis exanima corpora ponerentur (Augustine, De cura pro mortuis gerenda ad Paulinum liber unus, IV) Cf. Augustine, Sermo CIV De verbis Apostoli, I Cor. cap. III, 1115, Fundamentum aliud nemo potest ponere, etc., 4; Augustine, Enchiridion ad Laurentium sive de fide, spe et charitate, LXVIILXIX, CX; Augustine, De civitate Dei, XXI,26). Although in Augustinesworks the purging of the soul is not confined to a specific space, he earned the misleadingtitle the Father of Purgatory. Cf. Jacques Le Goff, La naissance du purgatoire, (Biblio-thque des histoires), Paris: Gallimard, 1981, p. 61. 110Ille purgatorius ignis durior erit, quam quidquid potest in hoc saeculo poenarum autcogitari, aut videri, aut sentiri (Augustine, Sermo CIV De verbis Apostoli, I Cor. cap. III, 1115,Fundamentum aliud nemo potest ponere, etc., 2). Cf. Augustine, Confessiones, IX,3536. 111 Augustine, De civitate Dei, XIII,8; Augustine, In Ioannis Evangelium tractatus CXXIV,XLIX,10. 112Augustine, Confessiones, IX,37; XXII,26. 113Augustine, De civitate Dei, XXII,26. 114Initially Augustine seems to have favoured the idea that Hell was not a specific place(Augustine, De Genesi ad litteram, XII,26). At the end of his life he retracted this opinion(Augustine, Retractiones, II,24,2). 115Augustine, De civitate Dei, XXII,26. 116Augustine, De doctrina christiana libri quatuor, II,11.100 chapter two
123Werner Verbeke, Danel Verhelst & Andries Welkenhuysenk (eds.), The Use andAbuse of Eschatology in the Middle Ages, (Mediaevalia Lovaniensia. Series 1. Studia, 15), Leu-ven: UP, 1988; Kieran Nolan, The Immortality of the Soul and the Resurrection of the Bodyaccording to Giles of Rome. A historical study of a 13th century theological problem, (Studiaephemeridis Augustinianum, 1) Rome: Augustinianum, 1967. 124Art. Purgatory, in IS Encyclopaedia of Death and Dying. On the theological aspects ofissues concerning afterlife in Dantes work, see: Nancy Lindheim, Body, Soul, and Immor-tality. Some Readings in Dantes Commedia, in MLN 105, (1990), pp. 132; Hiram Peri, TheOriginal Plan of the Divine Comedy, in JWCI 18 (1955), pp. 189210; Manuele Gragnolati,Experiencing the Afterlife. Soul and Body in Dante and Medieval Culture, (William and Kath-erine Devers Series in Dante Studies), Notre Dame: UP, 2005; Christian Moevs, The Meta-physics of Dantes Comedy, (Reflection and Theory in the Study of Religion), Oxford: UP forthe American Academy of Religion, 2005.102 chapter two
Although in the beginning the exact location of Purgatory was not deter-mined, later it was thought to be in the vicinity of Hell.125 The popular interest in the fate of the souls can be found in the visionsof medieval mystics, too. William of St Thierry (c.1085c.1148), Bernard ofClairvaux (10901153), Joachim of Fiore (c.11351202), Gertrud of Helfta(12561301), Julian of Norwich (c.13421416), and Catherine of Genoa(14471510) gave mystical descriptions and visions of post-mortem exis-tence, souls in Purgatory, and eschatological events.126 The mystical philosophical and theological writings of Nicholas of Cusa(140164) were going to play an important role in the Reformers theology.127In his sermons Quem Deus suscitavit, solutis doloribus inferni (on Acts 2:24)and Qui per spiritum sanctum semetipsum obtulit (on Heb. 9:14), Cusanusexpounded upon his notions about Christs descent into Hell.128 TheGerman Cardinal interpreted Psalm 30:1112 as referring to Christsdescent into Hell in terms of agony, namely, Christs own experience ofbeing dead.129 Christs humanity was not dissolved in His death because
125The Venerable Bede (c.672735) described a vision of a beautiful Heaven and a luridHell with adjacent temporary abodes. (Bede, Historia Ecclesiastica, IV,19). Hugh of St Victor(c.10781141), De Sacramentis christianae fidei, II,4, left the question open. Petrus Lombar-dus (c.11001160) placed it next to Hell under the earth: Sententiae in IV libris distinctae,IV,XXI,1. Albert the Great (c.120080) located it in superiorem partem inferni (Commen-tarii in IV Sententiarum Petri Lombardi, dist. XXI, art. 6). See also: Helen Foxhall Forbes,Diuiduntur in Quattuor: The Interim and Judgement in Anglo-Saxon England, in Journal ofTheological Studies 61 (2010), pp. 65984. 126See: Bynum, Resurrection of the Body, pp. 15699; Bernard McGinn, St. Bernard andEschatology, in Bernard of Clairvaux. Studies Presented to Dom Hean Leclerq, Washington(DC): Cistercian Publications, 1973. 127On the views of Nicholas of Cusa on issues of afterlife, see: Rudolf Haubst, DieChristologie des Nikolaus von Kues, Freiburg: Herder, 1956, pp. 276304; Peter J. Casare-lla, Cusanus: The Legacy of Learned Ignorance, Washington (DC): Catholic UP of America,2006; Nancy J. Hudson, Becoming God. The Doctrine of Theosis in Nicholas of Cusa, Wash-ington (DC): Catholic UP of America, 2007. 128Nicholas of Cusa, Excitationes X, n Opera Nicolai Cusae Cardinalis ed. Jacques Lefvredtaples, Paris: Henri Estienne, 1514, fo. 176r-v. See also his theological and philosophicalwritings De docta ignorantia, III,7, and De visione Dei, XXIII. 129Calvin suggests a similar interpretation of the descent into Hell in his Psychopanny-chia (1534, published in 1542: CR V. 224; tr. Calvin, Tracts III. 628). Pico della Mirandolaexplained the descensus also in terms of Christs agony. Luther adopted the view thatChrist, as God and man, literally entered into Hell. See Johan August Dietelmeier, Histo-ria dogmatis de Descensu Christi ad inferos litteraria, Nrnberg, Altorf, esp. pp. 16091. Seealso: Calvin, Institutiones religionis Christianae, II, XVI,10. On the use and interpretationof Cusanus in the German Reformation, see: Markwart Herzog, Descendit ad inferos:Strafleiden oder Unterweltkrieg? Ein Beitrag zur Wirkungsgeschichte der Hllenfahrtlehredes Nikolaus von Kues in den Bistmern Freising und Naumburg (1525/26), in Theologie undPhilosophie 71 (1996), pp. 33469. post-mortem existence prior to the reformation 103
His humanity was hypostatically united with the divinity in one person(humanitas fuit unita divinitati in una persona) as an immortal unity (perunionem ad divinitatem fuit immortalis, as proved by His resurrection)and remained so even after His death; yet according to His human nature(per unionem formalem ad hominem), His body and soul could spatiallyand temporarily separate from each other (cessavit esse unio corporis atanimae).130 Therefore, Christ experienced death, descended into Hell (adinferna), and suffered together with the souls in Hell.131 In His descent,Christs soul acquired the full knowledge of death (scientia mortis), inwhich the souls in Hell are completely abandoned by God. These soulsthrough direct experience (via cognoscentiae) behold death (visio mortis)eternally. According to the Cardinal, this is what the expression the sec-ond death in Rev. 20:14 means: from which there is no escape. Becausefor Cusanus Hell was not a place but an inner condition, and becauseHis suffering enclosed (complicat) all pain in death, Christs afflictionsin Hell were the greatest conceivable suffering, the consummate pen-alty (poena consummata).132 In this freely chosen act of solidarity, Christkept glorifying the Father as he had done in His earthly life. When Christ
130Sermo, LXXVI, and Sermo, XXVII published in Josef Koch, Untersuchungen ber Dat-ierung, Form, Sprache und Quellen. Kritisches Verzeichnis smtlicher Predigten, (Cusanus-Texte, 1, Predigten, 7, Sitzungsberichte der Heidelberger Akademie der Wissenschaften.Philosophisch-historische Klasse, 19411942,1), Heidelberg: Winter, 1942, pp. 65 and 75.Republished in Nicolai De Cusa, Opera omnia, vol. XVII Sermones II, (14431452), eds. RudolfHaubst & Hermann Schnarr, Hamburg, 1983. See also Nicholas of Cusa, De docta ignoran-tia III,7; Nicholas of Cusa, De visione Dei, XXIII. With his emphasis on the hypostatic union,Cusanus was reacting to the controversy about the Precious Blood of Christ between theDominicans and the Minorites (146263). There the question was whether the Blood ofChrist shed during his passion and reassumed at his resurrection should be adored as theBlood of the Son of God during the three days (triduum mortis) that it was separated fromthe Divinity of Christ. The Dominicans argued for the affirmative, while the negative washeld by the Minorites. On the controversy, see: Livarius Oliger, Johannes Kannemann,ein deutscher Franziskaner aus dem 15. Jahrhundert, in Franziskanische Studien 5 (1918),pp. 3967, at p. 46; Johannes Heuser, Heilig Blut in Kult und Brauchtum des deutschenKulturraumes. Ein Beitrag zur religisen Volkskunde, Ph.D. thesis, University of Bonn, 1948,pp. 7778; The Commentaries of Pius II. Books XXIII, trans. Florence Alden Cragg, (SmithCollege Studies in History 43), Northampton, 1957, pp. 70329; Silvano Bracci (ed.), SanGiacomo della Marca nellEuropa del 400. Atti del Convegno internazionale di studi, Monte-prandone, 710 settembre 1994, (Centro studi Antoniani 28), Padua: Centro di Studi Anto-niani, 1997; arts. James of Brescia and St. James of the Marches in IS CE. 131 Cusanus introduces an idea of the co-suffering of Christ with the sinners in thisrealm. This notion later became the basis for the exchange of attributes (communicatioidiomatum) between Christ and the sinners in Hell in Luthers theology of the descent, butin the theology of the medieval Cardinal Christ never adopts the active role of a sinner. 132Cf. Augustines position supra on p. 99.104 chapter two
was risen, he was liberated from the torments of Hell (solutis doloribusinferni).133 The literary genre of ars moriendi, pious practical guides on how todie well that became extremely popular in the 15th century, also testifyto the widespread interest in death and post-mortem existence.134 Thesebooks in the original Latin and their vernacular translations into almostall Western European languages feature prominently among the incunab-ula and the early printed books of the 16th century, and would be popularin Early Modern times as well. The fascination with the fate of the deceased was not merely an intel-lectual curiosity, but a matter of practical concern arising from a strongcommunal conviction. According to the teaching of the Church, there is aspiritual solidarity within the communio sanctorum between the EcclesiaMilitans (Christs Church on earth), the Ecclesia Triumphans (the saintsalready in Heaven), and the Ecclesia Penitens (the souls of the deceasedin Purgatory): Christians may be physically separated from each other bydeath, yet they remain united in one Church and can support each otherin prayer. This solidarity rests on the basis of prayers to the saints (ChurchTriumphant) for their intercession on behalf of the living. Many popularsaints were thus revered and invoked for their help in everyday life. Theirrelics were venerated, their feasts were celebrated, and pilgrimages wereundertaken to places of importance in their lives in order to appeal fortheir assistance. In their turn, the living (Church Militant) offered theirprayers to alleviate and shorten the sufferings of the souls in Purgatory(Church Suffering). The celebration par excellence of this spiritual soli-darity of the communio sanctorum between the Church Triumphant andthe Church Militant was the consecration of the Pantheon in Rome to the
Blessed Virgin and all the martyrs on 13 May 610 by Pope Boniface IV,establishing the Feast of All Holy Martyrs.135 With the foundation by PopeGregory III (pope 73141) of an oratory in St Peters for the relics of theholy apostles and of all saints, martyrs and confessors, of all the just madeperfect who are at rest throughout the world, the date of the feast wasmoved to 1 November.136 In 835, Pope Gregory IV (pope 82744) decreedthe celebration of the Feast of All Saints on 1 November for the entireChurch. Pope Sixtus IV (pope 147184) added the octave to the feast. TheFeast of All Souls (2 November)the expression of the spiritual solidar-ity of the communio sanctorum when the Church Militant prays for therelease from sufferings of the Church Suffering (the souls in purgation)was first established by abbot Odilo (9621049) in the Benedictine mon-asteries under Clunys authority in the late 10th century.137 From Clunythe custom spread and became popular in the 13th century. When Romeintroduced the feast into the calendar for the entire Church, the date wasretained so that the Communion of all of the saints might be celebratedtogether.
135In the writings of the Church Fathers, earlier celebrations of the martyrs and saintscan also be seen (art. All Saints Day in IS CE). 136Art. All Saints Day, in E.A. Livingstone & Frank Leslie Cross (eds.), The OxfordDictionary of the Christian Church, Oxford: UP, 31997, pp. 4142. 137Sanctus Pater generale propositum per omnia monasteria sua constituit, ut sicutin capite Kalendarum Novembrium festivitas agitur Omnium Sanctorum, ita etiam inse-quenti die, memoria generaliter ageretur pro requie omnium fidelium animarum; privatimet publice missae cum psalmis et eleemosynis celebrarentur, omnibus supervenientibuspauperibus eleemosyna multipliciter daretur (Iotsaldus, Vita Sancti Odilonis, II,13). Morerecently: Johannes Staub (ed.), Vita des Abtes Odilo von Cluny, (Monumenta Germaniaehistorica. Scriptores 7. Scriptores rerum Germanicarum in usum scholarum separatimediti 68) Hanover: Hahn, 1999. According to Iotsaldus, Odilo was moved by the report of ahermit who had heard demons complaining about the efficacy of prayers and almsgivingin liberating souls from their suffering (orationibus religiosorum hominum, et eleemosynispauperum, [...] multoties per Dei misericordiam ab eorum poenis liberarentur animae dam-natorum). Iotsaldus also recounts the story about the soul of the deceased Pope BenedictVIII (pope 101224), who to his surprise found himself not enjoying the splendour of light,but confined in the shade (non splendore lucid, sed poenarum teneretur in umbris). Bene-dict appeared to a friend and asked for the prayers of Odilo and his monastery. After thepetition had been forwarded to Odilo, Benedict appeared again to express his gratitudeto the abbot for his release from the chaos (Iotsaldus, Vita Sancti Odilonis, II,14). On Odiloof Cluny, see: L.M. Smith, Cluny and Gregory VII, in EHR 26 (1911), pp. 2033; RaymondOursel (ed.), Les saints abbs de Cluny. crits de labb Bernon et des saints Odon, Odilon,Hugues, (Les crits des saints), Namur: Ed. du soleil levant, 1960; Jacques Hourlier, SaintOdilon, abb de Cluny, (Bibliothque de la RHE 40), Louvain: RHE, 1964; Johannes Staub,Studien zu Iotsalds Vita des Abtes Odilo von Cluny, (Monumenta Germaniae historica. Stu-dien und Texte 24), Hanover: Hahn, 1999.106 chapter two
as the cleansing of the venial sins and the payment of the debt of temporalpunishment for those mortal sins that had been remitted in life. Suffragesof the Church for the dead (masses, vigils, prayer, and indulgences) couldshorten the period of purgation of the souls or lessen their pain. In this shift towards an interest in the fate of the soul, two medievalArab philosophers exercised major influence in the 13th century. BothAvicenna and Averroes stood in the Aristotelian tradition but arrived at
tempus acceptabile, ecce nunc dies salutis (2 Cor 6,2), Salomon quoque ait: Quodcumquepotest manus tua facere, instanter operare, quia nec opus, nec ratio, nec scientia, nec sapi-entia erit apud inferos, quo tu properas (Ecc 9,10). David quoque ait: Quoniam in saeculummisericordia ejus (Ps 105(106),1; 117(118),14.29). Ex quibus nimirum sententiis constat quiaqualis hinc quisque egreditur, talis in judicio presentatur. Sed tamen de quibusdam levibusculpis esse ante judicium purgatorius ignis credendus est, pro eo quod Veritas dicit, quiasi quis in sancto Spiritu blasphemiam dixerit, neque in hoc saeculo remittetur ei, neque infuturo (Mt 12,31). In qua sententia datur intelligi quasdam culpas in hoc saeculo, quasdamvero in futuro posse laxari. Quod enim uno negatur, consequens intellectus patet, quia dequibusdam conceditur. Sed tamen, ut praedixi, hoc de parvis minimisque peccatis fieriposse credendum est, sicut est assiduus otiosus sermo, immoderatus risus, vel peccatumcurae rei familiaris, quae vix sine culpa vel ab ipsis agitur, qui culpam qualiter declinaredebeant sciunt; aut in non gravibus rebus error ignorantiae, quae cuncta etiam post mor-tem gravant, si adhuc in hac vita positis minime fuerint relaxata. Nam cum Paulus dicatChristum esse fundamentum, atque subjungat: Si quis superaedificaverit super hoc funda-mentum, aurum, argentum, lapides pretiosos, ligna, fenum, stipulam; uniuscujusque opusquale sit, ignis probabit; si cujus opus manserit quod superaedificavit, mercedem accipiet;si cujus opus arserit, detrimentum patietur; ipse autem salvus erit, sic tamen quasi perignem (1 Cor 3,1213). Quamvis hoc de igne tribulationis in hac nobis vita adhibitio possitintelligi, tamen si quis hoc de igne futurae purgationis accipiat, pensandum sollicite estquia illum per ignem dixit posse salvari, non qui super hoc fundamentum, ferrum, aes, velplumbum aedificat, id est peccata majora, et idcirco duriora, atque tunc jam insolubilia;sed ligna, fenum, stipulam, id est peccata minima atque levissima, quae ignis facile con-sumat. Hoc tamen sciendum est, quia illic saltem de minimis nihil quisque purgationisobtinebit, nisi bonis hoc actibus in hac adhuc vita positus, ut illic obtineat, promereatur(Gregory the Great, Dialogi de vita et miraculis patrum Italicorum et de aeternitate ani-marum, IV,39). Cf. Gregory the Great, Dialogi de vita et miraculis patrum Italicorum et deaeternitate animarum, IV,55; Gregory the Great, In septem psalmos poenitentiales expositio,Expositio Tertii Pslami, 1; Gregory the Great, Moralium Libri XXXV, I,5,8; Caesarius of Arles,Sermo 3. De Paschate; Petrus Lombardus, Sententiae in IV libris distinctae, IV,dist. 4350;St Bonaventure, Commentaria in Quatuor Libros Sententiarum, IV, dist. xx, p. 1, a.1, qq. iiv;Anselm, Cur Deus Homo, II; Alulfus Tornacensis, Expositio Novi Testamenti. Expositio superprimam epistolam B. Pauli ad Corinthios, c. 12; Hugh of St Victor, De Sacramentis, II,16,4; StBernard, Sermones de diversis, XLII. De quinque negotiationibus et quinque regionibus, 5.For a discussion, see: R.R. Atwell, From Augustine to Gregory the Great. An Evaluation ofthe Emergence of the Doctrine of Purgatory, in JEH 38 (1987), pp. 17386; Foxhall Forbes,Diuiduntur in Quattuor, pp. 65984; Aaron Milavec, The Birth of Purgatory. Evidence ofthe Didache, in Proceedings 12 (1992), pp. 91104; Gerhard Ludwig Muller, Purgatory, inTheology Digest 33 (1986), pp. 3136; Robert Ombres, Images of Healing. The Making of theTraditions Concerning Purgatory, in Eastern Churches Review 8 (1976), pp. 12838; ThodoreSilverstein, Visio Santi Paul. The History of the Apocalypse in Latin, Together with NineTexts. London: Christophers, 1935.108 chapter two
different conclusions with regard to the nature of the soul. While Avi-cenna held to the immortality of the individual soul, Averroes rejectedit. Their writings were translated into Latin and they gave an impetus tonew speculations about the fate of the dead and led to the renewed inter-est in Aristotelianism.141 This interest was exemplified by the Averroes-tic schools and philosophers.142 Conversely, theologians such as Williamof Auvergne (11901249) tried to rescue Aristotle from the Arabians.143
141The common claim that Aristotle and Plato had been lost for the West but theirscholarship was preserved and reintroduced through Arabic translations is not entirelytrue. Most of Aristotles works were translated directly from the Greek (e.g. by Williamof Moerbeke; c.121586), and only exceptionally by way of an Arabic intermediary. PlatosRepublic, the only work preserved in Arabic translation, was not translated into Latin. InEngland, Aristotle was read in the original by Robert Grosseteste (c.11751253) and RogerBacon (c.121494). Nonetheless, the Latin translation of the Arabic commentaries on theArabic translations based on some Syriac or Hebrew version of the Greek text did give animpetus to Western interest in Aristotle. Cf. Bernard G. Dod, Aristoteles Latinus, in Nor-man Kretzmann, The Cambridge History of Later Medieval Philosophy from the Rediscoveryof Aristotle to the Disintegration of Scholasticism, 11001600, Cambridge: UP, 1982, pp. 4579;Peter Dronke, A History of Twelfth-Century Western Philosophy, Cambridge: UP, 1988;Fernand Van Steenberghen, The Philosophical Movement in the Thirteenth Century, Edin-burgh: Nelson, 1955. 142E.g. Siger of Brabant (Sygerius c.124080) and Boethius of Dacia (fl. 13th century)who claimed that the resurrection of the body was philosophically impossible but admittedby faith (cf. the Averroistic principle of double truth). See: Fernand Van Steenberghen,Les oeuvres et la doctrine de Siger de Brabant, Brussels: Palais des Acadmies, 1938; Mar-tin Grabmann, Die Sophismataliteratur des 12. und 13. Jahrhunderts mit Textausgabe einesSophisma des Boetius von Dacien. Ein Beitrag zur Geschichte des Einwirkens der aristotelis-chen Logik...mittelalterlichen philosophischen Disputation, (Beitrge zur Geschichte derPhilosophie und Theologie des Mittelalters. Texte und Untersuchungen 36, 1), Mnster:Aschendorff, 1940; Zdzislaw Kuksewicz, De Siger de Brabant Jacques de Plaisance. Lathorie de lintellect chez les Averroistes latins des XIIIe et XIVe sicles, Wroclaw: Ossolineum,1968; Pierre Mandonnet, Siger de Brabant et lAverrosme latin au XIIIme sicle, Geneva:Slatkine, 1976; Roland Hissette, Enqute sur les 219 articles condamns Paris le 7 mars 1277,(Philosophes mdivaux 22), Louvain: Publications Universitaires de Louvain, 1977; Boet-ius of Dacia, The Sophisma Every Man Is of Necessity an Animal, in Norman Kretzmann &Eleonore Stump (eds. & trans.), The Cambridge Translations of Medieval Philosophical Texts.vol. 1 Logic and the Philosophy of Language, Cambridge: UP, 1988; Sigerius de Brabantia, Dedubbele waarheid, notes by Henri Krop, (Geschiedenis van de wijsbegeerte in Nederland 1),Baarn: Ambo, 1992. 143On William of Auvergnes position on issues concerning afterlife, see: GeorgBlow (ed.), Des Dominicus Gundissalinus Schrift von der Unsterblichkeit der Seele nebsteinem Anhnge, enthaltend die Abhandlung des Wilhelm von Paris (Auvergne) De immor-talitate animae, (Beitrge zur Geschichte des Philosophie des Mittelalters 2,3). Mnster:Aschendorff, 1897; Joseph Kramp, Des Wilhelms von Auvergne Magisterium divinale,in Gregorianum 1 (1920), pp. 538613; Gregorianum 2 (1921), pp. 42103 and pp. 17495;Alfred Vanneste, Nature et grce dans la thologie de Guillaume dAuxerre et de GuillaumedAuvergne, in ETL 53 (1977), pp. 83106; Alan E. Bernstein, Esoteric Theology. Williamof Auvergne on the Fires of Hell and Purgatory, in Speculum 57 (1982), pp. 50931; AlanE. Bernstein, Theology between Heresy and Folklore. William of Auvergne on Punishment post-mortem existence prior to the reformation 109
His position on the purgatorial fire and Hell was to help shape the Reformersposition. According to him, Hell is a place where nothing detracts fromthe torment of the damned (nihil in inferno vacet a tormento eorum, quicreatori placere et servire recusaverunt), and where all of the sins ever com-mitted against God are perfectly avenged.144 He believed that the fear ofinfernal punishment was a great social utility because it deterred sinnersfrom sinning.145 The pains of Purgatory, on the other hand, will completethe expiation of those sins not fully atoned for in life. Thus the pains ofpurgatory have their beginnings in the anguish of penance, which, if itis not completed in life, is perfected in purgatory.146 Since this processof purification begins with penance and ends in the pains of Purgatory,William held that Purgatory, too, has a deterrent effect, as the fear of pur-gatorial pains induces sinners to repent sooner and to complete their pen-ance in this life.147 William maintained that the pains of Purgatory and thetorments of Hell that affect the separated souls are to be understood as
after Death, in Studies in Medieval and Renaissance History 5 (1982), pp. 344; StephenMarrone, William of Auvergne and Robert Grosseteste. New Ideas of Truth in the Early Thir-teenth Century, Princeton: UP, 1983; William of Auvergne, The Immortality of the Soul [DeImmortalitate animae], trans. Roland Teske, (Medieval Philosophical Texts in Translation,30), Milwaukee: Marquette UP, 1991. 144William of Auvergne, De universo corporali et spirituali, I, 100 (p. 665(673)b C);cf. William of Auvergne, De moribus, p. 211a C. His collected works were published in:William of Auvergne, Guilielmi Alverni, episcopi Parisiensis,..., Opera omnia, quae hactenusimpressa potuerunt, tomis duobus contenta, reconditissimam rerum humanarum, ac divi-narum doctrinam abund complectentia, ac proinde bonarum artium, ac scientiarum studio-sis, maxim ver theologis, ac divini verbi concionatoribus, apprim necessaria/ nunc demumin hac posteriori editione ab innumeris errorum chiliadibus expurgata, instaurata, elucidata,atque fide integra ad authoris sensum recognita, ut ex praefatione ad lectorem aperius intel-ligetur per Ioannem Dominicum Traianum Neapolitanum., Venetiis: Ex Officina DamianiZenari, 1591. Modern reprint is based on the 1674 Paris edition: William of Auvergne, Operaomnia, Frankfurt, 1963. Page numbers refer to the latter edition. 145Credulitas ipsius [inferni] utilis est valde, et errores circa ipsum noxij, et impe-dientes correctiones hominum a vitiis suis, et perversitate morum suorum (William ofAuvergne, De universo corporali et spirituali, p. 665(673)a B). 146Bernstein, Esoteric Theology, p. 511. Cf. William of Auvergne, De universo corporaliet spirituali, p. 678a H. 147Manifestum est in quibusdam animabus multa restare purganda post mortem cor-porum suorum, antequam purgationem hic compleverint, quae poenitentia est secundumdoctrinam Christianam [...] Necesse est restare, ut compleant id, quod restat, et deest depurgatione sua; quare et locus, ut haec fiant, necessarius est, et hic est, quem purgatoriumdicunt (William of Auvergne, De universo corporali et spirituali, p. 676b G). Multas poeni-tentias in vita ista non compleri, quapropter necesse est, ut post hanc vitam compleantur(William of Auvergne, De universo corporali et spirituali, p. 677b C). Necesse est eas per-ficere in vita illa coeptam in praesenti expurgationem (William of Auvergne, De universocorporali et spirituali, p. 677b D).110 chapter two
corporeal fire.148 Yet, this fire is not comparable to the physical fire of thisworld, for this post-mortem fire torments the soul but does not consumethe body. It is the metaphorical fire of passion, desire, anguish. Williamdid not use the term metaphor, but he stated that there is no actual fireor heat in the soul.149 Just as God could send fire and brimstone to pun-ish Sodom and Gomorrah (Gen. 19:24) and could punish the pharaoh andhis people with fire (Ex. 9:23), it is possible for God to create a fire thatavenges all of the injuries ever committed against him, William argued.150And just as God could address Moses in a fire that did not consume theburning bush (Ex. 3:2), William maintained, God could also create a firethat can torment the souls of the wicked and avenge their sins.151 The most elaborate and systematic treatment of questions concerningthe afterlife in this Aristotelian revival is found in the Summa Theologicaof Saint Thomas Aquinas (c.122574), which became the standard doc-trine for centuries.152 He thoroughly incorporated Aristotles philosophy
148Non igitur abhorreant, aut mirentur, si ignis corporalis aliquis est, qui animas huma-nas et in corporibus, et a corporibus separatas torquere valeat (William of Auvergne, Deuniverso corporali et spirituali, p. 680b F). 149Bernstein, Esoteric Theology, p. 513. 150Si pluvia ignis, et sulphuris creata fuit a justissimo creatore propter vindicandamDei pariter, et naturae injuriam, et contumeliam in gentes sodomorum: quanto fortiuspropter omnes injurias, et contumelias Dei altissimi fuit creatus ignis, qui universaliteromnes vindicet? (William of Auvergne, De universo corporali et spirituali, p. 680b G). 151 Si juxta legem Hebraeorum igni qui prophetae ipsorum in rubo apparuit, vel datum,vel ablatum est contra naturam suam propriam, et ipsius rubi, vel forsitan novus ignistalis ab omnipotente creatore creatus est tunc, materiam combustibilem, in qua esset, noncombureret, quomodo non verisimile est, ut propter exercendam tantam Dei justitiamtalis ignis creatus sit, qui torquere possit animas impiorum, et vindicare in eis injurias Deoaltissimo irrogatas? (William of Auvergne, De universo corporali et spirituali, p. 680b G). 152In 1312 the constitution Fidei catholicae of the General Council of Vienne rejected allviews that denied that the rational soul is the form of the body: Porro doctrinam omnemseu positionem temere asserentem, aut vertentem in dubium, quod substantia animaerationalis seu intellectivae vere ac per se humani corporis non sit forma, velut erroneamac veritati catholicae inimicam fidei, praedicto sacro approbante Concilio reprobamus:definientes, ut cunctis nota sit fidei sincerae veritas ac praecludatur universis erroribusaditus, ne subintrent, quod quisquis deinceps asserere, defendere seu tenere pertinaciterpraesumpserit, quod anima rationalis seu intellectiva non sit forma corporis humani perse et essentialiter, tamquam haereticus sit censendus (DH 902 (DS 481)). On the viewsof Thomas Aquinas on the afterlife, see: Johannes Mundhenk, Die Seele im System desThomas von Aquin. Ein Beitrag zur Klrung und Beurteilung der Grundbegriffe der thomis-tischen Psychologie, Hamburg: Meiner, 1980; Robert Ombres, The Doctrine of PurgatoryAccording to St. Thomas Aquinas, in The Downside Review 99 (1981), pp. 27987; RobertPasnau, Thomas Aquinas on Human Nature. A Philosophical Study of Summa Theologiae 1a7589, Cambridge: UP, 2002; Peter Joseph, The Risen Body in St Thomas Aquinas Scriptumsuper sententiis and Summa contra gentiles, doct. diss. Pontificia Universitas Gregoriana,Facultas Theologiae, Roma, 2003. post-mortem existence prior to the reformation 111
into his own theology. According to Thomas, the human person is theunity of soul and body: the body is the matter and the soul is the form ofthe human person, according to the Aristotelian system of hylomorphism.153The soul, however, is incorruptible; it does not die at death but survivesthe body and retains its rational functionality.154 This separate state of thesoul from the body is not a natural state, because the soul is an incompletereality without the body.155 Therefore, the soul has a natural tendency tounite with the body, and in the interim the soul awaits the resurrection,when it will be completed. Upon death, the soul is judged immediatelyin a particular judgement, which determines its fate during the interimbetween death and the final resurrection at the end of the world: Heavenor Hell, unless it needs to be cleansed.156 Those who are already purified inlife enter immediately into the visio beatifica. They can obtain favours forthe living; hence, Aquinas recommended praying to them for their inter-cession.157 Those who are in need of purification from the effects of venialsins or the temporal punishments of their remitted sins are purged beforethey are allowed into the beatific vision. During their purgation, souls canbe assisted by prayer or the Eucharist celebrated on their behalf.158 Thedamned enter into the fires of Hell upon the particular judgement. Theirlot is irreversible; the damned cannot be helped. There is another categoryof dead for Aquinas: those who died before the coming of Christ and theinfants who die without baptism. Since baptism is necessary for salvation,they cannot enter into the beatific vision, but they are not damned either.Aquinas believed that these individuals are in a special place situated atthe verge of Hell; hence, he called it Limbo (limbus). The saints of theOT had been kept in Limbus Patrum since their death, whence they wereliberated by Christs coming, while the unbaptised children will stay in
153Thomas Aquinas, Summa Theologica, I. qu. 75. art. 17; qu. 76, art. 18. 154Thomas Aquinas, Summa Theologica, I. qu. 75. art. 6. 155Thomas Aquinas, Summa Theologica, Suppl. qu. 75. art. 13. Cf. Thomas Aquinas,Summa Contra Gentiles, IV,79. The Supplement intended to complete the Summa, is puttogether with scissors and paste from pieces cut out of Aquinass writings on the Sentences[of Petrus Lombardus] (especially Bk. 4) (James A. Weisheipl, Friar Thomas dAquino,Washington (DC): Catholic UP of America, 2corr. and add.1983), p. 362). Nevertheless, theSupplement was perceived in the 16th century as an authentic representation of ThomasAquinas ideas. 156Thomas Aquinas, Summa Theologica, Suppl. qu. 69. art. 2. Cf. Thomas Aquinas,Summa Contra Gentiles, IV,91. 157Thomas Aquinas, Summa Theologica, Suppl. qu. 72. art. 13. Cf. Thomas Aquinas,Summa Contra Gentiles, IV,91. 158Thomas Aquinas, Summa Theologica, Suppl. qu. 71. art. 114. Cf. Thomas Aquinas,Summa Contra Gentiles, IV,91.112 chapter two
Limbus Infantium eternally.159 At the end of the world, Christ judges thewhole of humankind at the general judgement.160 The whole world willbe renewed, and the resurrected body will be immortal and incorrupt-ible. After the resurrection no further purgation is possible. The bliss ofthe blessed will be even greater, for their souls will be united with theirbodies.161 The damned will be eternally committed to Hell, which lies beneath the earth.162 Thomas Aquinas position on the threefold destiny of the soul after death and the solidarity between the Churches Militant, Suffering, and Triumphant is closely connected to his soteriology, ethics, hamartiology, and sacramentology.163 Thomas, rooted in medieval Scholastic theology, differentiated between the twofold effect of sin: guilt (culpa) and pun- ishment (poena).164 A further distinction was made between mortal (pec- catum mortale) and venial (peccatum veniale) sins.165 In the sacrament of penance, three acts are involved: contrition (contritio cordis), confes- sion (confessio oris), and satisfaction (satisfactio operis).166 By Gods grace,
159Thomas Aquinas, Summa Theologica, Suppl. qu. 69. art. 46. Although the Catechismof the Catholic Church (1992) still left the question open (cf. nos. 125761), the InternationalTheological Commission, originally commissioned by Pope John Paul II, states that themany factors that we have considered [...] give serious theological and liturgical groundsfor hope that unbaptized infants who die will be saved and enjoy the beatific vision.Nonetheless, it emphasizes that these are reasons for prayerful hope, rather than groundsfor sure knowledge (The Hope of Salvation for Infants Who Die without Being Baptized, ITC,April 22, 2007). 160Thomas Aquinas, Summa Theologica, III. qu. 59. art. 5; qu. 88. art. 1. Cf. ThomasAquinas, Summa Contra Gentiles, IV,96. 161 Thomas Aquinas, Summa Theologica, Suppl. qu. 93. art. 1. Cf. Summa Contra Gentiles,III,61. 162Thomas Aquinas, Summa Theologica, Suppl. qu. 97. art. 7; qu. 99. art. 3. 163See: William A. van Roo, Grace and Original Justice according to St. Thomas, (Ana-lecta Gregoriana 75; Analecta Gregoriana. Series Facultatis Theologicae. Sectio A 13) Rome:Universitas Gregoriana, 1955; Romanus Cessario, Christian Satisfaction in Aquinas, Wash-ington (DC): UP America, 1982; Romanus Cessario, The Godly Image. Christ and Salvationin Catholic Thought from Anselm to Aquinas, (Studies in Historical Theology 6), Petersham:St Bedes Publications, 1990; Romanus Cessario, St. Thomas Aquinas on Satisfaction, Indul-gences, and Crusades, in Medieval Philosophy and Theology 2 (1992), pp. 7496; M.F. John-son, St. Thomas and the Law of Sin, in Recherches de Thologie et Philosophie Mdivale 67(2000), pp. 90106; Romanus Cessario, Aquinas on Christian Salvation, in Thomas Wein-andy, Daniel Keating & John Yocum (eds.), Aquinas on Doctrine. A Critical Introduction,London: T&T Clark, 2004, pp. 11737. 164Augustine had already differentiated between the two: see supra on p. 99. 165Thomas Aquinas, Summa Theologica, II-I. qu. 88. art. 1. He refers to Augustines dis-tinction between lethal and minute sins. See supra on p. 98. On the Scholastic authors,see supra on p. 107. 166Sic igitur requiritur ex parte poenitentis, primo quidem, voluntas recompensandi,quod fit per contritionem; secundo, quod se subiiciat arbitrio sacerdotis loco Dei, quod post-mortem existence prior to the reformation 113
fit in confessione; tertio, quod recompenset secundum arbitrium ministri Dei, quod fitin satisfactione. Et ideo contritio, confessio et satisfactio ponuntur partes poenitentiae(Thomas Aquinas, Summa Theologica, III. qu. 90. art. 2). 167In baptism, however, both guilt and punishment are washed away: in Baptismo, ubifit plena remissio peccatorum et quantum ad culpam et quantum ad poenam (ThomasAquinas, Summa Theologica, III. qu. 84. art. 1). 168Thomas Aquinas, Summa Theologica, Suppl. qu. 13. art. 2. Cf. satisfactio et est puni-tiva in quantum est actus vindicativae iustitiae, et est etiam medicativa, in quantum estquoddam sacramentale (Thomas Aquinas, Questiones de quolibet, II, qu. 8 art. 2. ad 3). 169Thomas Aquinas, Summa Theologica, Suppl. qu. 15. art. 1. In connection with Aqui-nas speculations about the question of whether a crusader receives full indulgence even ifhe dies before having reached the Holy Land, Cessario rightly remarks that the power ofChrists love works differently in one who is still a member of the church on earth than itdoes in one who has died. The need for spiritual discipline and reformation of life impliesthat the first one must continue on as part of the church on earth, for death marks theend of a persons deliberate involvement in the process of salvation. And since the goodworks of one individual do not appreciate anothers spiritual discipline, Aquinas counselspenance even for the individual who does survive the crusade. Even though the successfulcompletion of the indulgenced work replaces the punitive satisfaction, the crusader stillneeds to do penance for spiritual growth and maturity (Cessario, St. Thomas Aquinas onSatisfaction, Indulgences, and Crusades, p. 94). 170Purgatio animae per poenas purgatorii non est aliud quam expiatio reatus impedi-entis a perceptione gloriae: et quia per poenam quam unus sustinet pro alio, potest rea-tus alterius expiari, ut dictum est, non est inconveniens, si per unius satisfactionem aliuspurgetur (Thomas Aquinas, Scriptum super libros sententiarum magistri Petri LombardiEpiscopi Parisiensis, Lib. IV, Dist. 45, qu 2. art. 2 qucula ad 3). 171Thomas Aquinas, Questiones de quolibet, II, qu. 8 art. 2.114 chapter two
individuals who remain united in the bond of charity with the Church.172But the foundation of indulgences is essentially Christological, for it isultimately the satisfaction of Christ that remains the principal sourceof the thesaurus ecclesiae, because Christs suffering suffices.173 The dis-pensation of this treasure belongs to the Pope because he is the personwho is in charge of the whole Church, since the Lord gave the keys ofthe kingdom of Heaven to Peter (Mt. 16:19).174 The ultimate ground for thepossibility of sharing in the good works associated with Christ andthe saints is the union in charity.175 Accordingly, from a juridical point ofview, indulgences constitute commutations of satisfactory works attachedto particular deeds, such as prayers, pilgrimages, or other burdensomeactions, including the risky and painful undertaking of military combat(i.e. crusades).176 Therefore, an indulgence can replace satisfaction inso-far as it is punitive, because the punishment suffered by someone else isimputed to the person who receives the indulgence, and consequently thedebt of punishment is removed.177 Yet, an indulgence does not replacesatisfaction insofar as it is remedial, since the disposition to sin due toprior sins still remains, the cure for which necessarily requires the worksof satisfaction.178 Aquinas underlines that indulgences are completely
172Thomas Aquinas, Questiones de quolibet, II, qu. 8 art. 2; Thomas Aquinas, SummaTheologica, Suppl. qu. 25. art. 1. On the development of the teaching of the thesaurusecclesiae, see: Carl J. Peter, The Churchs Treasures (Thesauri Ecclesiae) Then and Now, inTheological Studies 47 (1986), pp. 25172. On Aquinas understanding of merit, see: JosephWawrykow, On the Purpose of Merit in the Theology of Thomas Aquinas, in Medieval Phi-losophy and Theology 2 (1992), pp. 97116. 173Nec ad hoc requiritur aliquis labor; quia sufficit labor passionis Christi (ThomasAquinas, Questiones de quolibet, II, qu. 8 art. 2 ad 3). See also: Thomas Aquinas, SummaContra Gentiles IV,55. Cf. Cessario, St. Thomas Aquinas on Satisfaction, Indulgences, andCrusades, pp. 91 and 9596. 174Thomas Aquinas, Questiones de quolibet, II, qu. 8 art. 2; Thomas Aquinas, SummaTheologica, Suppl. qu. 25. art. 1. 175Omnes qui sunt in caritate, sunt quasi unum corpus; et ita bonum unius redundatin omnes, sicut manus deservit toti corpori, et similiter quodlibet corporis membrum(Thomas Aquinas, Questiones de quolibet, II, qu. 7 art. 2). Cf. Ratio autem quare valerepossunt, est unitas corporis mystici, in qua multi operibus poenitentiae supererogaveruntad mensuram debitorum suorum et multas etiam tribulationes injuste sustinuerunt, perquas multitudo poenarum poterat expiari (Thomas Aquinas, Scriptum super libros senten-tiarum, Lib. IV, Dist. 20, qu. 1, art. 3 qucula 1). 176Cessario, St. Thomas Aquinas on Satisfaction, Indulgences, and Crusades, pp.8283. 177Indulgentia ergo supplet locum satisfactionis, in quantum est punitiva: quia scilicetpoena quam alius sustinuit, imputatur isti ac si ipse sustinuisset, et ideo reatus poenaetollitur (Thomas Aquinas, Questiones de quolibet, II, qu. 8 art. 2 ad 3). 178[Indulgentia] non succedit in locum satisfactionis in quantum est medicativa, quiaadhuc remanent pronitates ad peccandum derelictae ex priori peccato, ad quas sanandas post-mortem existence prior to the reformation 115
useless for those who have committed a mortal sin and have not repented,for true contrition and confession are demanded as conditions sine quanon for gaining all indulgences; they only benefit those who have exer-cised contrition and confessed their sins.179 He also stresses the pointthat only God can forgive the offence of sin (culpa). Therefore, when thePope gives a plenary indulgence, this indulgence should not be applied tothe offence (culpa), but only to the totality of punishments (poena): forexample, the man who accepted the crusaders cross will not suffer pun-ishment (poena) for his sins, provided that he had achieved the full remis-sion of the offence of sin (culpa) through contrition and confession.180 Inshort, three conditions have to be met for an indulgence to be beneficialand valid: (1) the work must involve a cause pertaining to the honour ofGod or the needs of the Church; (2) the indulgence must be establishedby a duly constituted authority; (3) the one who receives the indulgencemust already enjoy that union of charity in which the whole reality of thechurch consists.181 Although Aquinas theology of indulgences represented the orthodoxposition and was repeatedly confirmed by ecclesiastical authorities, hisChristological foundation and soteriological perspective were lost onmany Christians of his age and of subsequent centuries, and indulgenceswere reduced in practice to a mercantile view of redemption as a spiri-tual deposit-and-withdrawal system for building up heavenly merits, asif they were so much interest in a bank account.182 At first, indulgenceswere dispensed to those who did penitential works, of which the mostcommendable was almsgiving, expressing the solidarity of the believers.183In order to distribute alms most effectively, official managers of indul-gences, so-called questors (pardoners in popular parlance) were appointed
necessarius est labor satisfactionis (Thomas Aquinas, Questiones de quolibet, II, qu. 8 art.2 ad 3). 179Thomas Aquinas, Summa Theologica, Suppl. qu. 27. art. 1. 180Thomas Aquinas, Questiones de quolibet, II, qu. 8 art. 2 ob.1. 181Cessario, St. Thomas Aquinas on Satisfaction, Indulgences, and Crusades, pp.8788. 182Cessario, St. Thomas Aquinas on Satisfaction, Indulgences, and Crusades, p. 77. 183[Da] te igitur elemosinam ut omnia munda sint vobis, quia elemosina a morte lib-erat, peccata purgat, et facit invenire vitam aeternam. Sicut aqua ignem ardentem extingit,ita elemosina peccato resistit (J.T. Fowler (ed.), Memorials of the Church of SS. Peter andWilfrid, Ripon, vol. 2, (Publications of the Surtees Society 88), Durham: Surtees Society,1886, p. 83). On the historical development of indulgences, see: Francis Edward Hagedorn,General Legislation on Indulgences, (The Catholic University of America. Canon Law Stud-ies 22), Washington (DC): Catholic UP of America, 1924; Bemhard Poschmann, Der Ablaim Licht der Bugeschichte, Bonn: Peter Hanstein, 1948; Alfred L. Kellogg & Louis A.Haselmayer, Chaucers Satire of the Pardoner, in PMLA 66 (1951), pp. 25177.116 chapter two
whose job was to collect alms and redistribute it among the most needy.Questors were not allowed to absolve sins (remit culpa), only to dispenseindulgences for the temporal punishment (poena) of confessed sins. Norwere they allowed to sell indulgences, but only to collect alms in orderto redistribute them to the widest circle of beneficiaries. Abuses, how-ever, developed throughout the centuries, and pardoners were reportedto have claimed impertinently to absolve a culpa et a poena.184 Althoughseveral pieces of legislation were passed to eradicate abuses, ecclesiasticalauthorities had trouble carrying these out, especially when charity work,the financial interest of the Church, or the realization of valuable ventures(e.g. the building of hospitals, bridges, or churches) was concerned.185 But it was not just the practice of indulgences that was problematic.During the Middle Ages several individuals and groups with heterodoxbeliefs arose who questioned the teachings of the Church on the post-mortem existence. The Waldensians or Poor Men of Lyons (followers ofPeter Waldo or Pierre de Vaux, d. 1218) denied the existence of Purgatoryand the validity of suffrages for the dead, and they apparently doubtedthe resurrection of the flesh and that the risen Christ truly ate and drankin the same flesh in which he ascended into Heaven.186 The Gnosticallyinspired movements of Paulicians (7th8th c.), Bogomils (10th c.), andCathars (Albigensians; 11th13th c.), with a strong Manichaean dualisticview, regarded the material world as the creation of a lesser God, and thus
despised the body, from which the soul had to be freed. They believed thatChrist had no real body and did not die or rise. Other Cathars held thatChrists body was left behind at the ascension and rotted away.187 Theyalso rejected Hell and Purgatory, held that the veneration of the saints andrelics was idolatry because the body will never rise, and adopted the ideaof the transmigration of souls.188 The Amauricians (or Almaricians, follow-ers of Amaury of Bne d. c.1206) denied the reality of the body (in fact, theydenied the reality of anything except the spirit), and accordingly allowedall sorts of license to the body and claimed that the Holy Spirit was theresurrection.189 Similar ideas were held later by the heretics of Free Spirit.In 1270 the University of Paris condemned thirteen propositions, includ-ing the corruption of the soul (as a form of the human person) at deathand the denial of the possibilities that the separated soul could suffer fromcorporeal fire and that God can give incorruptibility and immortality tocorruptible and mortal beings.190 In England the Lollardsthe followersof John Wycliffe (c.132484)and in Central Europe the Hussitesthefollowers of John Huss (c.13701415)called into question the venerationof the saints.191 Although Wycliffe accepted the need for a post-mortempurgation of the souls, he contested that it could be localized. The first part of the 14th century even witnessed a papal heresy, whenthe opinion of Pope John XXII (12491334) on the beatific vision and thepost-mortem fate of the soul caused theological controversy.192 Starting on
All Saints Day in 1331, the Pope expressed his position in six sermons givenover the course of several years (133133) that the souls of the righteousgo into Abrahams bosom, or sub altari Dei, and do not enjoy the beatificvision (visio facie ad faciem) of the Lord until after the Last Judgement andthe resurrection of their bodies.193 His suggestion, never expressed as anex cathedra teaching, could be understood as an implicit questioning ofthe possibility of the intercessions of saints and scandalized the sensumfidei of most of his contemporaries enciting reactions all over Europe.194Counter to the Pope, twenty-nine theologians of the Faculty of Theologyof Sorbonne declared that the souls of the blessed were indeed elevatedto the beatific vision immediately after death (2 January 1334).195 Other
Do SulPucrs, Porto Alegre: s.n., 2004, p. 14, n. 15). On the views of Pope John XXIIand the controversy about the beatific vision, see also: Decima Douie, John XXII and theBeatific Vision, in Dominican Studies 3 (1950), pp. 15474; Anneliese Maier, Zwei unbekannteStreitschriften gegen Johann XXII. aus dem Kreis der Mnchener Minoriten, in Archivum His-toriae Pontificiae 5 (1967), pp. 4178; Anneliese Maier, Schriften, Daten und Personen ausdem Visio-Streit unter Johann XXII., in Archivum Historiae Pontificiae 9 (1971), pp. 14386;John XXII, Nouveaux textes de Jean XXII sur la Vision batifique, in RHE 66 (1971), pp. 40111;Marc Dykmans, Les sermons de Jean XXII sur la vision batifique. Texte prcd dune intro-duction et suivi dune chronologie de la controverse avec la liste des crits pour et contre lepape, (Miscellanea Historiae Pontificiae 34), Rome: Presses de lUniversit Grgorienne,1973; Josep Gil, La benaurana del cel i lordre establert. Aproximaci a lescatologia de laBenedictus Deus, Barcelona: Herder, 1984; Christian Trottmann, Deux interprtations con-tradictoires de Saint Bernard: les sermons de Jean XXII sur la vision batifique et les traitsindits du cardinal Jacques Fournier, in Mlanges de lcole franaise de Rome 105 (1993), pp.32779; Christian Trottmann, La vision batifique. Des disputes scolastiques sa dfinitionpar Benot XII, (Bibliothque des coles franaises dAthnes et de Rome, 289), Rome: colefranaise de Rome, 1995; Eva Luise Wittneben, Bonagratia von Bergamo. Franziskanerjurist und Wortfhrer seines Ordens im Streit mit Papst Johannes XXII, (SMRT 90), Leiden:Brill, 2003, passim, esp. pp. 37077. 193Animae ergo sanctae ante diem iudicii sunt sub altare, id est, sub consolatione etprotectione humanitatis Christi; sed post diem iudicii ipse elevabit eas, ut videant ipsamdivinitatem et secundum hoc dicentur ascendere supra altare (John XXII, Sermo in Fes-tivitate Omnium Sanctorum, II, 7 in Dykmans, Les sermons de Jean XXII sur la vision bati-fique, p. 96)). 194Trottmann, Deux interprtations contradictoires, p. 327. The Pope did not call intoquestion the private judgement or the consciousness of the souls after death but pro-posed that the reward or punishment of the deceased will only be attributed when thesouls are joined with their bodies. Cf.: Joan XXII va sostenir, els ltims anys de la sevavida, una lluita aferrisada per a defensar una opinila seva opini com a telegsobrelajornament de la visi beatfica dels benaurats fins el Dia del Judici Universal. Per a situarcorrectament lanomenada opini de Joan XXII, cal comenar dient que el papa mai nohavia dubtat del judici immediat a la mort i dun comenament de recompensa o de cstig(cel o infern) per als qui moren en grcia de Du o en pecat mortal (Gil, La benauranadel cel i lordre establert, p. 47). 195The theologians were of the opinion that the Pope should have propounded hisdoctrine only recitando, and not determinando, asserendo, seu etiam opinando. JohnXXII assembled his consistory to reply to the Paris theologians. They regarded the Popes post-mortem existence prior to the reformation 119
answer as a sign of papal absolutism, spoke of the new heretic, Jacques de Cahors, andreiterated emphatically their demands for the convocation of a general council to try thePope, which was prevented by the death of the Pope (Dykmans, Les sermons de Jean XXIIsur la vision batifique, p. 186). 196 Trottmann, Deux interprtations contradictoires, pp. 32728. 197 Animae purgatae separatae a corporibus sunt in caelo, caelorum regno et paradisoet cum Christo in consortio angelorum congregatae et vident Deum de communi lege acdivinam essentiam facie ad faciem clare, in quantum status et condicio compatitur animaeseparatae (Ne super hiis (sic) (DH 99091)). 198Georgius Pletho (alias Gemistus) sparked the interest of the Italian Humanists of thequattrocento in the study of Plato, and according to Marsilio Ficino, Pletho was behind thefoundation of the famous Platonic Academy by Cosimo de Medici. On his life and works,see: C.M. Woodhouse, George Gemistos Plethon. The Last of the Hellenes, Oxford: Claren-don, 1986; Polymnia Athanassiadi, Byzantine Commentators on the Chaldaean Oracles.Psellos and Plethon, in Katerina Ierodiakonou (ed.), Byzantine Philosophy and Its AncientSources, Oxford: UP, 2002, pp. 23752; George Karamanolis, Plethon and Scholarios onAristotle, in Ierodiakonou, Byzantine Philosophy and Its Ancient Sources, pp. 25382. 199Bernadette Lagarde, Le De Differentiis de Plthon dprs lautographe de la Marci-enne, in Byzantion 43 (1973), p. 321. 200See Paul Oskar Kristeller, Eight Philosophers of the Italian Renaissance, Stanford:UP, 1966; Giovanni Di Napoli, Limmortalit dellanima nel Rinascimento, Turin: Societeditrice internazionale, 1963.120 chapter two
Renaissance.201 The main work of the Italian Humanist was his TheologiaPlatonica. De animarum Immortalitate, published in 1482 in Florence, inwhich he argues for the immortality of the soul based on his ChristianizedNeo-Platonic view.202 Following Pletho, Ficino opposed the Averroistsdenial of personal immortality.203 Death is the liberation of the immortalsoul from the body (mors est animae a corpore liberatio), he argued.204 Thelife after this life is a continuation of the earthly life: after death, the soulpreserves its inclination as reward or punishment.205 Despite his dualisticNeo-Platonist anthropology, Ficino also embraced the idea of the resur-rection of the body. This, in his understanding, is by no means the revivalof the earthly body but the re-creation of a most pure body (purissimumcorpus) at the end of the world.206 In 1516, Pietro Pomponazzis Tractatus de immortalitate anim (Bolo-gna, 1516) also addressed the question of immortality.207 Pomponazzidenied the possibility that the immortality of the soul could be proved on
201 Ficino translated many Greek authors, mainly Neo-Platonists, into Latin: amongothers, Hesiod, Homer, Plotinus, Porphyry, and Pythagoras. Most importantly, he preparedthe first complete translation of the extant works of Plato into Latin, which was in useuntil the 19th century. Ficino held Plato to be a precursor of Christ whose works shouldbe read in church. On his life and philosophy, see: Nesca A. Robb, Neoplatonism ofthe Italian Renaissance, New York: Octogon Books, 1968; Kristeller, Eight Philosophers ofthe Italian Renaissance; Michael J.B. Allen, Valery Rees & Martin Davies (eds.), MarsilioFicino. His Theology, His Philosophy, His Legacy, (BSIH 108), Leiden: Brill, 2002. 202Marsilio Ficino, Theologia Platonica. De animarum Immortalitate, in modern edi-tion: Thologie platonicienne de limmortalit des mes, 3 vols., ed. and trans. RaymondMarcel, Paris: Les Belles Lettres, 196470. 203On Ficinos eschatological views, see: Jrg Lauster, Marsilio Ficino as a ChristianThinker, in Allen, Marsilio Ficino. His Theology, His Philosophy, His Legacy, pp. 4569,esp. 6467; Charles Trinkaus, In Our Image and Likeness. Humanity and Divinity in ItalianHumanist Thought, (Ideas of Human Nature Series), Chicago: UP, 1970, pp. 46875; MichaelJ.B. Allen, Marsilio Ficino on Plato, the Neoplatonists and the Christian Doctrine of the Trin-ity, in RQ 37 (1984), pp. 55584. 204Ficino, Theologia Platonica, I,8. (ed. Marcel III, p. 143). 205Ficino, Theologia Platonica, XVI,8. (ed. Marcel XVIII, p. 227). See also: Lauster,Marsilio Ficino as a Christian Thinker, p. 65. 206Ficino, Theologia Platonica, XVI,8. (ed. Marcel XVIII, p. 227). 207For the views of the Italian Pietro Pomponazzi (Pomponatius, alias Peretto, 14621525), see: A.H. Douglas, The Philosophy and Psychology of Pietro Pomponazzi, Cambridge:UP, 1910 [facsimile reprint, Hildesheim: Olms, 1962]; E. Gilson, Autour de Pomponazzi:problmatique de limmortalit de lme en Italie au dbut du XVIe sicle, in ArchivesdHistoire Doctrinale et Litteraire du Moyen ge, 36 (1969), pp. 163279; E. Kessler, TheIntellective Soul, in C.B. Schmitt, Q. Skinner, E. Kessler & J. Kraye (eds.), The CambridgeHistory of Renaissance Philosophy, Cambridge: UP, 1991, pp. 485534; E. Kessler, PietroPomponazzi. Zur Einheit seines philosophischen Lebenswerk, in T. Albertini (ed.), Verumet factum. Beitrge zur Geistesgeschichte und Philosophie der Renaissance zum 60. Geburstagvon Stephan Otto, Frankfurt a.M.: Peter Lang, 1993, pp. 397420. post-mortem existence prior to the reformation 121
of the soul. In his bull in 1254 Pope Innocent IV (pope 124354) gave thefirst official designation Purgatorium to the place of purgation and dif-ferentiated it from Hell as a destination, depending on whether one diedin mortal sin with or without the satisfaction of penance (animas illorum,qui, suscepta paenitentia, ea non peracta, vel qui sine mortali peccato, cumvenialibus tamen et minutis decedunt).214 Innocent refers to Mt. 12:32 and1 Cor. 3:1315 as the biblical proofs for the existence of purgatorial fire,which, as he points out, is also held by the Orthodox Church (ipsi Graecivere ac indubitanter credere ac affirmare dicantur). The souls in Purgatorycan be helped by suffrages (posse suffragiis Ecclesiae adiuvari). Yet, capitalcrimes cannot be cleansed, and the souls who died without penitence willbe eternally tormented (aeternae gehennae ardoribus perpetuo cruciatur).But the souls of baptized children and those having died in the state ofgrace pass immediately into the eternal home (ad patriam protinus trans-volant sempiternam).215 In 1274, the Council of Lyons repeated the assig-nation of the souls to Heaven, Purgatory, or Hell immediately after death.The Council confirmed the efficacy of suffrages, masses, prayers, and almsin helping the souls in Purgatory.216 On the Day of Judgement everyonewill have to appear before the tribunal of Christ with their resurrectedbodies to render an account of what they have done.217 In 1312, the Councilof Vienne stated that the intellectual soul is the form of the body.218 Thesuccessor of Pope John XXII, Benedict XII (pope 133442), reiteratedthe position taken in his predecessors final statement of retraction in thebull Benedictus Deus (29 January 1336), and decreed definitely (in perpetuumvalitura Constitutione auctoritate Apostolica diffinimus) that purified soulsenjoy the beatific vision immediately, even before the general judgement(etiam ante resumptionem suorum corporum et iudicium generale).219 Theyare in Heaven with Christ and the angels (sunt et erunt in caelo, caelorumregno et paradiso caelesti cum Christo, sanctorum Angelorum consortio con-gregatae), where the divine essence immediately manifests itself plainly,
214Nos, quia locum purgationis huiusmodi dicunt non fuisse sibi ab eorum doctoribuscerto et proprio nomine indicatum, illum quidem iuxta traditiones et auctoritates sancto-rum Patrum Purgatorium nominantes volumus, quod de cetero apud ipsos isto nomineappelletur (DH 838 (DS 456)). 215DH 839 (DS 457). 216Ad poenas huiusmodi relevandas prodesse eis fidelium vivorum suffragia, Mis-sarum scilicet sacrificia, orationes et eleemosynas et alia pietatis officia, quae a fidelibuspro aliis fidelibus fieri consueverunt secundum Ecclesiae instituta (DH 855 (DS 464)). 217DH 856 (DS 464). 218DH 902 (DS 481). See supra on p. 110 n. 152. 219DH 1000 (DS 530). post-mortem existence prior to the reformation 123
views contrary to the Christian religion and to the reputation of prominent persons ofrank, the council decreed that all printed books should be examined before publication.Other subjects treated at the council were: the condemnation and rejection of the decreesof the conciliabulum of Pisa (1511), the abrogation of the French Pragmatic Sanction ofBourges, peace among Christian rulers, church reform, and the defence of the faith againstheresies. The council republished the bull of Julius (150506), which stated that simonyinvalidated a papal election. CHAPTER THREE
Introduction
Fish, William Tracy, John Frith, and William Roye are then discussed. Ofthe reactions by Catholic apologists to the Protestant propositions, onlythe views of Thomas More and John Fisher are reviewed in some detail(together with a summary of a number of Catholic books defending Pur-gatory), as only these were relevant to the TyndaleJoye debate. Finally,a short summary of the theology of the Anabaptists (a movement ratherthan a single author) is presented, as they, too, played a role in the con-troversy. The section discussing this group of radical Reformers is placedat the end of the chapter due to the fact that they were treated by theircontemporaries as outsiders from mainstream Christianity. Both theirtheological views and their threatened position in society were to play animportant role in the TyndaleJoye debate. A few methodological remarks should help the reader in following thetrain of thought in this chapter. (1) The ideas will be discussed by authorrather than chronologically or thematically. Although this makes it moredifficult to see an evolution and establish the interrelatedness of the ideasproposed (the presentation of which is not possible within the scope of thiswork), it will be easier to identify individual influences on the TyndaleJoyedebate itself and will make the identification of sources and judgements ontheir use easier. (2) None of the authors discussed treat post-mortem exis-tence in a systematic or comprehensive way during the period examined.Protestant authors usually treated the subject of post-mortem existence incommentaries, sermons, or other, more general works. Consequently, theirpositions are not always clear, and not every aspect of such beliefs is cov-ered. Their Catholic opponents usually reacted to the disputed positions,and their treatment of the question is focused only on those aspects thatare called into question. It will therefore be impossible to present an all-embracing and complete picture of the authors. Also, points that bore littleor no relevance to the debate were left out of consideration. (3)Although itmay seem at times circumstantial, some attention will be paid to a numberof ad hominem arguments made in various debates in the era. The reasonfor doing so is to familiarize the reader with the tone of such debates atthat time so he or she is able to make better assessments of ad hominemarguments in the TyndaleJoye debate.
Wessel Gansfort
In his known works, all dating from the last ten years he spent in hishome town of Groningen, the Frisian theologian Jan Wessel Gansfort (orGoesport c.141089), a former student of Thomas Kempis (13801471), post-mortem existence in the early reformation period 127
held some controversial views with regard to the infallibility of the Popeand of the ecumenical councils, and he questioned the spiritual effect ofindulgences.1 His ideas became influential among the early 16th-centuryReformers and played an important role in shaping Protestant views onissues that included Purgatory and the afterlife.2 Gansfort is thereforeoften seen as a precursor of Luther.3 One of his most influential writings was a collection of theses, randomlists of propositions, parts of letters, and various sections of commentary
1On his life and theology, see: C. Ullmann, Johann Wessel, ein Vorgnger Luthers. ZurCharacteristik der christlichen Kirche und Theologie in ihrem Uebergang aus dem Mittelalterin die Reformationszeit, Hamburg: Perth, 1834; B. Bhring, Johann Wessels Leben, 1846;dn Fizly, Wessel Gansfort, eine dogmengeschichtliche Untersuchung, Lva: Nyitrai,1911; Edward Waite Miller, Wessel Gansfort. Life and Writings, 2 vols. Principal workstrans. by Jared Waterbury Scudder, New York & London: G.P. Putnams Sons, 1917; AlbertHardenberg, Life of Wessel of Groningen, in Miller (ed.), Wessel Gansfort, Life and Writ-ings, vol. 2, pp. 31747; Maarten van Rhijn, Studien over Wessel Gansfort en zijn tijd, 1933;H.J.J. Wachters, Wessel Gansfort, (Kerkelijke geschiedenis 593; Voorloopers der hervorm-ing 4), Marinburg: Geert Groote Genootschap, 1940; L.D. Snyder, Wessel Gansfort andthe Art of Meditation, Diss. Cambridge (MA), 1966; Heiko Augustinus Oberman (ed.), Fore-runners of the Reformation. The Shape of Late Medieval Thought Illustrated by Key Docu-ments, Philadelphia: Fortress, (11966) 1981; Fokke Akkermann, Gerda Huisman & ArjoVanderjagt, Wessel Gansfort (14191489) and Northern Humanism, (BSIH 40), Leiden: Brill,1993; Arjo Vanderjagt, Wessel Gansfort (14191489) and Rudolph Agricola (1443?1485). Pietyand Hebrew, in Gudrun Litz, Heidrun Munzert & Roland Liebenberg (eds.), Frmmig-keitTheologieFrmmigkeitstheologie. Contributions to European Church History. FS frBerndt Hamm zum 60. Geburtstag, (SHCT 124), Leiden: Brill, 2005, pp.15972. 2Most of Gansforts manuscripts were burned after his death. (Hardenberg, Life ofWessel of Groningen, p. 335). Those that were preserved in his correspondence were col-lected and later taken by Gansforts confrre, Johannes Rhodius (Hinne Rode, d. c.1535),rector of the St Jerome School of the Brethren of Common Life in Utrecht, together withthe Dutch lawyer Cornelis Hoens treatise on the Lords Supper, to Luther in Wittenbergin the winter of 152021 to affect Luthers position on the Eucharist. Later, Rhodius tookthem to Zwingli, Oecolampadius, and Bucer. See: Otto Clemen, Hinne Rode in Wittenberg,Basel, Zrich und die frhesten Ausgaben Wesselscher Schriften, in Zeitschrift fr Kirchenge-schichte 18 (1898), pp. 34672; Cebus Cornelis de Bruin, Hinne Rode, in Het Sticht vanBinnen en van Buijtenen. Bundel Opstellen over de Geschiedenis van de Provincie Utrecht,Aangeboden aan dr M.P. van Buijtenen bij diens Zeventigste verjaardag, Utrecht: Vereniging Oud-Utrecht, 1981, pp. 191208; Cornelis Andries Tukker, Zwingli en de Nederlan-den, in Willem Balke, Willem vant Spijker, Cornelis Andries Tukker & Klaas MaartenWitteveen, Zwingli in vierderlei perspectief, Utrecht 1984, pp. 10335; Otto J. de Jong,Nederlandse kerkgeschiedenis, Nijkerk 31985, pp. 87 and 9192; James Tanis, East Frieslandand the Reformed Reformation, in Calvin Theological Journal 26 (1991), pp. 31349, esp. 31921; Bart Jan Spruyt, Ketter aan het Binnenhof. Cornelis Hoen en zijn tractaat tegen de tran-substantiatieleer, Heerenveen: Groen, 1997. 3Some of his unconventional but not necessarily heretical insights were misunder-stood and radicalized by the Reformation. On major theological issues he maintained theCatholic teaching (e.g. freedom of will, veneration of the Blessed Virgin and the saints,merits of good works, the necessity of both Scripture and Sacred Tradition, etc.). His bookswere placed on the index long after his death, and Gansfort himself was never silencedor questioned.128 chapter three
grouped together under the title Dr. Wesselus de Purgatorio. quis & qua-lis sit ignis purgatorius. De statu & profectu animarum post hanc vitam.4The collection starts with three sets of axiomatic dogmatic propositions.The first set of 20 propositions concerns papal authority and jurisdictionin general, the second set of 13 propositions relates to papal authoritywith regard to indulgences, and the third set of 32 propositions affectsthe economy of grace and afterlife, including propositions on the The-saurus Ecclesiae and on Purgatory.5 One of these propositions (no. 25) isthat neither the authority of prelates nor the validity of the sacramentscan constitute immunity to sin.6 In his next proposition (no. 26), Gansfortclaimed that if someone cannot obtain immunity to sin for himself, nei-ther can he decree impunity.7 It is not difficult to see how these words canbe taken as a denial of the interrelatedness of the Militant and the Suffer-ing Churches.8 Gansfort then argued that in order to be properly called astate of purgation, Purgatory has to purge one of impurities (sordes, hocest, peccata).9 Thus, Purgatory is a fire, but not so much a tormenting fireas a purging one, cleansing the inner person or the soul. Through deaththe soul is liberated from its captive prison, but it still has to be purgedof the impurities that cling to it even after it has been released from theflesh.10 Gansfort believed that this is the fire of which Paul wrote in 1 Cor.3:1115the fire that will cleanse every persons works. It is clear, Gansfortargues, that Paul speaks here metaphorically, and not of a physical build-ing with earthly materials of hay, wood, or straw which can be burned bynatural fire. It is therefore just as clear that the fire of which Paul speakscannot be physical fire.11
4The collection of Gansforts teachings entitled Farrago was published with Luthersforeword in Wittenberg at the beginning of 1522. Modern reprint: Wessel Gansfort, Opera,Facsimile of the Edition Groningen 1614, Nieukoop: de Graaf, 1966 [hereafter: Gansfort, Operaomnia]. The collection concerning Purgatory (Dr. Wesselus de Purgatorio. quis & qualis sitignis purgatorius. De statu & profectu animarum post hanc vitam) is found on pp. 82652. 5On indulgences and the thesaurus ecclesiae, see supra on p. 112. 625. Neq[ue] Prelatorum auctoritas, neq[ue] sacramentorum veritas in hac vitaimmunem constituunt peccato (Gansfort, Opera omnia, p. 829). 726. Qui non potest immunem peccato reperire, non potest impunem decernere(Gansfort, Opera omnia, p. 829). 8Cf. Craig Koslofsky, Separating the Living from the Dead: Wessel Gansfort and theDeath of Purgatory, in Essays in Medieval Studies 10 (1993), p. 132. 929. Purgatorium, ut si ver purgatorium sit, oportet ut sordes purget (Gansfort,Opera omnia, p. 829). 10Purgatorius ignis est, qui interioris hominis sordes etia[m] carne soluti comitantespurgat potis, qum torquet (Gansfort, Opera omnia, p. 829). 11Gansfort, Opera omnia, p. 835. post-mortem existence in the early reformation period 129
12Omnium optimus, omnium pijssimus Dominus Iesus, mille cruciatus pertulit, nul-latens tamen purgatus (Gansfort, Opera omnia, p. 838). 13Lucifer ternos cruciatus perferet, nullatens purgabitur (Gansfort, Opera omnia,p. 838). 14Gansfort, Opera omnia, pp. 833 and 838. 15In statu igitur non misero, non sub virga lictoris, aut in igne prparato diabolo &angelis ejus sed sub disciplina Patris instituentis, & eorum quotidiano profectu gaudentis(Gansfort, Opera omnia, p. 834). 16Gansfort, Opera omnia, pp. 829, 834, and 837. For Augustine, see supra on p. 99. ForGregory the Great, see supra on p. 106. For William of Auvergne, see supra on p. 108. 17Sunt igitur in tali statu quam si sciremus gauderemus (Gansfort, Opera omnia,p. 834). 18Solvente ab omnibus infirmitatibus [...] transeunt in illucescente[m] & adspirantemdiem felices viatores, donec eis conspicuus oriatur sol (Gansfort, Opera omnia, p. 856). 19Gansfort, Opera omnia, pp. 833 and 860.130 chapter three
20In hac luce purgari post mortem in conspectu Domini preciosam, hujus purgationispurgatorium locum credo paradisum; in pugatorio, hoc est, in paradiso; and congruen-tissimus igitur locus purgationi huic paradisus (Gansfort, Opera omnia, pp. 833, 857, and863, respectively). 21Paradisus enim medius est debitores & comprehensores (Gansfort, Opera omnia,p. 860). 22Latro de cruce paradisum accepit purgatorium, quia interim adhuc viator (Gansfort,Opera omnia, p. 833). 23E.g. This point leads to Gansforts central argument: intercession for the souls inPurgatory is both undesirable and impossible. No one should want to free souls fromthis Purgatory of enlightenment, and intercession of the Church is, in any case, useless(Koslofsky, Separating the Living from the Dead, p. 133). 24Volet autem, ut ex illucescente die in lumen solis orientis procedam. Hoc oraredebebo. Idipsum orant angeli pro defunctis (Gansfort, Opera omnia, p. 856). 25Oramus etia[m] & nos pro angelis, quando oramus ut eorum beata desideria denobis fiant efficacia. Idipsum orat Ecclesia tota, vel orare debet (Gansfort, Opera omnia,p. 856). 26Orant pro nobis defuncti, ut in illoru[m] felicem societatem traducemur [...]Defuncotrum pro nobis, qum nostra felicior oratio, vel pro nobis, vel pro illis (Gansfort,Opera omnia, p. 856). post-mortem existence in the early reformation period 131
27De tali ego dixi oratione me dubitare, si velle[m] pro me defuncto fieri devotoru[m]orationes (Gansfort, Opera omnia, p. 856). 28Gansfort, Opera omnia, p. 856. 29Gansfort, Opera omnia, pp. 85657. 30Gansfort, Opera omnia, p. 846. 3121. Qud soli evangelisati per magnum Evangelist am idone dispositi sunt, utterno judicio judicentur (Gansfort, Opera omnia, p. 846).132 chapter three
The purpose of Christs descent into Hell (1 Pt. 3:1822) was precisely topreach the Gospel to all who died before Christ and who are to be judgedby Christ, in order that they may be justly judged through the preaching ofChrist himself.32 Nonetheless, not every soul will be saved, because thereare souls that reject the Gospel even when given this second chance.33 To conclude the survey of Gansforts position on the post-mortem exis-tence, a final remark should be made. While speaking about the state ofthe soul after death, Gansfort used the verb to sleep (dormire) twice. Heapplied it to describe the rest of Lazarus soul at Abrahams bosom (Veredilecti, vere dato somno dormientes in pace in idipsum, & requiescentes) andin his exhortation to pray for the deceased (quemadmodum pro illis, ita prodormientibus exorare).34 Despite occasional claims to the contrary, thereis nothing to suggest that he would have believed that souls were uncon-scious after death, or that he would have believed in what later becameknown as soul sleep (psychosomnolence).35 From Gansforts descriptionof the gradual purification process and growth in the love of God, it isobvious that he conceived the souls of the departed to be active. It istherefore safe to conclude that Gansforts use of the expression to sleepis simply an allusion to the biblical usage of the word.36
Erasmus
32Omnes ergo per Christum judicandi ante per ipsum Christum, ut just judicentur,praedicantem evangelisabuntur (Gansfort, Opera omnia, p. 845). 3314. Qud illi evangelisati, post qum Christus venit & evangelisavit, sinon credant,excusationem non habent de peccato (Gansfort, Opera omnia, p. 846). 34Gansfort, Opera omnia, pp. 849 and 851, respectively. 35E.g. Williams, The Radical Reformation (11962)3rev 1992, p. 197. 36Some of the advocates of the idea of soul sleep were already interpreting Gansfort insuch a way during the Reformation period. post-mortem existence in the early reformation period 133
37See e.g. Arblaster, Cats. 59, 60, 61, 66, 67, 80, 81, and 84 in TT, pp. 11819, 12324, and13337; Latr, Cat. 92 in TT, pp. 14849; Juhsz, Cats. 89, 90, 102, and 103 in TT, pp. 14243;15961. 38Erasmus, Paraphrasis in duas epistolas Pauli ad Chorintos, Leuven: Dirk Martens,30 January 1519. The book was reprinted in March 1519 in Basel by Froben. 39Allen, III, no. 916 on p. 488, English trans.: CWE VI, p. 246. 40Apud Italos quotannis in publicis concionibus conantur asserere resurrectionem,existimantes rem in portu forte, si docuerint Aristotelem non sustulisse prorsus immortali-tatem animarum (Allen, III. no. 916 on p. 488. English trans.: CWE VI, p. 246). 41Certe, quod est in propatulo, sic viuunt quidam, presertim potentes in hoc mundo,quasi de futuro seculo nihil omnino credant (ibidem).134 chapter three
whether souls exist separate from the body and where they exist; whether they enjoy the glory of immortality; whether souls of the wicked are in tor- ment now, whether our prayers or other good actions are of any service to them, whether an indulgence from the pope frees them all of a sudden from punishment.42Had God revealed the truth about these questions to us through Paul,there would not be so many people who are in doubt on these points, orat any rate dispute about them.43 Hinting probably at Pomponazzi, Eras-mus remark testifies to the fact that the question was not at all settled, inspite of the doctrinal pronouncements.44 Erasmus attention to the issues of resurrection and afterlife is certainlynot coincidental. His orthodoxy concerning the resurrection in his text andtranslation of 1Cor. 15:51 was questioned by at least three persons. Writingfrom Leuven in the summer of 1520, Erasmus himself relates the story ofone of these attacks to both Hermann von dem Busch (14681534) and toMartin Luther.45 In what follows, I will follow Erasmus account in theseletters. On a spring day in 1519, Dr. Henry Standish, who had been opposingErasmus NT translation for some time, was preaching in St Pauls Church-yard in London.46 Erasmus reports that during his sermon, Standish sud-denly forgot all decency and charity (the topic on which he had startedto preach) and began to rave against Erasmus NT translation.47 In hissermon he repeated his critique of Erasmus rendering Jn. 1:1 with In prin-
cipio erat sermo instead of the traditional phrase In principio erat verbum.48Later the same day, Standish was dining at court.49 Sir Thomas More andthe royal chaplain, John Stokesley, sat at the table with him and provokedhim to discuss this passage and Erasmus choice of words. When Morepointed out to him that the Vulgate uses sermo in Wis. 18:15, Standish stillexpressed his aversion to Erasmus books, which made him fear destructiveheresies and disastrous schisms. When pressed to speak more specifically,Standish named three items counting the points out on his fingers.50 Histhree points were (1) Erasmus taking away the resurrection, (2) makingthe sacrament of matrimony worthless, and (3) holding false views on theEucharist.51 When he was asked to prove his points, Standish referred toErasmus rendering of 1 Cor. 15:51.52 The second half of this verse in theVulgate reads as follows: omnes quidem resurgemus sed non omnes inmuta-bimur (all of us will rise, but not all of us will be changed). This readingreflects a Greek text ( , )for which there is no extant attestation, but a very similar reading is foundin the Greek of the prima manus of the 6th-century Codex Claromonta-nus (D* 06): , .53 Since thiscodex was not consulted by Erasmus, and since his five Greek manuscriptswere unanimous, he accepted their reading in the continuous text: , .54 He rendered this reading
48Standish had been criticizing Erasmus choice of wording since the publication ofthe Greek-Latin NT. (See Erasmus to Peter Barbirius on 17 July 1517, published in Allen,III, n. 608, on p. 21.) 49Since his support of the King in Convocation on the issue of criminous clerks (thepunishment of clerics by lay tribunals) in December 1515, Standish had enjoyed the favourof Henry VIII, who first appointed him bishop (1518), and later ambassador to Hamburg(1524) and examiner of heretics (1525). 50Allen, IV, p. 312. 51Primum inquit Erasmus tollit resurrectionem. Deinde nihili facit sacramentummatrimonii. Postremo male sentit de Eucharistia (ibidem). Standish only expounds uponthe first accusation, but not the others. 52In his 1522 edition of the NT, Erasmus mentions in the annotations to 1 Cor. 15:51, thathis Latin translation of this verse procured accusations against him. Without mentioningStandish, Lee (see infra p. 141), or Nicholas Baechem of Egmont (see infra p. 142) by name,he intimates that he was accused of taking away the resurrection: Alter in corona fre-quenti nobilium & eruditorum hominum apud summos principes, impegit, quod tolleremresurrectionem, propterea quod concederem non asseuerarem, aliquos in aduentu domininon morituros (Erasmus, NT, 1535, p. 518). 53The reading is also attested to in Latin by various mss of the Itala, and by many, mainlyWestern Church Fathers (inter alios Marcion, Tertullian, Jacob of Nisibis, Ambroisaster,Hilary, Ambrose, Augustine, and John of Damascus). 54Erasmus made use of the 11th-century Cod. 2817, the 12th-century Codd. 1 and 2815,and the 15th-century Cod. 2816. This reading is also attested to by the second corrector136 chapter three
into Latin with Non omnes quidem dormiemus, omnes tamen immutabimur(not all of us will fall asleep but all of us will be changed). Erasmus was certainly not the first in the West to argue for this reading.The Florentine diplomat and Humanist scholar Gianozzo Manetti (13961459) had translated the passage earlier by combining two of the attestedreadings in the following paradoxical way: Omnes quidem resurgemus, sednon omnes immutabimur. Omnes quidem non dormiemus. Omnes autemimmutabimur.55 His work, however, remained in manuscript form andwas in all probability unknown to Erasmus. Later, independently fromManetti, the Italian Humanist Lorenzo Valla (c.140657) cited the pas-sage in his Annotations, adhering even more closely to the Greek wordorder, in the following way: omnes quidem non dormiemus, sed omnesimmutabimur.56 Erasmus, who edited Vallas work and thus knew it thor-oughly, rather follows Jacques Lefvre dtaples (c.14501536) translationmore closely but without acknowledgement.57 Lefvre had rendered thetext in his translation of the Pauline Corpus with the following words:
of the Codex Claromontanus (D2 06), by , 075, and by a number of later mss in theByzantine textual tradition (). The reading without the particle (i.e.: , ) is supported by a wide range of mss. This isconsidered today as the reading which best explains for the origin of the others (BruceMetzger, A Textual Commentary on the Greek New Testament, London & New York: UBS,1971, ad locum, p. 568). Based on the arguments of transcriptional probability, as well asexternal and internal evidence, this last reading is printed in all contemporary text criti-cal editions. On these and yet other variant readings of this verse and their textual criticalevaluation, see also: Phillip Oppenheim, 1 Kor. 15,51. Eine kritische Untersuchung zu Textund Auflassung bei den Vtern, in Theologische Quartalschrift 112 (1931), pp. 92135; AlbertoVaccari, Il testo 1 Cor. 15,51, in Biblica 13 (1932), pp. 7376; Kurt Aland, Text und Textwertder griechischen Handschriften des Neuen Testaments. 2. Die Paulinischen Briefe, vol. 2/2,(Arbeiten zur neutestamentlichen Textforschung 17), Berlin: de Gruyter, 1991, pp. 31721;Juhsz, Being With Christ, pp. 2831. 55Cited by Andrew J. Brown in ASD VI/3, p. 327. But Paul Arblaster has rightly pointedout that medieval manuscripts sometimes give textual variants in a run-on fashion, oftenseparating them only with an interlinear for velsomething not all editors are aware of(private communication). 56Lorenzo Valla, Laurentii Vallensis...In latinam noui testamenti interpretationemex collatione grcorum exemplarium adnotationes apprime vtiles, ed. Desiderius ErasmusRoterodamus, Jodocus Badius, Paris: Iehan Petit, 1505. 57On Lefvre, see infra on p. 152. De Jonge suggested that the verbal similarities betweenErasmus and Lefvre are not sufficient to determine that Erasmus borrowed from Lefvre(Henk Jan de Jonge, The Relation of Erasmus Translation of the New Testament to that ofthe Pauline Epistles by Lefvre dtaples, in Erasmus in English, no. 15 (198788), pp. 27).But Andrew J. Brown argues that there is a heightened suspicion that Erasmus translationowed an unacknowledged debt to Lefvres work (ASD VI/3, p. 15). According to Brown,this borrowing does not amount to outright plagiarism, since it was a matter of bor-rowing a word here, and a phrase there (ibidem). On concepts of copyright, plagiarism,etc., see infra on p. 328. post-mortem existence in the early reformation period 137
But for Erasmus, accepting the more difficult reading does not meanthat the traditional reading or any other reading would necessarily be false.The variant reading, of which Augustine himself exhibits knowledgethat all of us will fall asleep, but not all of us will be changed (omnesquidem dormiemus, sed non omnes immutabimur)can also be accepted,Erasmus suggests, for all of us will die, but not all of us will enter intoglory. Finally, the third variant readingthat not all of us will fall asleep,but all of us will be changed (omnes quidem non dormiemus, sed omnesimmutabimur)can also be accepted, as the first part of the sentencerefers to those who will be alive at the second coming of Christ, whilethe second part of the sentence refers only to the just, as Origen under-stood the passage, Erasmus maintains.66 Two seemingly contradictorysentences can be true at the same time. Erasmus elucidates this seem-ing contradiction with the following example: ones statement, speakingabout the theologians in Leuven, that all theologians are sincere, doesnot contradict someone elses statement that not all theologians aresincere if the latter assertion is spoken about theologians in general.67Also, Jerome affirms that the living will be transformed into the glory ofimmortality (uiui transformentur ad gloriam immortalitatis) in his letterto Mercella (third question).68 This does not mean that Paul believed thatsome people will not die. The living will die all of a sudden in the rap-ture and will be immediately revived.69 Pauls point is therefore about thedeceased, who will be resurrected just like the seed that is sown in theearth. Erasmus then quotes a pseudo-Augustinian writing to confirm thatthere can be a difference in opinion on what happens to the persons stillalive at the second coming of Christ, but that these differing views should
66Siquidem totus hic sermo non ad omnes homines communiter, sed ad iustos pro-prie pertinet (Erasmus, NT, 1535, p. 517). In his Apologia, Erasmus adds the possibilitythat the first part of the sentence might refer to Elijah or Enoch, who have been saidto be transferred alive to Heaven: Cum igitur Paulus explicaturus modum resurrectionisdixisset, non omnes quidem morituros, (sive hoc dictum sit propter Eliam & Enoch, sivepropter eos quos adventus Christi deprehendet vivos) sed tamen omnes immutandos adimmortalitatem, & eos qui revixerint, & eos quos subitus adventus Christi deprehenderit invita, quod in genere proposuerat, pergit explanare disctinctius (LB IX. col. 436). 67Nec hoc magis mirum, qum si duo simul uerum dicant, quum alter pronuncietomnes theologos esse synceros, de Louaniensibus sentiens: alter, non omnes theologosesse synceros, de cunctis in genere sentiens (Erasmus, NT, 1535, p. 517). 68Erasmus, NT, 1535, p. 517. 69Credamus uiuos in subito in ipso raptu morituros ac reuicturos (Erasmus, NT, 1535,p. 517).140 chapter three
70Verum quia sunt & alij que catholici & eruditi uiri, qui credunt anima in corporemanente, immutandos ad incorruptionem & immortalitatem eos qui in aduentu dominiuiui sunt, & hoc eis imputari pro resurrectione ex mortuis, quod mortalitatem immuta-tione deponant, non morte, quo libet quis acquiescat modo, non est hreticus, nisi excontentione hreticus fiat. Sufficit enim in ecclesi lege carnis resurrectionem crederefuturam de morte (Erasmus, NT, 1535, p. 517). The Liber de dogmatibus ecclesiastibus isnow universally attributed to Gennadius of Marseilles (fl. end of 5th century). Erasmusquotes chapter 6 (PL 42, col. 1215 = PL 58, col. 983). For Augustines view, see supra onp. 100. 71Fassus est esse verum, et hanc lectionem recenseri a veteribus orthodoxis, et nomina-tim ab Hieronymo: sed hoc inquit Hieronymus reposuit ex Hebreo (Allen, IV, p. 313). 72Audierat vir egregius Hieronymum qudam ex Hebreorum fontibus restituissein Vetero Testamento, et putabat idem habere locum in Paulinus Epistolis (Allen, IV,p. 313). 73Profecto inquit, non satis video quibus rationibus isti argumento possit occuri, autquid responderi debeat pro ipsius dignitate. Neque enim opinior R.P. vsqueadeo delirare vtexisitimet eas epistolas primum Hebraice scriptas fuisse, cum pueri quoque sciant a PauloGrce scriptas esse (Allen, IV, p. 313). 74Quod autem fuisset illud Hieronymi consilium ex Hebris voluminibus mutantispublicam lectionem, cum ex fontibus id fieri soleat, cumque nemo testetur has epistolasvlli visas Hebraice descriptas? (Allen, IV, p. 313). post-mortem existence in the early reformation period 141
emphasizing his argument to the point that Henry felt pity for so muchidiocy (tant stoliditatis) exhibited in the midst of such exalted peopleand changed the subject.75 Erasmus personal remarks on Standish are not very amiable, to say theleast. What could be more insane, Erasmus asked, than to accuse him oftaking away the resurrection by changing in one place the word resurrec-tio, when Paul confirms it in so many passages?76 In his letter to Luther,Erasmus calls Standish a well-known madman (ille furiosus), insane(vesanus), and dense (stolidus).77 Standishs idea is called an absurdity(deliramentum) that would seem to be insane (insana) to any table com-pany, let alone to the highest rulers and the most educated people. Whocan suppose that Standish would have even a morsel of sanity (haberemicam san mentis)? Erasmus asks.78 Also in his letter to von dem Busch,Erasmus jeered at Standish, the senex theologus, for confusing Corinthianswith Colossians, and in his usual satirical tone Erasmus asks rhetorically,who could believe that this person has any brains?79 The question of Erasmus textual changes to the wording of the Vulgatein 1Cor. 15:51 crops up again in Erasmus debate with Edward Lee.80 Theconflict between Lee and Erasmus started when Lee went to Leuven toimprove his Greek. When Erasmus faulted him in a public letter in May1518, Lee composed a list of some 300 erroneous passages in Erasmus NT.
After having circulated this list in manuscript form among his friends,Lee published his critique in 1520.81 He attacked Erasmus for changingthe Sacred Scripture on his own, human authority, arguing that by adopt-ing variant readings, Erasmus created a multitude of Gospels.82 Erasmusreacted immediately with his Apologia qua respondet duabus invectivisEdvardi Lei. In his Apologia, Erasmus pointed out that there are innu-merable variant readings found even in the Latin manuscripts, that theChurch often uses different translations (of the Psalms) in the liturgy andin the readings, and even printed Latin versions of the Vulgate translationdiffer among themselves.83 He argues, therefore, for the educated readersright to discern based on the manuscript evidence and the quotationsfrom the Fathers, but for that reader to ultimately rely on the authorityof the Church.84 Erasmus complains that when he translates the Greek text in a waythat differs from the Vulgate, Lee charges him with doing violence to thereading of the Church in a bold and impious manner. In fact, Lee repeat-edly indicted Erasmus for heresy. Lee also charged Erasmus with steal-ing his ideas and taking credit for them. Erasmus sharply replied that heis not the sort of person who would pride himself on borrowed feathers(non admodum me venditem plumis alienis).85 Erasmus style is somewhatembittered and often sarcastic. He ridiculed his opponent, belittled himfor his limited erudition, stressed how unknown and nameless Lee was,and rebuked him for his arrogance.86 Erasmus held against Lee his repeti-tiveness and his prolixity, but Erasmus own Apologia is similarly itera-tive and long-winded. Lee blamed Erasmus for his pride and arrogance.Though Erasmus denied the charge, his self-righteous complacency dis-credited his seemingly modest words.87 Both Lee and Erasmus repeatedlycalled upon the indifferent reader to arbitrate in the polemic.88
81Edward Lee, Annotationum libri duo, alter in annotationis prioris ditionis noui tes-tamenti Desiderii Erasmi, alter in annotationes posterioris ditionis eiusdem, Paris: Giles deGourmont, 1520. 82Erasmus cites Lee (fo. cciiiv), referred by CWE 72, p. 33 n. 162. ASD IX-4, p. 46. 83ASD IX-4, p. 46 (CWE 72, pp. 3334). 84ASD IX-4, p. 50 (CWE 72, p. 39). 85ASD IX-4, p. 56 (CWE 72, p. 46). 86Cf. e.g. ASD IX-4, pp. 61.6667.69 (CWE 72, p. 53.6162.65). 87Cf. e.g. ASD IX-4, pp. 5758 (CWE 72, pp. 4849). In the Colloquies Erasmus describedLee as someone dedicated to sophistical riddles, vain babbling, sycophancy, arrogance,virulence, sardonic humour, thrasonical boasting, and self-love. See also: Preserved Smith,A Key to the Colloquies of Erasmus, Cambridge, 1927, pp. 56. 88In his Responsio ad annotationes Lei (April 1520) Erasmus reiterates his argu-ments (ASD IX-4, pp. 21718). The third book by Erasmus dedicated to the controversywith Lee treats the rest of the debated issues: Liber tertius E.R. quo respo[n]det reliquis post-mortem existence in the early reformation period 143
annotationibus Ed. Lei, Apud Antverpiam, May 1520. Erasmus friends rushed to defendthe Dutch Humanist. Besides the anonymous Hochstratus ouans. Dialogus festiuissimus:Interlocutores. Hochstratus, qui & Erostratus dicitur. Frater Lupoldus, huic in itinere comes.Eduardus Leus, ex homine commatatus nuper in canem. Lege, & cum ouantibus laetaberis,Schlettstadt: Schuerer, 1520, depicting Lee as a barking dog, two books appeared by Eras-mus friends to defend his NT against Lees charges: Eobanus Hessus, In Eduardum LEEUMQUORUNDAM E SODALITATE LITERARIA ERPHURDIENSI ERASMICI NOMINIS STUDIO-SORUM EPIGRAMMATA, Erfurt: Joh. Knappe, 1520, and Johannes Gertophius, RecriminatioIoan. Gertophii, adulescentis Germani, adversus furiosissimum sychophantam EdouardumLeum Anglum, qui ausus est primus Erasmum clandissimum luto aspergere, Basel: AndreasCratander, 1520. Also, three collections of letters were published to same effect: Episto-lae aliquot eruditorum; Appendix Epistolarum quibus eruditi viri detestantur Edouardi Leivirulentiam; and Epistolae eruditorum virorum. See also: Coogan, The Pharisee Against theHellenist, p. 481. 89See Erasmus letter to Hermann, Count of Neuenahr, dated 19 October 1518 and pub-lished in Allen, III, n. 878, on p. 416. Nicholas Baechem of Egmont was a Flemish theolo-gian, doctor in divinity, and at the time prior of the Carmelites in Brussels (151718); hewas formerly and afterwards prior of the Carmelites in Leuven (151017, 151826) See LBIX cc 249ff. 90Republished in LB IX, cols. 43342. 91Siquidem in omnibus Gcorum codicibus, quos ego sane vidi, (vidi autem nonpaucos) scriptum habetur: , (LB IX,col. 433). 92Erasmus, Dilucidia et pia explanatio symboli quod apostolorum dicitur, decalogi pr-ceptorum, & dominic precationis, Basel: Johannes Froben and Nicolaus Episcopius, 1533.Republished in Erasmus, De contemptu mundi; Virginis matris Lauretum cultae liturgia;Modus orandi deum; Explanatio symboli apostolorum; De praeparatione ad mortem, ed.Samuel Dresden, (ASD V-1), Amsterdam & Oxford: North-Holland, 1977. English transla-tion: Erasmus, Spiritualia and Pastoralia. Disputatiuncula de taedio, pavore, tristicia Iesu;Concio de immensa Dei misericordia; Modus orandi Deum; Explanatio symboli apostolorum;144 chapter three
immensely popular and immediately sold out.93 The work was repub-lished the same year in Basel, Antwerp, Cologne, and Paris.94 The Eng-lish translation appeared a year later in London and had to be reprintedimmediately.95 Erasmus catechism takes the form of a dialogue between acatechist and a young person asking for instruction in the Christian faith.Erasmus, probably affected by thein his eyesdevastating effects ofthe Reformation, maintains an unmistakably Catholic position on doctri-nal issues and presents his answers in a virtually apologetic fashion.96 Theopening words of the catechumen already underline this: he seeks instruc-tion in order to be admitted into the society of the Catholic Church, thehouse of God, outside of which there is no hope of eternal salvation.97
De praeparatione ad mortem, ed. John W. OMalley, (CWE 70) Toronto, Buffalo & London:UP Toronto, 1998. Sir Thomas Boleyn (14771539), the father of Henry VIIIs second wife,also requested the Enarratio of Psalm 23 (1530), and De prparatione ad mortem (1534).On his life, see: Antonia Fraser, The Wives of Henry VIII, New York: Alfred A. Knopf, 1993;passim, esp. 11819 and 25051 and Alison Weir, The Six Wives of Henry VIII, New York:Ballantine Books, 1993, passim, esp. pp. 14546 and 337; Peter G. Bietenholz & Thomas B.Deutscher (eds.), Contemporaries of Erasmus. A Biographical Register of the Renaissanceand Reformation, vol. I, Toronto: UP, 2003, pp. 16162. 93Erasmus wrote that year to the German Humanist Canon Johannes von Vlatten(14981562): In symbolum non indiligenter scripsi; item et in praecepta Decalogi. Liberexiit mercatu verno: mittam per hunc, si quaem nancisci apud me nullus reliquus est.Hieronimus ait se Francfordiae omnes vendidisse intra tres horas (Allen, n. 2845 onp. 269, li. 1417). 94In Antwerp: by Johannes Steels in the office of Johannes Grapheus, and by MichielHillenius. In Cologne: by Eucharius Cervicornus. In Paris: by Louis Cyaneus, by ChrtienWechel, and by Jean de Roigny. 95Erasmus, A playne and godly Exposytion or Declaration of the Commune Crede And ofthe X. Commaundementes of goddes law. Newly made and put forth by the famouse clarkeMayster Erasmus of Rotterdame, trans. William Marshall, London: Robert Redman, [1533].See: E.J. Devereux, The English Editions of Erasmuss Catechismus, in The Library, ser. 5,17 (1962), pp. 15455. 96E.g. Erasmus accepts the unwritten Sacred Tradition along with the Bible as sourceof revelation (ASD V-1, p. 290), enumerates the Deuterocanonical books in the canon of theBible (p. 278), and acknowledges seven sacraments (p. 284). He calls blasphemers thosewho question the perpetual virginity of Mary (p. 245). He even defends the need to occa-sionally restrict access to the Bible (p. 279). Luther railed against Erasmus catechism ina letter to Nikolaus von Amsdorf (14831565) dated from Wittenberg, 11 March 1534: theGerman Reformer called Erasmus a viper (vipera), a liar (mendax), and the very mouth andorgan of Satan (ipsum os et organum Satan), who castigated the catechism, put togetherwith diabolical artifice (artificio plane satanico compositum), and sowed doubts in the cat-echumen about the dogmas and faith by providing details concerning heresies againstthe articles of the Creed (WA Briefwechsel 7 no. 2093, pp. 2740). Erasmus, who receivedLuthers letter through the recatholicized Georg Witzel (150173), answered it in his Purga-tio adversus epistolam non sobriam Lutheri, republished in ASD IX-1, pp. 42783. 97Iamdudum mihi gestit animus asscribi in consortium Ecclesi Catholic, qu estdomus Dei, extra quam nulli speranda salus terna (ASD V-1, p. 205). post-mortem existence in the early reformation period 145
106Tibi satis est profiteri Christum sic descendisse ad inferos, queamadmodum sentitscriptura et ecclesia (ASD V-1, p. 260). 107Nisi Christus resurrexerit, nobis omnis spes immortalitatis fuisset adempta (ASDV-1, p. 260). 108Quemadmodum enim ille pro nobis passus est, vt ab terna morte per illum lib-eraremur, ita et pro nobis resurrexit, vt per illum vitam ternam consequeremur (ASDV-1, p. 260). 109ASD V-1, pp. 26768. 110ASD V-1, p. 261. 111 ASD V-1, p. 260. Cf. Marcus Fabius Quintilianus (c.3595), Institutiones oratori,I.2,19: Deinde cum proferenda sunt studia, caligat in sole et omnia nova offendit, ut quisolus didicerit quod inter multos faciendum est. Published in Marcus Fabius Quintilianus,The Orators Education. Quintilian, ed. and trans. Donald Andrew Russell, (Loeb ClassicalLibrary 124127), vol. 1, Cambridge (MA): Harvard UP, 2001, p. 494. 112ASD V-1, p. 260. On the 1st-century Gnostic Kerinthos, see supra on p. 89. post-mortem existence in the early reformation period 147
tion but denied that our bodies would ever rise.113 Valentinus acceptedthe resurrection of spirits and souls (spiritus et anim resurrectionem) butrejected the resurrection of bodies (corporum).114 The following group ofheretics named by Erasmus are the Chiliasts, who dream of a thousandyears of bodily pleasures after the resurrection of their bodies.115 But all of these heretics are wrong, Erasmus states, and their teachingsare no dogma, but prodigious absurdities (prodigiosum deliramentum).116These fantasies are fabricated because the human mind is struggling tograsp how a body, after having been changed, can be restored to its origi-nal identity. But God is omnipotent and cannot be subject to the laws ofnature, of which he is the creator. He who created Heaven and earth outof nothing can surely restore the body from what already exists.117 Erasmus further explains Christs ascension into Heaven and what itmeans that Christ is seated at the right hand of the Father.118 Then heturns to the article of Christs judging the living and the dead at the endof the world. The catechist makes it clear that there are two judgements,an individual judgement at the death of each and every person, and ageneral judgement at the end of the world. In the former, the souls arejudged as soon as they have left the body. Their destination can be three-fold according to their state at the moment of death. The pure souls,according to Erasmus, enter into heavenly life. Those who are liable tojudgement will be dragged into Hell. Finally, those who are defiled byminor blemishes will be taken to the fire of Purgatory, whatever it maybe.119 The second, universal judgement will take place on the last day, onthe Day of Judgement (iudicii dies). On that day, when the Son of Mancomes in His glory, and all the angels with him, he will sit on the throneof His glory and all the nations will be gathered before him, says the cat-echist, quoting Mt. 25:31f. In that judgement there are only two outcomespossible because the good and the wicked will be separated overtly and
Origens errors (if he really believed and not simply related them, the cat-echist inserts) about the demons becoming angels and vice versa aftermany thousands of years, and about the damned in Hell who wouldeventually be set free from their sufferings and would be purified to enterbliss.126 In Origens account Christ would be crucified again, so the king-dom that he had prepared by His death would eventually come to an end.This blasphemy is too stupid to repel, but the Eastern Churches added theabove formula.127 After the expositions on the Holy Spirit, Scripture and Canon, the natureof the Church, and the sacraments, the last part of the Creed is treated.This part (carnis resurrectionem) teaches about the end of the world, thecatechist clarifies in Erasmus Explanatio.128 The catechist reiterates thatthe good shall be separated from the wicked at the end of the world. Thewicked will suffer endlessly, but the good will have no pain or fear ofharm because that part of human nature which groans will be freed fromevery trouble.129 All things will be renewed, changed in quality but not insubstance.130 The Creed, Erasmus points out, calls the human body fleshand the restoration of life resurrection.131 This article of the Creed is thebasis of our faith (hc est basis totius fidei nostr), Erasmus emphasizes.132Therefore, it has to be maintained even more firmly than the other articlesbecause this article gives hope to the afflicted pious while it signifying fearfor those who would fall into all sorts of crime without restraint. There-fore, if one questions this article, then believing the rest is pointless.133 At this point Erasmus lists the various heretical doctrines that haveappeared over the centuries around this article of faith. The pattern isalways the same: the catechist bids farewell (valeant) to the group ofheretics who maintained a certain erroneous view with regard to the res-urrection of the body. The first group of heretics named by Erasmus arethe miserable (infelices) Sadducees.134 They did not believe in the resur-rection of the body (corporum resurrectionem), nor did they believe in
145On Lefvres theology and on his influence on Luther, Zwingli, Calvin, and Tyndale,see: Hermann Drries, Calvin und Lefvre, in Zeitschrift fr Kirchengeschichte 14 (1925),pp. 54481; Karl Spiess, Der Gottesbegriff des J. Faber Stapulensis. Ein Beitrag zum Verstn-dnis der religisen Eigenart Johann Kalvins, Marburg: J. Hamel, 1930; Fritz Hahn, FaberStapulensis und Luther, in Zeitschrift fr Kirchengeschichte 57 (1938), pp. 356432; AugustinRenaudet, Prrforme et Humanisme Paris pendant les premires guerres dItalie (14941517), Paris: E. Champion, 1916, re-edited 1953, repr. Geneva: Slatkine, 1981; Jean Dagens,Humanisme et vanglisme chez Lefvre dEtaples, in Courants rligieux et humanisme la fin du XVe et au dbut du XVIe sicle, Actes du colloque de Strasbourg (mai 1957), Paris:PUF, 1959, pp. 12134; Eugene F. Rice, Jr., The Humanist Idea of Christian Antiquity. LefvredEtaples and his Circle, in Studies in the Renaissance 9 (1962), pp. 12660; John WoolmanBrush, Lefvre dEtaples. Three Phases of His Life and Work, in Franklin H. Littell (ed.),Reformation Studies, Essays in Honor of Roland H. Bainton, Richmond: John Knox Press,1962, pp. 11728; R.J. Lovy, Les Origines de la Rforme franaise, Meaux 1518 1546, Paris:Librairie Protestante, 1959; Richard M. Cameron, The Charges of Lutheranism Broughtagainst Jacques Lefvre dEtaples (15201529), in HTR 63 (1970), pp. 11949; Henry Heller,The Evangelicism of Lefvre dtaples: 1525, in Studies in the Renaissance 19 (1972), pp. 4277;Philip Edgcumbe Hughes, Lefvre, Pioneer of Ecclesiastical Renewal in France, Grand Rapids:Eerdmans, 1984, pp. 5564; Guy Bedouelle, Une adaptation anglaise des Epistres etEvangiles de Lefvre dEtaples et ses disciples, in Bibliothque dHumanisme et Renaissance48 (1986), pp. 723734; Guy Bedouelle, Jacques Lefvre dEtaples (c.14601536) in CarterLindberg (ed.), Reformation Theologians. An Introduction to Theology in the Early ModernPeriod, (The Great Theologians), Oxford: Blackwell, 2002, pp. 1933; Arblaster & Jean- post-mortem existence in the early reformation period 153
Franois Gilmont, Cat. 77 in TT, pp. 13031, Jean-Franois Gilmont, Cats. 44 and 7881in TT, pp. 10102 and 13235. 146Bedouelle, Jacques Lefvre dEtaples, p. 19. His lack of academic training in theologywould rouse suspicion at the Faculty of Theology of Paris, which was to pursue him for therest of his life (Arblaster & Gilmont, Cat. 77 in TT, pp. 13031). Lefvre was a protg ofFrancis I, and the King protected the French priest from an open condemnation for sometime. When the King was captured in Pavia and kept in prison in Spain (see supra on p. 5),the Paris Theologians, influenced by the general panic caused by the spread of peasantrevolt into Alsace (see supra on p. 4), felt it was time to denounce Lefvre publicly. See:Nicholls, Heresy and Protestantism, p. 186. 147For Luther, see Annotationes Quincuplici Fabri Stapulensis Psalterio manu adscriptae(1513), WA IV, pp. 466526; for Zwingli, see CR IC, HZSW XII, pp. 28091. Zwinglis allusionto Lefvre, whose Psalterium Quincuplex Ulrich possessed and used. His copy, beautifullyprinted in 1513, with its wide margins in which is inserted here and there the fine hand ofthe reformer, is to be found at Zurich (Jean Rilliet, Zwingle. Le troisime homme de laRforme, (Les temps et les destins), Paris: Fayard, 1959, p. 99). 148But see his remark added to the preface of the second edition of his fivefold Psalter:non que alios sensus: allegoricum/ tropologicum & anagogicum prsertim vbi res expositnegare velim (Lefvre dtaples, Qvincvplex Psalterium, sig. A2r). Unless otherwise stated,the sigla refer to the second edition (see n. 166). Cf. One can understand that the Reformerswould have seen this as implementing sola Scriptura, the reading of Scripture by Scripture;but Lefvres approach is much more Neoplatonist, by an affinity to Pseudo-Dionysius,Nicholas of Cusa, and Pico della Mirandola (Bedouelle, Jacques Lefvre dEtaples, p. 24).See also: Maurice Villain, Le Message Biblique de Lefvre dtaples, in Recherches de Sci-ence Religieuse 40 (1952), pp. 24359. 149Jacques Lefvre dtaples, Qvincvplex Psalterium. Gallicum. Rhomanum. Hebraicum.Vetus. Conciliatum, Paris: Henricus Stephanus (Henri Estienne), Pridie Kalendas Augusti(31 July) 1509. 150Against the possible objection that such textual variations can undermine the cred-ibility of Scripture, Lefvre defends his Psalter by referring to Origen and his Hexapla.154 chapter three
151Lefvre dtaples, Qvincvplex Psalterium, sig. A2v. The prefatory letter is published in Eugene F. Rice, The Prefatory Epistles of Jacques Lefvre dtaples and Related Texts, New York: Columbia UP, 1972, Ep. 66., pp. 192201. Partial English translation published in: Oberman (ed.), Forerunners of the Reformation, pp. 297307. 152E.g. Postilla venerablis fratris Nicolai de Lyra super psalterium, in Biblia Latina, Venice: F. Renner de Hailbrunn, 14821483, II. sig. A3r. The medieval Jewish commen-tators Rashi (Rabbi Solomon ben Isaac, c.10401105, abbreviated as" )and David Kimhi ( , usually abbreviated as ", c.1160c.1235) were copi-ously used by Lyra for his Postilla. They were highly respected by many Reformers (e.g.Luther and Bucer). 153Lefvre dtaples, Qvincvplex Psalterium, sig. A2v. 154Lefvre dtaples, Qvincvplex Psalterium, sig. A2v. 155Videor michi alium videre sensum, qui scilicet est intentionis prophetae & spiritussancti in eo loquentis (Lefvre dtaples, Qvincvplex Psalterium, sig. A2r). 156Lefvre dtaples, Qvincvplex Psalterium, sig. A2r. 157Lefvre dtaples, Qvincvplex Psalterium, sig. A2v. post-mortem existence in the early reformation period 155
158In his Christological reading of the OT, Lefvre is thoroughly influenced by Nicholasof Cusa. See: Guy Bedouelle, Le Quincuplex Psalterium de Lefvre dtaples. Une guide delecture, Geneva: Droz, 1979, pp. 15166. On Cusanus, see supra on p. 103. 159Concordia scripturarum maxima ex parte nos pervexit (Lefvre dtaples, Qvincv-plex Psalterium, sig. A3rv). Cf. fo. 170r. 160The Cartusia Vallis Sancti Spiritus (also Cartusia Beatae Mariae prope Gosnay) in Gos-nay (canton of Bthune, Pas-de-Calais, France) was founded in 1320 by Thierry dHrisson,bishop of Arras, and by the countess Mathilde (Mahaut) of Artois (c.12681329, daughterof count Robert II of Artois, who died in the Battle of the Golden Spurs in 1302), and itbecame one of the more important Charterhouses of France. In the 15th and 16th centuriesit suffered much from wars, and several times the monks had to seek refuge in Bthune.The repair works, starting in 1520, were partly financed by a donation from Charles V. Thesmaller Charterhouse was restored by 1526, but the renovation of the greater Charterhousewas only completed in the 17th century (Carol Steyn, The Manuscripts of Gosnay, in Jour-nal Studia Musicologica Academiae Scientiarum Hungaricae 45 (2004), pp. 22536; ClaudeMalbranke, Guide de Flandre et Artois mystrieux, (Les guides noirs), Paris: Tchou, 1969;Jules Marie Richard, Mahaut, comtesse dArtois et de Bourgogne (13021329). tude sur lavie prive, les arts et lindustrie, en Artois et Paris au commencement du XIVe sicle, Paris:Champion, 1887; Albert Gruys, Cartusiana. Un instrument heuristique, vol. 2 Maisons, Paris:CNRS, 1977, p. 286; Gruys also lists the available manuscript sources on the history of thecloister). It is plausible that to secure imperial support, prior Pierre of Gosnay (Petrus Car-tusius/ venerabilis Gosnaianae domus prior) sought the opportunity to prove his orthodoxyto the Emperor by attacking Lefvre. 161Lefvre dtaples, Qvincvplex Psalterium, fo. 53v: Gall/Vg/Hebr: (11) miserere meidomine quoniam tribulor: conturbatus est in ira (Hebr: caligauit in furore) oculus meusanima mea & venter meus. (12) Quoniam defecit in dolore vita mea & anni mei in gemi-tibus. fo. 244r: Vet/Concil: (11) Miserere mei domine (Concil: DOMINE) quoniam tribulor/conturbatus est in ira oculus meus: (Concil: meus;) anima mea & venter meus. (12) Quo-niam defecit in dolore vita mea: & anni mei in gemitibus. 162Sunt qui volunt dominum non solum portasse pro nobis dolores mortis terren/sed etiam Dolores inferni in anima sustinuisse (Lefvre dtaples, Qvincvplex Psalterium,fo. 46v). 163See supra on p. 102.156 chapter three
164He enumerates a number of other places as well where the veritas hebraica con-tain the word mors rather than infernum, although these texts, too, according to Lefvre,speak about Hell (e.g. Ps. 17:67; 114:3; and 87:4; the Hebrew text has in these places).Lefvre dtaples, Qvincvplex Psalterium, fo. 46v. Lefvre also stresses Christs physical suf-ferings against Docetists. (46v47r). 165Lefvre dtaples, Qvincvplex Psalterium, fo. 47r. 166Epilogus sequenti appendici praelegendus and Appendix in Psal. XXX. In te Dom-ine speravi/ ad D. Petrum Cartusium/ Venerabilem Gosnaian domus priorem, in JacquesLefvre dtaples, Qvincvplex Psalterium. Gallicum. Rhomanum. Hebraicum. Vetus. Concilia-tum. Prponuntur qu subter adijciuntur. Epistola. Epilogus disputationis psal. xxx. Appen-dix in psal. xxx. Prologi Hieronymi tres. Partitio psalmorum triplex. Indices psalmorumduo., Paris: Henricus Stephanus, 1513. Facsimile edition: Geneva: Droz, 1979, sig. A3va3v.On Brionnet, see infra on p. 258. A year earlier Lefvre published a commentary on thePauline epistles that exhibits a turn in his theological thinking and which is frequentlyseen as announcing the Protestant Reformation: Lefvre dtaples, Contenta. Epistola adRhomanos. Epistola prima ad Corinthios...Epistola ad Hebraeos. Ad has 14. adiecta intelli-gentia ex graeco. Epistola ad Laodicenses. Epistolae ad Senecam sex. Commentariorum libriquatuordecim. Linus depassione Petri et Pauli, Paris, 1512. Facsimile reprint: S. Pauli epistolaeXIV ex Vulgata, adiecta intelligentia ex graeco, cum commentaries. Faksimile Neudruck derAusgabe, Paris 1512, Stuttgart-Bad Cannstatt: Frommann-Holzboog, 1978. 167Nicholas of Cusa, Excitationes, in Opera Nicolai Cusae Cardinalis ed. Jacques Lefvredtaples, Paris: Henri Estienne, 1514. Lefvre also refers to Cusas De docta ignorantia, II,16and III,6, and to Cusas Cribatio alchorani, I,139, both published in the same 1514 editionby Lefvre (Lefvre dtaples, Qvincvplex Psalterium, sig. a2rv). post-mortem existence in the early reformation period 157
was enough to achieve salvation.168 Salvation was earned once and forall by Christs earthly passion and the shedding of His blood.169 By Hisearthly suffering Christ redeemed all humankind.170 Why did He sufferthen in Hell? Following Cusanus, Lefvre argued that Christs sufferingin Hell, the greatest conceivable suffering, had the purpose of glorifyingthe Father (magnificare & glorificare deum patrem) by proving that Christwas obedient to the Father even through the most excruciating torments.171Accordingly, when Christ died, His soul did not enter into a state of pain,but into state of glorification. To this effect, a number of biblical passagesare quoted to prove that after His death on the cross, Christs soul passedimmediately to the Father.172 Christ therefore did not descend into Hellto suffer there, but to put an end to the suffering of those who were there(non pnas sustinens: sed pnas soluens).173 He did not go there to endureany torment himself, but to relieve the torments of those dwelling in Hellthorugh His prayers, as He was prefigured by Jonah praying in the belly ofthe fish (Jn. 2:16).174 The story of Moses liberating the Jews from Pharaohin Ex. 14 is also a prefiguration of Christs liberating the souls from Hell.175The tenet that being in Hell or inspecting those in Hell does not necessar-ily mean torment is proven by Jesus parable on Lazarus and the rich man:although Lazarus sees the torment of the rich man, he himself is not tor-mented, and the request of the rich man to send Lazarus over to alleviate
the suffering assumes that Lazarus himself would not be tormented wherethe rich man is, should it be possible for him to get there.176 Furthermore,when Christ predicted His sufferings He never mentioned anything aboutsuffering in Hell, Lefvre argued (Mt. 16:2123).177 In view of that, Peterswords in Acts 2:24 do not refer to Christs torment in Hell but to the suf-fering of those who were detained in Hell.178 This is what Cusanus meantwhen he spoke about the visio mortis, because the direct experience ofthe vision of death is the suffering of the damned.179 Christ, the authorof life, destroyed death by His own death and restored life.180 Therefore,Christs soul could not possibly suffer after His death, and the sufferingCusanus mentions in connection with the descent into Hell should beunderstood as Christs suffering on the cross, for it was not in His person(in persona) that Christ suffered, but in His bodyparts (in membris). AsChrist suffered for sins once and for all (semel), both for the righteousand for the unrighteous (1Pt. 3:18), it is not unreasonable to think, Lefvreargued, that on the cross Christ suffered both earthly and hellish tormentsat the same time (semel).181 For Lefvre, this is what the psalms teach: asthey speak about the suffering of the parts of the body, they can only referto Christs suffering on the cross because Christs soul was separated fromHis body by death, and consequently could not suffer in His limbs after
176Ecce quomodo iusti videntes cruciatus non cruciantur: neque etiam si in illis locistormentorum sint/patiantur. Mitte (inquit) Lazarum vt refrigeret linguam meam: intelli-gen etiam/ Lazarum missum/ tormenta illa pati non posse (Lefvre dtaples, QvincvplexPsalterium, sig. A6r). Lefvre also quotes Sir. 24:25. 177Lefvre dtaples, Qvincvplex Psalterium, sig. A6r. 178Et id solutis doloribus siue soluens dolores: non referetur in CHRISTVM/ tanquamintelligendum sit soluens dolores CHRISTI/ sed ad eos qui a morte et doloribus infernidetinebantur (Lefvre dtaples, Qvincvplex Psalterium, sig. A4v). Also: Ergo hc intelli-gantur de doloribus: quos in preciosissimo corpore suo in hoc mundo CHRISTVS pertulit(Lefvre dtaples, Qvincvplex Psalterium, sig. A5v). Lefvre also quotes Augustines com-mentary on Genesis: see supra on p. 97 n. 101. 179Ergo de illis pnis intelligi debet quod ait Cusa: cum dicit. Visio mortis viacognoscenti: est pna consummata (Lefvre dtaples, Qvincvplex Psalterium, sig. a2v). 180Qui mortem nostram moriendo destruxit: & vitam resurgendo reparauit. quisalutem humani generis in ligno constituit: vt vnde mors oriebatur/ inde vita resurgeret(Lefvre dtaples, Qvincvplex Psalterium, sig. A5r). Lefvre cites for his purpose Mt. 8:29;Sir. 38:56; Heb. 2:24; Col. 2:14; and Zech. 9:11. He also refers to Jeromes Commentarium inZachariam prophetam ad exsuperum, ad. IX,11, and the Hymn in the Evensong of Easter: Adcnam Agni providi (Lefvre dtaples, Qvincvplex Psalterium, sigs. A4vA5r). 181Lefvre dtaples, Qvincvplex Psalterium, sig. a3r. Lefvre believed that this was whatCusanus also meant: virum apostolicum Cusam locutum fuisse de temporali CHRISTI pas-sione (Lefvre dtaples, Qvincvplex Psalterium, sig. a2v). post-mortem existence in the early reformation period 159
His death.182 The souls of the righteous are in the hands of God, and notorment can affect them, Lefvre quotes Wis. 3:1. To state the contrary,that is, to ascribe torment to Christs soul, is nefarium & irreligiosum.183In fact, it was in His life that Christ suffered ineffably.184 In his conclu-sion, Lefvre stresses that he submits his own interpretation to that of theChurch and emphatically acknowledges the authority of the Church: quam de questione illa sentio/ quam veneror/ quam prdico/ quam tota animi syncritate amplector. volens sact CHRISTI ecclesi omnium vere fidelium matris incontaminat/ vestigijs semper inniti/ semper submitti/ semper obedire/ & sanctis eius semper acquiescere iudicijs.185A further change provoked by the criticism of Pierre of Gosnay, beyondthe two already discussed, can be found in the commentary section ofthe 1513 edition of the Quincuplex Psalterium. While Lefvre reprinted hisarguments of 1509 without any change, he added a list of Church Fatherswhose writings corroborate, according to Lefvre, the position that Christsuffered not in His person but in His limbs.186 In this fashion Lefvre couldgive a completely different meaning to his commentary without makingan open retraction. In this manner, his second edition of the fivefold Psal-ter was more in line with the orthodox interpretation. With regard to Purgatory, Lefvres position moved in the other direc-tion: from convention to dissent. It is evident from his writings that forsome time he not only accepted but also defended its existence. Lefvre,undoubtedly promoted by his patron, the bishop of Meaux, combatedLuthers position that the existence of Purgatory could not be proven byScripture. On the contrary, the places where it is mentioned are numerous,and their interpretations all conclude that there must be a post-mortemplace where souls owing satisfaction are purged and can be expiated. Toprove the existence of this place of expiation, Lefvre accommodated him-self to the sole authority recognized by Protestants and relied exclusivelyon Scripture, not mentioning the Sacred Tradition or the arguments of
187Guy Bedouelle, Lefvre dtaples et lIntelligence des critures, (THR 152), Geneva:Droz, 1976, p. 203. On the importance Lefvre attributed to the Fathers for the correct under-standing of the Bible, see: Rice, The Humanist Idea of Christian Antiquity, pp. 12660. 188First edition: Jacques Lefvre dtaples, Commentarii Initiatorii in Qvatvor Evange-lia. In euangelium secundum Matthum. In euangelium secundum Marcum. In euangeliumsecundum Lucam. In euangelium secundum Iohannem/ Iacobo Fabro Stapvlensi Avtore,Paris: Simon Colinaeus, June 1522. Reprint editions: Epistles et Evangiles pour les cinquante-deux semaines de lan. Text of 1525, ed. M.A. Screech, Geneva: Droz, 1964. Augmented by the1532 text ed. Guy Bedouelle & F. Giacone, Leiden: E.J. Brill, 1976. 189Lefvre dtaples, Commentarii Initiatorii in Qvatvor Evangelia, fo. 27v. 190Lefvre dtaples, Commentarii Initiatorii in Qvatvor Evangelia, fos. 27v28r. 191Occurit locus qui nobis coniecturam de expiandarum animarum loco post huiusmortalis vitae functionem. Besides the text mentioned here in the main text, Lefvre anal-yses and accepts the following texts as proofs for the existence of Purgatory: Zech. 9:11; Ps.6:6, 62:10, 85:13, and 113:25; Is. 38:18; Acts 2:24 (here he takes the expression doloribus inferniof the Vulgate for the suffering of the souls in Purgatory); Eph. 4:910; and Rev. 5:13. Lefvredtaples, Commentarii Initiatorii in Qvatvor Evangelia, fo. 28rv. 192Some ten years earlier, when Luther had not yet appeared on the scene, Lefvre didnot mention Purgatory while expounding upon 1Cor. 3:1115 in his commentary on theCorpus Paulinum (see supra on p. 156, n. 166). 193Lefvre dtaples, Commentarii Initiatorii in Qvatvor Evangelia, fos. 25v26r, 28rv, and93v94r. post-mortem existence in the early reformation period 161
of these passages.201 In the parable of Lazarus (Lk. 16), the rich manenters Hell, where he cannot be helped any longer, it being too late forany help for him. In the above-mentioned verses in the Sermon on theMount (Mt. 5:2122), Lefvre differentiated only between outward andinward acts (killing and being angry), and called the punishment for thelatter the fire of Gehenna without specifying what exactly it means. TheUnforgiving Servant of Mt. 18 is said to be condemned to eternal torment,unable to ever pay off his debt. Of course, the Epistres et evangiles pourles Cinquante et deux Sepmaines de lan, written in French and meant as aguidebook for preachers, and thus ultimately aimed at the lay population,targeted a different public from that of his biblical commentaries in Latin.Nonetheless, the absence of Purgatory in Lefvres works from 1524 on; hisconnection with Grard Roussel, Jacques Pauvan (d. 1526), and MatthieuSaunier, who publicly attacked, among other things, the existence of Pur-gatory as not having any scriptural foundation; and Lefvres silence onthe accusations of guilt by association with these persons, suggest thatby 152425 Faber Stapulensis abandoned his views on the existence of alocus purgationis.202 More hints are available with regard to his position about the interces-sion of the saints. Although Lefvre never publicly attacked the venerationof the saints, some of his remarks indicate that he regarded the invocation
201Lefvre dtaples, Les Epistres & Evangiles des Cinquante et deux Dimanches de lanavecques Briefves et tres Utiles Expositions dycelles, Simon du Bois, 1525. Facsimile reprint:Les Epistres et Evangiles pour les Cinquante et deux Sepmaines de lan with an introductionby M.A. Screech, Geneva, 1964. On Simon du Bois, see Annie Tricard, La Propagandevanglique en France, limprimeur Simon du Bois (152534), in Gabrielle Berthoud, DelioCantimori & Georgette Brasart-de Gror (eds.), Aspects de la propagande religieuse,(THR 28), Geneva: Droz, 1957, pp. 137. 202Nol Beda (14701537), syndic of the Faculty of Theology at the Sorbonne, chargedLefvre with denying the existence of Purgatory just as his disciples did: Nuperrime pravafuerunt damnata illa dogmata quae in praeceptoris Fabri schola didicerant. [...] Nequeipsum liberat magistrum, quod hic non expressit non esse purgatorium et alibi illudasserere videtur. Nempe (uti diximus) ex assertis per eum, illud evidenter colligitur. Hincdixerunt eius discipuli: Nullum esse nisi quod per Christi mortem factum est; quod estproprium Iacobi Fabri assertum (Nol Beda, Annotationes Natalis Bede...in Iacobum Fab-rum Stapulensem libri duo et in Desiderium Erasmum Roterodamum liber unus, Kln, PeterQuentell, 1526, fo. 133v; the first edition was published in Paris by Jodocus Badius Ascen-sius, 1526). See also: Grard Roussel to Johannes Oecolampadius, 24 August 1524, no. 118in Aim-Louis Herminjard, (ed.), Correspondance des rformateurs dans les pays de languefranaise, vol. I, Geneva: Georg, 1866, pp. 274278; Heller, The Evangelicism of Lefvredtaples: 1525, pp. 4277; Michel Veissire, Lvque Guillaume Brionnet. 14701534. Con-tribution la connaissance de la Rforme catholique la veille du Concile de Trente, Provins:SHA, 1986, pp. 22837; Nicholls, Heresy and Protestantism, pp. 182205; Cameron, TheCharges of Lutheranism Brought against Jacques Lefvre dEtaples (15201529), p. 122. post-mortem existence in the early reformation period 163
203Qui est bien monstrer quon ne peut obtenir priere ne pour luy ne pour autruy nepor les morts ne pour les vifz. Lefvre dtaples, Epistres & Evangiles, fo. 176r. 204Car cest l o il nous faut aller, cest celle par laquelle en donnent foy, Dieu nousveult sauver, non point par ceulx qui sont passz de ce monde. Lefvre dtaples, Epistres &Evangiles, fo. 176r. In the 1542 Lyon edition six new sermons are contained that are moreProtestant in character. One of these claims that Car la sanctit de la Vierge Marie etde tous les anges, saincts et sainctes du paradis, riens ne nous proffitera, sinon par laparolle de Dieu deuement de nous honore, ouye, retenue et observe (fo. 102). Theauthorship of these amendments is questioned (as is the exact role of Lefvre in the pub-lication of Epistres & Evangiles). For the discussion, see: Bedouelle, Lefvre dtaples etlIntelligence des critures, pp. 20506. 205Guillaume Farel (14891565) wrote to Zwingli on 13 January 1519 that Ce bon Fabryavait travaill aprs les lgndes des Sainctz et Sainctes, et desja deux moys des Martyrsestoyent imprimz, car il avoit delibr de mettre tout ce quil pourrait trouver, et le jouret lanne de tous. Mais ayant entendu la grosse idolatrie qui estoit s prires des Sainctz,et que ces lgendes y servent comme le soulphre allumer le feu, il laissa tout et se mitdu tout aprs le Saincte-Escripture (Guillaume Farel, ptre a tous, 1530, republished inHerminjard, Correspondance, vol. I, pp. 4041). Farel wrote of the hermit Michel dArandeto Corneille Schefer on 2 April 1524 that de Sanctorum cultu abrogando, rursus in multisa Fabro commonefactus (Herminjard, Correspondance, vol. I, no. 97, pp. 20506). 206Et faut noter que la plus grande partie de Meaulx en estoit infecte de la faulce doc-trine de Luther, et disoit on quun nomm Fabry, prestre, estudiant avec autres, esoit causedesdicts embrouillemens, et entre choses quil ne falloit avoir s eglises aucunes images,ne prendre eau beniste pour effacer tous les pechez, ne prier pour les trespasses, causequincontinent aprs le trespaz ilz alloient en paradis ou en enfer, et quil ny avoit nul pur-gatoire, et quil nestoit vray et ne le croy[oit] pas (Le journal dun bourgeois de Paris sous lergne de Franois Ier (15151536), ed. Victor-Louis Bourrilly, (Collection de textes pour servir ltude et lenseignement de lhistoire 43), Paris: Picard, 1910, pp. 233234).164 chapter three
Martin Luther209
207Doubts about the powers of the saints were the most common of all and opened upthe road to heresy for many (David J. Nicholls, The Nature of Popular Heresy in France,15201542, in The Historical Journal 26 (1983), p. 272). He refers to cases of the theologystudent Throuannewho was burnt in Paris in 1526 and who believed that the VirginMary had no power, and neither did any other saintand of the Lutheran wool-workerfrom Meaux who did amende honorable in April 1536 for attacking images, holy water, andprayers for the dead (pp. 27273). 208Nicholls, The Nature of Popular Heresy in France, p. 268; Nicholls, Heresy andProtestantism, pp. 20305. 209Some parts of this section have been published in TT, Cats. 14 and 15 onpp. 6970. 210On Luthers views on post-mortem existence, see: John Horsch, Martin LuthersAttitude toward the Principle of Liberty of Conscience, in The American Journal of Theology11 (1907), pp. 30715; Paul Althaus, Die letzten Dinge. Lehrbuch der Eschatologie, Gtersloh:Bertelsmann, 1956, pp. 14647; Julius Kstlin, Luthers Theologie in ihrer geschichtlichenEntwicklung und in ihren inneren Zusammenhange dargestellt, Darmstadt: Buchgesell-schaft, 21968, esp. pp. 20709 and 37376; Ole Modalsi, Luther ber die Letzten Dinge,in Helmar Junghans (ed.), Leben und Werk Martin Luthers von 1526 bis 1546, Gttingen:Evangelischer, 1983, pp. 33145; Mark U. Edwards, Jr., Luthers Last Battles. Politics andPolemics, 15311546, Ithaca: Cornell UP, 1983; Mark U. Edwards, Jr., Luthers Last Battles, inCTQ 48 (1984), pp. 12540; Tibor Fabiny, Luther szentsgkritikja s szentsgtana, in Mrleg38 (2002), pp. 8599; Krey, Luther and the Apocalypse, pp. 13545; Stephen Westerholm,Perspectives Old and New on Paul. The Lutheran Paul and His Critics, Grand Rapids: Eerd-mans, 2003; Theo M.M.A.C. Bell, Man is a Microcosmos: Adam and Eve in Luthers Lectureson Genesis (15351545), in CTQ 69 (2005), pp. 15984. 211 The tradition that Luther nailed his theses on the door of the Schlokirche in Wit-tenberg on 31 October 1517 has been called into question by historians. For example, HansVolz suggested that the nailing took place a day later, on 1 November (Hans Volz, Anwelchem Tag schlug Martin Luther seine 95 Thesen an die Wittenberger Schlosskirche an?, inDeutsches Pfarrerblatt 57 (1957), pp. 45758). Erwin Iserloh, professor of church history atthe University of Trier, proposed the theory in 1961 that Luther never nailed them to thechurch door but instead sent them to two of his ecclesiastical superiorsBishop Schulz ofBrandenburg and Archbishop Albrecht of Magdeburg and Mainz. He has argued that thefirst source for this tradition is Melanchthons description in 1546, written only after thedeath of Luther, and that Melanchthon was nowhere near Wittenberg in 1517. Iserloh has post-mortem existence in the early reformation period 165
The ninety-five theses were soon printed and circulated widely not onlythroughout Germany, but all over northwest Europe and even beyond.Rome was compelled to react. In 1518, Pope Leo X (14751521, pope 151321)sent an envoy to obtain Luthers formal withdrawal of some of his unortho-dox teachings. This envoy was Cardinal Cajetan (Tomasso di Vio Gaetano,14691534), an Italian theologian, excellent biblical scholar, and general ofthe Dominicans.212 In October Luther was heard in Augsburg, but insteadof recanting, he began to question the jurisdiction of the Pope. Luther started his dissent on the question of indulgences, and he didnot desire to establish any new teachings, let alone a new church commu-nity. His ninety-five theses (1517) were centred around the objectionablepractice of selling indulgences and touched upon Purgatory only tangen-tially. Even then, his chief concern was about the financial and lucrativecharacter of the clerical abuse of the teaching on Purgatory. At that timehe did not deny the existence of Purgatory as such at all.213 His rejection
also pointed out that there was no open discussion at Wittenberg, that no original copyor printing of Luthers theses is preserved, and that Luthers own words suggest that heacted in secret. Nonetheless, it is also clear from Iserlohs book that it was the intention ofLuther and the leaders of Protestant Reformation to commemorate the beginning of theirmovement on the Eve of All Saints Day 1517. (Erwin Iserloh, Luther Thesenanschlag: Tat-sache oder Legende?, in Trierer theologische Zeitschrift 70 (1961), pp. 30312; Erwin Iserloh,Luther zwischen Reform und Reformation. Der Thesenanschlag fand nicht statt, Mnster:Aschendorff, 1966; English translation: Erwin Iserloh, The Theses Were Not Posted. LutherBetween Reform and Reformation, trans. Jared Wicks, London: Geoffrey Chapman, 1968;Wilhelm Pauck, The Catholic Luther, in John C. Olin, James D. Smart & Robert E.McNally (eds.), Luther, Erasmus and the Reformation. A Catholic-Protestant Reappraisal,New York: Fordham UP, 1969, pp. 4858, esp. 4952; Thurman L. Smith, Luther and theIserloh Thesis from a Numismatic Perspective, in SCJ 20 (1989), pp. 183201). Aland andBornkamm argued against Iserloh and Volz in favour of the authenticity of the event onthe traditional date: Kurt Aland, Martin Luthers 95 Thesen. Mit den dazugehrigen Doku-menten aus der Geschichte der Reformation, Hamburg: Furche-Verlag H. Rennebach, 1965;Kurt Aland, Die Reformatoren. Luther, Melanchthon, Zwingli, Calvin. Mit einem Nachwortzur Reformationsgeschichte, Gtersloh: Gtersloher, 41986; Heinrich Bornkamm, Thesenund Thesenanschlag Luthers: Geschehen und Bedeutung, Berlin: Tpelmann, 1967. On indul-gences see supra on p. 112. 212On Thomas Cajetan, see: Jared Wicks, Cajetan und die Anfnge der Reformation,(Katholisches Leben und Kirchenreform im Zeitalter der Glaubensspaltung: Vereinss-chriften der Gesellschaft zur Herausgabe des Corpus Catholicorum 43), Mnster: Aschen-dorff, 1983; Barbara Hallensleben, Communicatio. Anthropologie und Gnadenlehre beiThomas de Vio Cajetan, (RST 123), Mnster: Aschendorff, 1985; Charles Morerod, Cajetanet Luther en 1518, (Cahiers oecumniques 26), Fribourg: Ed. Universitaires, 1994; Kather-ine Elliot van Liere, Vitoria, Cajetan, and the Conciliarists, in JHI 58 (1997), pp. 597616;Bernhard Alfred R. Felmberg, Die Ablasstheologie Kardinal Cajetans (14691534), (SMRT66), Leiden: Brill, 1998. 213Martin Luther, Disputatio pro declaratione virtutis indulgentiarum (1517), publishedin WA I, pp. 23338. See esp. articles 1625 on p. 234.166 chapter three
traditional biblical proof texts cited by Eck were dubious in Luthers view.Luther declared that the only thing he knew about the souls in Purgatoryis that they suffer there and are helped by our good works and prayers.221He denied, however, that either good works or prayers gave any satisfac-tion and maintained that indulgences had no effect whatsoever on thefate of the deceased. Apparently Luther (like most of his contemporaries)did not regard indulgences as the extension of penitential works.222 The Leipzig Disputation was a turning point in Luthers career, as itexposed the extent of his estrangement from the official position of theChurch (especially on the other three issues). The subsequent excom-munication and the Edict of Worms (1521) only made explicit what wasalready implicitly manifested in Leipzig: Luther had become irrevoca-bly seen as a heretic. His teachings began to differ more and more fromthe orthodox views. In his Assertio omnium articulorum (1520)223 he stillheld that Purgatory exists (ego tamen et credo purgatorium esse et consulosuadeque credendum) and that Scripture remains silent about Purgatory.224According to Luther, the souls are not tormented by fire but by their ban-ishment and by fear.225 Nonetheless, Luther claimed, the only reason forarguing for the existence of Purgatory is the concern of the Papist Churchfor its profit.226 Therefore, one is not necessarily a heretic if one deniesthe existence of Purgatory, nor is one a Christian per se if one affirms itsexistence.227 Luther uses the example of the Greek Church, which deniesthe existence of Purgatory but is still considered Catholic. Rome reacted to Luthers estrangement from the Catholic teachingsin the form of a bull issued in 1520. The papal bull Exsurge Domine wasissued on 15 June 1520. It extracted 41 errors from Luthers 95 theses, his
221Ego enim nihil de purgatorio novi nisi animas ibi pati iuvandas operibus et ora-tionibus nostris (WA II, p. 325). 222Cf. Romanus Cessarios remark, which held that one might even argue that ifAquinass theological finesse in treating indulgences had shaped the practice of the churchin the sixteenth century, they might not have been one of the issues that provoked Prot-estant reform (Cessario, Christian Satisfaction in Aquinas, p. 77). For Aquinas position,see supra on p. 113. 223Martin Luther, Assertio omnium articulorum M. Lutheri per bullam Leonis X. novis-simam damnatorum, Wittenberg: Melchior Lotter, 1920. Published in WA VII, pp. 94151. 224WA VII, pp. 111 and 149. 225Iam cum ipsimet fateantur, Animas non ab igne, sed in igne pati, quam possuntaliam poenam dare quam fugam et horrorem? (WA VII, p. 111). 226Et quae necessitas est pro purgatorio sic tumultari, nisi quod Papistica Ecclesialucro suo timet, quod inaestimabile trahit ex purgatorio? (WA VII, p. 149). 227Suo quisque periculo hic credat vel non credat, non est haereticus, si purgatoriumnon credit, nec ideo Christianus, si credit (WA VII, p. 149).168 chapter three
228Purgatorium non potest probari ex sacra Scriptura quae est in canone (Leo X,Exsurge Domine, as contained in DH 1487 (DS 777)). 229Martin Luther, Grund vnd vrsach aller Artikel D. Marti. Luther: szo durch RomischeBulle vnrechtlich vordampt seyn, Wittenberg, 1521, republished in WA VII, pp. 308457. 230Das aber die grosse furcht. mocht wol eyn fegfewr seyn. hab ich. dunkels weygehalten wey das selb widder zc setzen noch zcu entsetzen. Die erfarung wirtts wolleren. Ist auch nichts dran gelegen. ob wyr nit wissenn (WA VII, p. 348). 231Mich hab ich beschlossen es sey eyn fegfewr. kam aber seynen andernn alobeschlieen (WA VII, p. 450, cf. p. 452). 232Ist gng das du wissist wie sie ynn grosser vntreglicher peyn seyn. vnnd deynerhulff begeren. aber yhe dauon disputiern, o la doch eyn wahn bleyben ynnd gutte mey-nung wie ich thue (WA VII, p. 454). 233Quis vero enumeret prodigia illa de solis defunctis? Bone deus, quantum hic maremendaciorum de apparitionibus, adiurationibus responsisque spiritum inundavit, quibusfactus est, ut Papa etiam mortuorum rex factus sit et in purgatorio iam regnet magno sacri-ficulorum incomodo, si pergat: qui e purgatorio omnem victum, omnes spes, omnem illam post-mortem existence in the early reformation period 169
A year later Luther distanced himself a step further from the officialteaching of the Church. In a letter dated 13 January 1522 that was writtento his Wittenberg scholar friend Canon Nicholaus von Amsdorf (14831565), who had accompanied Luther to the Leipzig Disputation and theDiet of Worms, Luther addressed the idea of soul sleep for the first time.234Amsdorfs original letter has not been found, but from Luthers answer itseems that Amsdorf had asked Luther about his opinion on the matter.In his response Luther states that he is ready to concede that the soulsof the righteous sleep at an unknown place until the Day of Judgement.235This is what 2 Sam. 7:12 (in the Vulgates reading: dormiunt cum patribussuis) seems to suggest, Luther argued. But Luther was not sure if this isthe case for all souls, if one takes the raptures of Paul (2 Cor. 12:2), Moses(Dt. 35:5f), and Elijah (2 Kgs. 2:11) into consideration. Luther maintainedthat the appearance of these last two on Mount Tabor (Mt. 17:3), as wellas the story of Lazarus and the Rich Man, seems to contradict such a sleepof the souls after death. Therefore, it is not clear what God does with thesouls separated from their bodies.236 It also remains unresolved whetherthe damned will receive their punishment immediately after their deathor only at the end of the world, but it is conceivable that they, too, areasleep and insensible until the second coming.237 In any case, the denialof the existence of Purgatory in the traditional sense (which is a necessaryconclusion if one assumes the souls to be asleep) cannot render anyone aheretic, Luther asserted again.238 For Purgatory is not so much a distinctplace, Luther wrote, but a state of purgation by torment.239 The publication of Gansforts Farrago in Wittenberg (1522) was prob-ably not without effect on Luthers views of Purgatory.240 Luther musthave recognized that he arrived at a conclusion similar to Gansforts whenGansfort taught that Purgatory is not so much a place as a necessary stateof the soul during a post-mortem purgation. Also, Gansforts doubts aboutthe effect of intercessions for the dead and about the jurisdiction of the
rerum pompam habent, minus habituri, si fidem viventium aeque docerent atque proposi-tiones defunctorum (WA VII, p. 749). For Friths English translation, see: infra on p. 266. 234WA BW II, pp. 42224. 235Proclive mihi est concedere tecum in eam sententiam, iustorum animas dormireac usque ad iudicii diem nescire, ubi sint (WA BW II, p. 422). 236Quis enim novit, quomodo Deus agat cum animabus separatis? (WA BW II,p. 422). 237Veresimile autem, exceptis paucis omnes dormire insensibiles (WA BW II, p. 422). 238Non enim, si neges purgatorium, haereticus es (WA BW II, p. 423). 239WA BW II, pp. 42223. 240See supra on p. 86.170 chapter three
noch drynnen bi an den iungsten tag, augenomen die o mit Christo sind schon auffer-standen, wie Mattheus schryebt am 26. [sic] Capitel [vere 27,52] (WA X/3, p. 191). 247Derhalben dise scho ist das Ewangelium, die verhaissung die dem Abrahamgeschehen ist, da mssen wir alle hynein, wenn ich unnd ein yegklicher Christ sterbenmu, so mu er die augen zuthun und allain an gottes wort hangen und got vertrawen,das er unns auff nemen werdt (WA XII, p. 596). 248Denn gleych wie Abrahams scho Gottis wort ist, darynnen die glawbigen durchden glawben rugen, schlaffen, und bewaret werden bi an den iungsten tag, Also muyhe widderumb die helle syen, da Gottis wort nicht ist, darynnen die unglewbigen durchden unglawben verstossen sind bi an iungsten tag: Das kan nicht anders den eynn leer,unglewbig, sundig, be gewissen seyn (WA X/3, p. 192). 249Denn hie mu man die zeyt au dem synn thun unnd wissen, das ynn yhener welltnicht zeytt noch stund sind, ondernn alles eyn ewiger augenblick, wie Sanct Petrus amzweytten Pet: am zweyten sagt (WA X/3, p. 194). 250On atemporality after death in Luthers eschatology, see: Robin B. Barnes, Prophecyand Gnosis. Apocalypticism and the Wake of the Lutheran Reformation, Stanford: UP, 1988,pp. 3637. 251WA X/3, p. 194. 252Und wenn man auffersteen wirt, so wurde es Adam und den alten vetern werden,gleich als weren sie vor einer halben stundt noch im leben gewest. Drt is kain zeyt (WAXII, p. 596). 253Wyr haben keyn gepot von Got fur die todten z bitten, Darumb niemant dransundigen kan, der nicht fur sie bittet (WA X/3, p. 194).172 chapter three
Lieber Gott, ist die seele ynn dem stand, das yhr noch z helffen ist, Sobitt ich, wolltist yhr gnedig seyn.254 This prayer, as Koslofsky puts it,is a far cry from the certain intercession for the dead offered by theRoman church through masses, vigils, and indulgences.255 In fact, Lutherpreached that to say masses for the dead and to hold vigils for them iswicked and sinful (b und snd); it is a mockery of God (da wirtt Gottverspottet) and is pure blasphemy (lauter lesterung Gottis).256 By 1525, Luther openly endorsed the idea of soul sleep. Expoundingupon Jn. 8:51 (Very truly, I tell you, whoever keeps my word will neversee death) in a Lenten church postil, Luther differentiated between dying(sterben) and seeing or tasting death (den tod sehen oder schmecken).257The faithful, he claimed, in spite of the fact that they, too, have to die,will not see or taste death, because they keep and cling unto Christswords. But the infidels will taste death, that is to say, the power and mightor bitterness of death, which is eternal death and Hell, because they donot keep Christs word.258 For Luther, the future destinies of the humanpersondeath or Hell on the one hand and Heaven or resurrection on the otherare only the terminus, the final stage of a process that can already be experienced by the person during his or her earthly life. The Christians are already saved from death and Hell in this earthly life, so even when they die, Luther held, they will live (Jn. 11:25), for they will have no recollection of the atemporal soul sleep.259 The Scriptures call death sleep, he argued, and just as one who falls asleep and wakes up the next morning does not know what has happened in the meantime, so will the just rise up suddenly on the last day unaware that they were in and had passed through death.260 A year later (1526), he remarked that Eccl. 9:5 (the living know that they will die, but the dead know nothing; they have no more reward, and even the memory of them is lost) is the most power- ful passage in Scripture to show that the dead are asleep and do not know
anything about earthly affairs.261 Luther argued that this clearly stands inopposition to the invocation of the saints and the fiction of Purgatory. In his Vom Abendmahl Christi, Bekenntnis (1528),262 Luther repeated hisargument that neither Purgatory nor prayer for the dead has any scrip-tural basis. Therefore, Luther maintained, it is not necessary to believein Purgatory. Nonetheless, Luther added, all things are possible for God,and he could very well allow souls to be tormented after their departurefrom the body. But since God has not caused this to be spoken or writtenabout, he does not wish to have it believed either, Luther argued.263 Healso expressed that he knew of some kind of a Purgatory, but he deemedit improper to teach anything about it in the congregation or to deal withit by means of endowments or vigils.264 By 1530 Luther was already completely estranged from the Catholic doc-trine of Purgatory and wrote his Widerruf vom Fegefeuer.265 In that workan already embittered Luther resolutely denied the existence of Purgatoryand advocated the indifferent sleep of the soul after being separated fromthe body by death. Luther began his work by reiterating his earlier posi-tion about the Catholic proof text par excellence for Purgatory (2 Macc.12:4345), claiming that the book is not part of the Bible and thereforecannot be held as a decisive argument.266 Furthermore, he asserts that thepassage says nothing about Purgatory but refers to the article of faith onthe resurrection of the dead, which was very much despised at the time
the book was written, just as it was in Luthers own time, he claimed.267On the contrary, the text argues against any prayer for the dead in Purga-tory, Luther argues, because it claims that there is nothing to stop the painor the purging of the souls, as it says: For if he were not expecting thatthose who had fallen would rise again, it would have been superfluousand foolish to pray for the dead. Here it is clear, Luther explains, that thedead can be freed from their sins only at the time of the resurrection, andnot before. Therefore, the text is not only dubious, but it directly contra-dicts the efficacy of the prayers for the souls in Purgatory.268 Furthermore,Luther held, the text speaks about one example which is not necessarilyto be followed, as the numerous human sacrifices that the Bible men-tions are clearly not to be followed (cf. Gen. 22:2; 2 Kgs. 16:3; 21:6; Jer. 7:31;Ez. 16:20).269 Anyway, Luther continued, Judas Maccabeus provided for aJewish sacrifice according to the old covenant (Lev. 4), which is abolishednow by Christ. So if Judas lived now, he would not dare to act in a simi-lar way any longer.270 Accordingly, if the Papists really wanted to followJudas, they would also have to sacrifice oxen, goats, and sheep, Luthermaintained. Luther also denied that Ps. 66(65):12 (we went through fire and throughwater; yet you have brought us out to a spacious place) referred to Purga-tory. It only speaks about the sufferings of the holy ones in these times(i.e. Luthers own time), he asserted.271 At the time when the psalm was
267Der text sagt von den sunden der verstorbenen und lobet Judas umb den artickelder aufferstehung, das der gute man, der dis buch gemacht hat, wil hiemit preisen denedlen artickel von dem aufferstehen der todten, der dazumal (wie auch noch) seerverachtet war (WA XXX/2, p. 369). 268WA XXX/2, p. 369. 269WA XXX/2, pp. 37071. 270Denn Judas hat wie ein Jde nach dem alten gesetz geopffert, welche nu durchChristum haben auffgehret. Und wo Judas it lebte, thurst ers nicht mehr thun (WAXXX/2, p. 371). 271Er sagt allain vom leiden der heiligen ynn dieser zeit (WA XXX/2, p. 373). SinceLuther equated the papacy (especially after Gregory VII) with the Antichrist, and he con-ceived the advance of the Ottoman Empire and the persecution of the Reformers as signsof the end times as described in Daniel and Revelation, he (like many of his contempo-raries) lived in constant and eager expectation of an imminent end to the world. Nonethe-less, Luther rejected chiliasm (see supra on p. 92) and calculations of the arrival of the endof the world (e.g. the calculations of his student, Michael Stiefel (also spelled Stifel or Sty-fel; d. 1567), that Christ would return on 19 October 1533). In these last times of affliction,Luther looked forwardwithout temporal calculationto Christs second coming and thelieber jungster Tag (Letter of Luther to his wife, dated Eisenach, 16 July 1540, WA BW IX,p. 175, no. 3512, li. 17). See: Robin Bruce, Prophecy and Gnosis. Apocalypticism in the Wake post-mortem existence in the early reformation period 175
written, Purgatory did not yet exist, he claimed, so the psalmist could notpossibly refer to it.272 Luther also denied that water in this verse wouldrefer to some kind of water in which, as if in a sanctifying holy sauna, thesouls were being tortured by rushing to and fro between the heat of thefiery sunshine and the icy water (cf. Job 24:19 in the Vg: ad nimium caloremtranseat ab aquis nivium et usque ad inferos peccatum illius).273 Nor can Rev. 14:13 (Blessed are the dead who from now on die in theLord...They will rest from their labours, for their deeds follow them) betaken as a reference for the intercession for the souls in Purgatory, Lutherargued, because the text speaks about their own deeds in their life beforethey died, and not about vigils and intercessions that are offered for themafter they died.274 In Luthers view, the text signified the faithful who diein peace and in the faith in the Lord. The deceased who have died in theLord are holy, Luther explained, and they enter into rest (cf. Wis. 3:3) andare at peace, as Is. 57:2 says that the just, when they die, go in peace asif to bed. For this reason they are called the sleepers, and their death iscalled sleep throughout the Scriptures.275 Moreover, when 1 Cor. 3:15 (If any mans work shall be burned, he shallsuffer loss: but he himself shall be saved; yet so as by fire) is taken asa reference to purgatorial fire, it is clearly taken out of context, Lutherargued. For a proper explanation of this passage, he refers to JohannesBugenhagen.276 Bugenhagen claimed that the text clearly talked about the
of the Lutheran Reformation, Stanford: UP, 1988; Heiko A. Oberman, Teufelsdreck. Eschatol-ogy and Scatology in the Old Luther, in Heiko A. Oberman, The Impact of the Reformation,Grand Rapids: Eerdmans, 1994, pp. 6465; Carter Lindberg, Eschatology and Fanaticismin the Reformation Era. Luther and the Anabaptists, in CTQ 64 (2000), pp. 25978; MllerJensen, Denmark and the Crusades 14001650, pp. 193234, esp. pp. 22628. 272Das fegfeur aber ist da zu mal noch nicht gewest, Darumb kan er nich davon reden(WA XXX/2, p. 373). 273Und sol der meinung sein das die seelen von der hitze zur kelte vnd widderumbfaren mssen. Hiob aber sagt, wie der schnee eme ein ende vnd werde zu wasser vonder sonnen hitze Also verderben auch die ehebrecher hie auf erden an leib vnd gt (WAXXX/2, p. 374). 274WA XXX/2, pp. 37578. 275Nu spricht hie der Text, das solche todten, so im Herrn sterben, sind selig, [...] dassie rugen und im friede sind, wie auch Isaias lvii sagt, das die gerechten [...] wenn sie ster-ben, gehen inn den frieden wie inn ein bette. Und Sap. am iij. zeuget auch: der gerechtenseelen sind im friede. So zeigt auch die schrifft hin vnd widder, als von Abraham, Isaac,Iacob, Iosia, das sie im friede sollen sterben, Und heissen auch dermb die schlaffenden,und ihr tod ein schlaff durch die gantze schrifft (WA XXX/2, p. 376). 276Johannes Bugenhagen, Ioannis Bugenhagii Pomerani commentarius, In quat-uor capita prioris Epistol ad Corinthios, de sapientia & iusticia dei qu Christus est,176 chapter three
preachers and teachers, who are to build the Christian church with theirteachings, and that Paul called some teachings gold, silver, and preciousstones; other teachings, however, were wood, hay, and straw (1 Cor. 3:12).Obviously, Paul does not speak of the gold, silver, and precious stonesthat women wear around their neck, nor does he speak of the wood, hay,or straw that cows and calves eat. But the teachings and sermons of theChristians will not be eaten by cows, nor will they be worn around anywomans neck, as any cow would probably know unless it was a Sophist(Papist). Likewise, the fire by which the teachings are tested is not the firewith which gold, silver, hay, and straw are tested, but another fire, onethat will test what just and unjust are on the day on which this will berevealed.277 But if the text speaks about the teachings and the sermons,Luther argued, then Purgatory as the Papists believe it to be must be onlyfor the teachers and the preachers, because they are the ones who deliverthem, and not the ordinary believer.278 The fire, then, cannot be the fire ofPurgatory, but only the fire of opposition that the preaching of the Gospelhas to pass through in this world.279 After refuting the Catholics classic biblical proof texts, Luther attacksthe Sacred Tradition as presented by the Church Fathers. Their testimo-nies, Luther maintained, are contradictory, confusing, and unwarranted.St Gregory, for example, wrote about the purgatorial fire,280 but he isuntrustworthy because he also mentions many examples of the appear-ance of ghosts, and these ghosts, Luther affirmed, cannot be anyone butthe devil.281 When the Church Fathers cite from the Bible, their quota-tions are often taken out of context and are against the sense of the origi-nal text, Luther claimed.282 These naive pious men meant no harm andwished to establish no new teachings. They spoke inconsiderately, but not
with bad, heretical intentions, Luther believed.283 Yet their writings weretwisted and abused by the Sophists to make new articles of faith.284 To conclude, Luther claims that there is no reason to believe in Purga-tory, and the psalms and other biblical texts used in the vigils and suffrageshave nothing to do with Purgatory. Consequently, the Catholic liturgies ofpraying for the dead are a blasphemous abuse and abomination (lesterli-cher misbreuch vnd grewel).285 After the publication of the Widerruf vom Fegefeuer, there is no furthermention in Luthers works of the possibility of the existence of Purga-tory or any purification after death. When he had his above-mentionedsermons reprinted in the 1530s, he carefully removed every reference tothese topics.286 Yet Luther remained enthralled with issues concerningthe hereafter.287 In his sermon on Easter Monday, 6 April 1534, preachingabout Jesus encounter with the disciples on their way to Emmaus, Lutherwondered what Jesus could possibly cite from Moses (Lk. 24:27) to provethat the Son of Man had to suffer and rise again.288 One such possibletext, recorded in Mt. 22:32, which Christ used to prove resurrection duringHis earthly life in His discussion with the Sadducees, is one of the mostcommonly used texts of the OT.289 God is not the God of things that donot exist, Luther explained, and therefore Abraham, Isaac, Jacob, and allof the other prophets, as well as those in the grave, must be alive in theeyes of God, because God said to Moses that His name will be the Godof Abraham, the God of Isaac, and the God of Jacob forever (Ex. 3:15).290
283Die lieben veter haben solchs unbedacht, aber nicht bser, ketzerischer meinunggered (WA XXX/2, p. 382). 284WA XXX/2, pp. 38084. 285WA XXX/2, p. 389. 286Koslofsky, Separating the Living from the Dead, p. 138; Kstlin, Luthers Theologie,I, p. 376. 287Luther was also concerned inter alia about Christs descent into Hell. He held thatChrists soul descended into Hell according to its substance: Vere enim anima christisecundum substantiam descendit ad inferos (WA V, p. 463). He rejected the idea of uni-versal salvation (WA XXVI, p. 509; XXXVII, p. 372). 288Ego optarem, , quales scripturas ex Mose etpropheteis, quibus corda et , quod ,resurgere et in nomine eius praedicari remissio peccatorum, , , quod tale nihil in Mose (WA XXXVII, p. 363). 289Accepit , quod Iudaei habebant: Ego deus Abraham. Istaoptime noverunt, fuit communissimus textus (WA XXXVII, p. 365). 290Quid ? Sadducaei non de spiritu, angelis. Ibi Christusfacit Mosen , qui cecus &c. quid? deus est Abraham, Iacob, &c. 178 chapter three
But this being alive in the eyes of God, the resurrection, has alreadystarted in this life, as Luther argued on the basis of 2Cor. 4:12 in his ser-mon on the following day.291 But even if Paul is speaking spiritually aboutresurrection, flesh and blood will rise on Judgement Day, for this is theultimate promise and hope of the believer (cf. Rom. 8:11).292 Luther alsowarned that dying spiritually (geistlich) with Christ, being buried spiritu-ally with Him, and rising spiritually together with Him should not denotethe detestation of the body or the physical reality.293 Obviously, Luthers
. Num putatis deum, qui sit mortuus? si est deus, oportet vivere, qualis &c.Si est deus, Abraham oportet vivat, et tamen mortuus. Sic Isaac, , ettamen omnes mortui et sepulti. Si deus et omnium prophetarum, oportet sint vivi, quiadeus non est rei, quae non est. Qualis est deus, oportet sit deus huius, quod est. Ideo Abra-ham, qui est in terris, oportet sit. Coram oculis sunt mortui, Sed in oculis dei vivi. Ideodicit: Hoc nomen meum (WA XXXVII, p. 365).
291Dicit ergo Paulus: sic est resurrectio , tam efficax , quod invobis operetur, , etiam hic in terris, et hic mori, ut dicit: mor-tui, et vita vestra &c. , quod mortui et resurrexistis, , , , , tum in vobis invenientis, an vera et efficax in vobis, ut non sit
loquitur hic. Non de coelo et terra ut creata, Non de homine, ut habet animam, corpus,5 sensus, , a deo creata et omnia bona, quae dicit &c. De hisnon loquitur. Sed is est terrenus homo, qui est sine deo, non agnoscit a deo dari, nihilhabet, nisi quod dat ratio, qui est infidelis, caecus, nihil sciens de deo, vita aeterna et noncurat, sed rationem, , sine verbo, (WA XXXVII, p. 368).
294See supra on p. 93. 295For Luthers reasons for suggesting extramural burial places, see: Koslofsky, TheReformation of the Dead. Death and Ritual in Early Modern Germany, London: Macmillan,New York: St. Martins Press (Palgrave), 2000, pp. 4849. 296WA XXX/1, p. 250; WA XXVI, p. 509. Cf. Ulrich Asendorf, Eschatologie bei Luther,Gttingen: V&R, 1967, p. 287; Paul Althaus, Die Theologie Martin Luthers, Gtersloh:Gtersloher Verlagshaus Gerd Mohn, 1962, p. 349. 297In later years, however, Luther reverted occasionally to his inherited Catholic viewon the fate of the soul after death. As a consequence, the doctrine on psychosomnolencewas in most Protestant denominations replaced by that on the natural immortality of thesoul. See: Althaus, Die letzten Dinge, pp. 14647. 298To the contrary: George R. Knight, Seventh-day Adventists Answer Questions on Doc-trine, Washington (DC): Review and Herald Publishing Association, 1957, pp. 56975.180 chapter three
sible to pass from one place to the other (cf. Lk. 16:26).305 Karlstadt alsoheld that people believing in the immortality of the soul merely based onthe Purgatory of St Patrick306 are for this very reason infidels.307 In thiscompilation of propositions Karlstadt apparently rejects the existence ofPurgatory altogether and excludes any post-mortem purification. At the end of the same year or in early 1523, while still in WittenbergKarlstadt published, in quarto format, his Ein Sermon vom stand der Christ-glaubigen seelen, von Abrahams schosz vnd fegfeur/ der abgeschydnenseelen.308 The short pamphlet of barely twelve pages became a bestsellerand saw altogether seven consecutive editions in Augsburg, Nrnberg, andStrasbourg in 1523 alone.309 This work of Karlstadt already shows a directinfluence of Wessel Gansforts writings, published only a year earlier inWittenberg.310 The book is presumably the written form of an actual ser-mon, delivered in Wittenberg, possibly on All Souls Day 1522.311 Karlstadts Ein Sermon vom stand der Christglaubigen Seelen stands insharp contrast to his earlier publication, for in his new book he did not
305Inter locum solacij, & cruciatus ingens hiatus firmatus est. Ut ij qui solatio fruunturuolentes hinc transire ad miseros non possunt, Neque captiui huc transcendere (LutheriMelanch. Carolostadii &c. propositiones, Basel 1522, sig. C3r). 306A popular place of pilgrimage in Ireland, described by Jacobus de Voragine in theLegenda Aurea, (much circulated in manuscript form, and first printed in Strasbourg in1482). 307Qui animarum immortalitam propter beati Patricij purgatorium credunt, iam infi-deles sunt (Lutheri Melanch. Carolostadii &c. propositiones, Basel 1522, sig. C8v). 308Andreas Bodenstein von Karlstadt, Ein Sermon vom stand der Christglaubigen seelen,von Abrahams schosz vnd fegfeur/ der abgeschydnen seelen, Wittemberg [vere Nrnberg:Johann Stuchs an der Wende, 1522/1523]. 309Besides the quarto Nrnberg edition (see n. 308), the other editions (all in quarto)were: five editions in Augsburg (three by Philipp Ulhart, one by Jrg Nadler, and anotherby Sigmund Grimm) and one in Strasbourg by the heirs of Matthias Schrer (d. 1519) (Mat-thias Schrer Erben). See: Ernst Koch, art. Fegefeur, in Theologische Realenzyklopdie,vol. 5, Berlin, 1976, p. 74; Kohler, Wilfert & Weismann, Flugschriften des frhen 16, Fiche332, no. 937; Alejandro Zorzin, Karlstadt als Flugschriftenautor, (Gttinger theologischeArbeiten, 48), Gttingen: V&R, 1990, pp. 97100 and 273308, n. 52; Woodbridge, GerhardWesterburg, p. 105. Koslofsky counts only six editions. (Koslofsky, Separating the Livingfrom the Dead, p. 130). 310See supra on pp. 86 and 127. The influence of Gansfort on Karlstadt was first pro-posed by Williams, The Radical Reformation, 1962, p. 104, and was demonstrated byKleiner, Andreas Bodenstein von Karlstadts Eschatology, pp. 16. Koslofsky suggests thatKarlstadt may have been instrumental in bringing Gansforts writings to press in Witten-berg in 1522 (Koslofsky, Separating the Living from the Dead, p. 130). 311 Karlstadt refers to 1 Thes. 4 as todays reading and as Das ist die Epistle, wlchedie vermainte Christliche kirche den Seelen zu hilf und trost gestatt ze lesen und zu sin-gen (Andreas Bodenstein von Karlstadt, Ein Sermon vom stand der Christglaubigen seelen,(1523), sigs. A2v and A3r). See: Koslofsky, Separating the Living from the Dead, p. 135.182 chapter three
312Koslofsky counted only six editions. Koslofsky, Separating the Living from the Dead,p. 130. 313On Gansforts book in Wittenberg, see supra nn. 2 and 4 on p. 127. For developinga spiritual understanding of Purgatory, Hans-Peter Hasse revealed Karlstadts dependenceon the mystical German theologian Johannes Tauler (c.130061). Hasse, Karlstadt undTauler. See also: Woodbridge, Gerhard Westerburg, pp. 12729. post-mortem existence in the early reformation period 183
preach that Purgatory should be feared and that the souls abiding there arein a miserable position and should be pitied. But in reality, one should notwant to bring them out from Purgatory, because the state of the souls thereis better than that of the living.314 Praying for the dead is thus not onlyuseless, but it is also wrong, for unless one asks from God what Gods ownwill is, a prayer for the souls release from Purgatory is wicked and againstGod.315 Therefore, Karlstadt criticized the Catholic practice of suffrages forthe deceased, asserting that no earthly intercession but fire alone is able topurify the souls and bring them closer to God. Karlstadt also believed thatin this spiritual Purgatory die Abgeschiedenen schlummern, sie sind nichttot, sondern schlafen.316 With this booklet Karlstadt was the first Protes-tantpreceding even Lutherto openly defend the idea of soul sleep.317 In the same year (1523) Karlstadts brother-in-law, the Cologne theolo-gian and reformer Gerhard Westerburg (14861558), published an adaptedversion of Karlstadts work under the title Uom fegfewer vnnd standt ver-scheyden selen eyn Chrystliche meynung (Strasbourg, 1523).318 Westerburgwas clearly taken by the subject, for he also published a Latin booklet onthe same topic later in the course of the same year, with the title De pur-gatorio et animarum statu (Strasbourg, 1523).319 Although it follows a com-parable train of thought with arguments similar to his German writing,the Latin pamphlet is not a translation but an original work. While theGerman work was intended as popular reading for the common peopleof Germany, the Latin treatise was more concise and, besides the obvious
314Das wir sie au dem standt wollten bringen der besser ist dann unser standt?(Andreas Bodenstein von Karlstadt, Ein Sermon vom stand der Christglaubigen seelen,(1523), sig. A3v). 315So wer unser geebt wider got und b (Andreas Bodenstein von Karlstadt, EinSermon vom stand der Christglaubigen seelen, (1523), sig. A3r). 316Andreas Bodenstein von Karlstadt, Ein Sermon vom stand der Christglaubigen seelen,(1523), sig. A3v. Cf. also Wir haben hoffnung das unsere abgestorbne freundt in Christoverstorben seind. [...] und hoffen darzu/ das sie in Christo schlaffen/ wie Lazarus in derscho Abrae schlieff [...] Auch wissen wir/ das sie Christus im letsten tage wirt auff-wecken/ und bey sich behalten (sig. A4r). 317Cf. HZSW VI,1, p.188, n. 4; Willem Balke, Calvijn en de doperse radikalen, Amster-dam: Bolland, 1977, p. 35. 318For the bibliographical data of the German pamphlet, see infra n. 321. On West-erburgs life and theology, see: Georg Eduard Steitz, Dr. Gerhard Westerburg, in Archivfr Frankfurts Geschichte und Kunst, 5 (1872), pp. 1215; Calvin Augustine Pater, West-erburg. The Father of Anabaptism. Author and content of the Dyalogus of 1527, in ARg 85(1994), pp. 13863; Woodbridge, Gerhard Westerburg; Theodor C. Schlter, Flug- undStreitschriften zur Klner Reformation, Wiesbaden: Harrassowitz, 2005, pp. 118.13132. 319For bibliographical data of the Latin pamphlet, see infra n. 321. Due to the similaritybetween Westerburgs books and Karlstadts work, the authorship of Westerburgs pam-phlets has been called into question by some. For a discussion, see: Woodbridge, GerhardWesterburg, pp. 11015.184 chapter three
320Ich hab ein bu chlein vor zehen iaren im latin lassen augehen vnd ist die selbigemeinung vom fegfewr/ wie sie im deutschen buch gedruckt/ Es hat auch kein vnderscheitmit dem deutschen/ dan das das (sic) deutsch buch mehr innen hat/ vnd weitleufftigergeschrieben ist/ dan das latinisch (Gerhart Westerburg, Wie die hochgelerten von CllnDoctores in der Gottheit vnd Ketzermeister/ den Doctor Gerhart Westerburg des Fegfewrshalben/ als einen vnglaubigen verurtheilt/ vnd verdampt haben. Wie Doctor Johann Cocleusvon Wendelstein wider D. Westerburgs buch/ vom Fegfewr geschrieben, Marpurg im Paradi:Frantzen Rhodi, 1533, sig. G3r). 321The German editions were: (1) Gerhard Westerburg, Uom fegfewer vnnd standtverscheyden selen eyn Chrystliche meynung durch doctor Gerhart westerburch von CoellenNeulich augangen. Gedruckt jm jar M.D.xxiij., Straburg: Johann Knobloch der ltere(d. 1528), 1523; (2) Gerhard Westerburg, Vom Fegfewer vnd stand der verschayden selen/ ainChristliche mainung nit wie biher frgeben. Durch Doc. Gerhard Westerburch von Coelen/neu lich augangen, Augsburg: Heinrich Steiner, 1523; and (3) Gerhard Westerburg, Uomfegefewer und standt der verscheyden selen eyn Christliche meynung durch Doctor GerhartWesterburch von Coellen Neulich augangen. Gedruckt jm jar. M.D.xxiij., [Kln: EuchariusCervicornus?], 1523. The Latin editions were: (1) Gerhard Westerburg, DE PVRGATORIO ETANIMRVM STATV GERHARDI Vuesterburgij Coloniensis sententia ex sacris litteris Collecta,Kln: [Konrad Caesar?] 1523; (2) Gerhard Westerburg, DE PVRGATORIO ET ANIMRVMSTATV DOCTORIS Gerhardi Vuesterburgij Coloniensis sententia ex sacris litteris Collecta,Kln: [Konrad Caesar?], 1523; and (3) Gerhard Westerburg, DE PVRGATORIO ET ANImarumstatu doctoris Gerhardi Vuestenburgij Coloniensis sententia ex sacris litteris collecta ANNO.1524, Kln: [Konrad Caesar?], 1524. See: Woodbridge, Gerhard Westerburg, p. 105. See alsoZorzin, Karlstadt als Flugschriftenautor, pp. 97100 and 273308, nn. 52a and 52b. 322Da hat got selbst seynen willen durch seyn wort und verkundiget und ausgesprochen/und alles das der bibel entgegen ist/ oder nit maessig und gleichformig/ das ist auch nit got-tis wort/ da got in seyne wort ist nicht wider sych selber/ Darumb lebt die sele auch nichtvon anderen leren/ sunder alleyn von dem warhafftigen wort gottis. Und wa das nicht denschaeffen wyrt vorgehalten und verkundiget da seyndt auch keyn rechte hirten oder predi-ger/ sunder eytel hungerige verfuerische reyffende woelffe (Westerburg, Uom fegfewer vnndstandt verscheyden selen, sig. A2v). Cf. Woodbridge, Gerhard Westerburg, pp. 12324. 323Westerburg, Uom fegfewer vnnd standt verscheyden selen, sig. A3r. 324Westerburg referred to Jer. 5:13; 20:9; and 23:29 (Westerburg, Uom fegfewer vnndstandt verscheyden selen, sig. B3r). post-mortem existence in the early reformation period 185
This should be taken not as a natural fire (naturlich fewer), but as a spiri-tual one (das da geystlich ist), he argued, as is clear from the parable ofLazarus and the Rich Man.325 The fire Paul mentions in 1Cor. 3:13 shouldbe understood as a simile and not as a reference to physical fire. Accord-ing to Westerburg, Is. 40:68 also speaks about how Gods word burns theheart of the human person, and cleanses the soul and mortifies the fleshupon entering the human person.326 Gods word purifies the human beingfrom the selfish love that hinders the human person from seeing God.327This process of spiritual purification starts on earth, continues in Purga-tory, and ends in the resurrection: on earth the human person recognizesGod in the darkness and is overwhelmed by the Lord and his teachings;in Purgatory the souls recognize that God is as the sun in the sunrise; andfinally, in the resurrection God will be immediately recognized, just asthe sun in the full light of day.328 In view of this, Westerburg, similarly toGansfort, held that Purgatory is not a fearful place of punishment, but arather pleasant and desirable state for the souls. Westerburg also followedGansfort in allowing for a post-mortem possibility of salvation. The purposeof Christs descent into Hell was the preaching of the Gospel to the dead,because God does not condemn anyone to whom the Good News has notbeen made known.329 Nonetheless, there will be souls who will refuse to
325Auch die schrift nicht anzeigt ein naturlich fewer in dem scho Abrahe (Wester-burg, Uom fegfewer vnnd standt verscheyden selen, sig. B3r). 326Dar zu geho rt auch das Esaias spricht. Das alles fleysch ist gleich als hew/ undseyn glorien gleich als die blumen uff dem acker/ das hew ist verdoeret/ und die blume istabgefallen/ wan der geyst des herren hat darynne gewehet/ das volck ist wahrhafftig hew/es ist verdoeret/ und sein blume ist abgefallen/ wan das wort des herren hat gewirckt jmvolck. Esaie am. xl. cap. Als solt er sagen/ das wort des herren das da ewiglich bleybt das isteyn fewer/ welches in das hertz geht (Westerburg, Uom fegfewer vnnd standt verscheydenselen, sig. B3v). Woodbridge rightly remarks that the idea of fire is absent from the passagein Isaiah and that Westerburg not only stretched the meaning of the original passage butmisquoted the last verse (Woodbridge, Gerhard Westerburg, p. 126). 327Westerburg, Uom fegfewer vnnd standt verscheyden selen, sig. B4rv. 328Zum ersten erkennen wyr hie got in der vinsternis und verwunderen uns vomherren und von seynen reden. Jm anderen erkennen wir gott gleich als die sonne in dermorgenroet. Jm dritten sehen wyr got gleich wie die sonne ym klaren mittag (Westerburg,Uom fegfewer vnnd standt verscheyden selen, sig. B2r). Woodbridge assumes that Wester-burg inherited Karlstadts mysticism. (Woodbridge, Gerhard Westerburg, pp. 12728). OnKarlstadts mysticism, see supra in n. 313. As has been quoted, Gansfort applied similarimagery, see supra on p. 179. 329Ergo neminem iudicat cui non est predicatum euangelium. [...] Nunc aut Christusneminem iudicat nisi euangelizatum (Westerburg, De purgatorio et animarum statu, sig.A4r). For Gansforts similar position, see supra on p. 132.186 chapter three
believe, and these will be damned.330 But Westerburg went further thanthe Frisian theologian and claimed that the dead souls have fallen asleepin Christ, and any attempt to liberate them disturbs them. Consequently,it is not only worthless to celebrate masses and to offer sacrifices for thedead (which only distress the people), but it is also destructive.331 Wester-burg acknowledged that praying for the dead was an ancient custom butindicated that no prayer, not even one according to Gods will, could helpthe souls in the process of this spiritual purification.332 He also reflectedon the financial aspect of the practice of selling indulgences. He regardedthe payment for intercessory prayers, masses, and indulgences as contraryto the idea of solidarity with the poor. According to him, the money spenton these prayers would be much better spent if it were shared with theliving poor according to Christs teaching.333 Arguing in this manner, headvocated precisely the original purpose of indulgences.334 The thirteen editions of Karlstadts and Westerburgs comparable workson Purgatory published in only two years (twelve in 1523 and one in 1524)
330Predicabat ergo ut doceret & credulos dignos eterna uita, incredulos autem dignosaeterno supplicio iudicaret (Westerburg, De purgatorio et animarum statu, sig. A4r). 331Ex quo etiam constat frivolam opinionem pontificis missas, sacrificia pro defunctisinstituentis, ut nos nomine defunctorum tristes faceret, quoniam si dormierunt animae inChristo optabilis est earum pars, desiderabilis dormitio [...] Pestilens est liberatio quaehuiusmodi spem perturbat (Westerburg, De purgatorio et animarum statu, sigs. A1vA2r).Woodbridge pointed out that although Westerburg studied in Bologna at the same time(151517) Pietro Pomponazzi was teaching there, advocating the mortality of the soul(thnetopsychism, a form of psychopannychism), Westerburg made only six references tosoul sleep or souls being awakened from their sleep, compared to the twenty-four casesin Karlstadts sermon. Hence, he concludes that Westerburg did not advocate soul sleepbut understood that sleeping in Christ was a euphemism for death. Nonetheless, givenKarlstadts open endorsement of the idea of soul sleep and their consent on all otherissues, his Cologne colleagues and many modern scholars believed that Westerburg advo-cated psychopannychism. (Woodbridge, Gerhard Westerburg, pp. 13536.) To the con-trary: Balke, Calvijn en de doperse radikalen, p. 35. On Pomponazzi, see supra on p. 120. 332Darumb sollenn wyr nit betten das die selen eher in eyn besser wesen genomenwurden dan got wil. Auch so werden sye alleyn durch eyn fewer geleutert und gereynigetdas da geystlich und vorstentlich ist/ und nicht durch furbit (Westerburg, Uom fegfewervnnd standt verscheyden selen, sig. B1r). 333Von der unkost/ wer besser (meynes beduckens) dz man slch gelt/ so fur dietoden unbarmhertzlich und geweltlich von den armen gedrungen und abgeschetzet/ sunstunnutzlich augeben wyrt/ den lebendigen armen nodturftigen/ das ist/ unseren bruderennach Christus leer/ mitteilte/ und lye sye keynen mangel lyden/ da wurdt es anzweyfellwol unnd nutzlich augegeben seyn/ und dy sey dem gemeynen man gesagt (West-erburg, Uom fegfewer vnnd standt verscheyden selen, sig. C3r. Cf. Woodbridge, GerhardWesterburg, p. 120). 334See supra on p. 112. In England, to encourage poor folk to come and pray, handingout alms was part of the funeral service and the Mass for the Dead. See: Duffy, The Strip-ping of the Altars, pp. 221, 35457, 365. post-mortem existence in the early reformation period 187
335On the effects and reception of the pamphlets of Karlstadt and Westerburg, see:Stefan Oehming, Karlstadts Auffassung vom Fegefeuer. Entstehung und Wirkung, in Sig- rid Looss & Markus Matthias (eds.), Andreas Bodenstein von Karlstadt (14861541). EinTheologe der frhen Reformation, (Themata Leucoreana 4), Wittenberg: Hans Lufft, 1998,pp. 73120; Zorzin, Karlstadt als Flugschriftenautor, pp. 97100 and 23440; Sigrid Looss,Die Wirksamkeit von Flugschriften des Andreas Bodenstein aus Karlstadt, in Ulman Weiss(ed.), Flugschriften der Reformationszeit. Colloquium im Erfurter Augustinerkloster 1999,Tbingen: Bibliotheca Academica, 2001, pp. 12537, esp. pp. 12930. 336Darneben ist meiner latinischer bu cher bei die drey tausent gedruckt vnd ist dasniderlant full (Westerburg, Wie die hochgelerten von Clln Doctores in der Gottheit vndKetzermeister/ den Doctor Gerhart Westerburg des Fegfewrs halben/ als einen vnglaubigen verurtheilt/ vnd verdampt haben. Wie Doctor Johann Cocleus von Wendelstein wider D. Wester- burgs buch/ vom Fegfewr geschrieben, Marpurg im Paradi: Frantzen Rhodi, 1533, sig. G3v). 337Oehming, Karlstadts Auffassung vom Fegefeuer, p. 90. 338Looss, Die Wirksamkeit von Flugschriften des Andreas Bodenstein aus Karlstadt,p. 130. 339On Joannes Cochelaeus, see: Juhsz, Cat. 93 in TT, pp. 14951; Monique Samuel-Scheyder, Johannes Cochlaeus. Humaniste et adversaire de Luther, Nancy: Presses Universi-taires de Nancy, 1993; Remigius Bumer, Johannes Cochlaeus 14791552. Leben und Werk imDienst der katholischen Reform, (Katholisches Leben und Kirchenreform im Zeitalter derGlaubensspaltung. Vereinsschriften der Gesellschaft zur Herausgabe des Corpus Catholi-corum 40), Mnster: Aschendorff, 1980.188 chapter three
was sufficient for all sins. But intercessions and masses for the dead per-formed by the priests and the monks imply that Christs salvific death wasnot sufficient for all sins.340 Hence, masses and prayers for the dead couldnot possibly remit sins or give satisfaction for them. Westerburg stressedthe Protestant principle of sola fide: salvation can only be reached throughfaith. He defined faith as believing that Christ is the Redeemer and Sav-iour; that His suffering was sufficient for all sins; that He gave satisfactionfor them on the cross; and that He redeemed us from eternal death.341
Philipp Melanchthon
340Es ist nit gnug das Christus gestorben sey/ vor die Christglaubige selen/ sondersie haben noch etliche passen mit seelmessen/ vigilien/ commendatien/ iarmessen/ etc.ablo ssen vnd bezalen/ Was ist das anders gesagt/ dan das Christus nit gnugsam gewesen/die sunde aller glaubigen selen zu bezalen/ sonder beho fft noch zu seinem tode vnndleiden/ der passen vnd munchen hilff. mit jren seelmessen etc. (Westerburg, Wie die hoch-gelerten von Clln Doctores, sig. O2r). 341Dann das ist der recht glaub/ der vns selig macht/ das wir glauben das Christusunser erlo ser und Heilandt/ durch sein leiden fur alle vnsere sunden gnug gethan/ vnd amstam des heligen creutz bezalet/ und uns vom ewigen todt erloeset hat (Westerburg, Wiedie hochgelerten von Clln Doctores, sig. O2v). Woodbridge pointed out how this argumentstood in contradiction to Westerburgs concept of Purgatory. See: Woodbridge, GerhardWesterburg, p. 141. According to Calvin A. Pater, in 1545 (that is, after the debate betweenTyndale and Joye), Westerburg was to revoke his earlier statements on Purgatory, butPater gives no references. See: Pater, Westerburg. The Father of Anabaptism, p. 149, n. 37.For his later works touching upon the subject, see: Woodbridge, Gerhard Westerburg,pp. 14143. 342Philipp Schwarzerd (or Schwarzert or Schwarzerdt) was first tutored by the Hungar-ian Johannes Hungarus (or Unger) at the famous Dominican school at Pforzheim, wherehe learned Latin and Greek and was introduced to the writings of Aristotle and of theauthors of Antiquity. Philipps maternal grand-uncle was the Catholic Hebraist JohannesReuchlin (14551522), under whose influence the young Philipp took on the Humanistname Melanchthon. The humanistic figure of his uncle remained a source of inspirationfor Melanchthon and influenced his entire life, even though Melanchthons participationin the Reformation later caused a break between them. At the age of fifteen he took hisBA in Heidelberg (1511) and enrolled the following year at the University of Tbingen. Aftergaining his masters degree in philosophy (1516), he became an instructor of younger schol-ars. In 1518 he published his Greek grammar (which became a standard schoolbook untilthe 18th century) and obtained the newly created chair of Greek at the recently foundedUniversity of Wittenberg (1502) on Reuchlins recommendation. There he obtained hisbachelors degree in biblical studies and became a professor at the Faculty of Theology. Hisideal was to remain a Humanist scholar, and he continued to work on the classics, alongwith his exegetical studies, until the end of his life. On his life and theology, see: Adolfvon Harnack, Philipp Melanchthon, Berlin: Buxenstein, 1897; Peter Fraenkel, Testimonia post-mortem existence in the early reformation period 189
His encounter and friendship with Luther, whom he later often called hisspiritual father, affected his life deeply. Yet the influence was mutual:while Melanchthon attended Luthers lectures at the university, it wasMelanchthon who helped Luther learn Greek and who revised Lutherstranslations of the NT and of the LXX, despite Luthers initial opposi-tion to Melanchthon.343 Later Melanchthon accompanied Luther to theLeipzig Disputation (1519).344 He drew up a report of the disputationin cooperation with Johannes Oecolampadius (14821531) that elicitedEcks criticism.345 In his reply Melanchthon set forth Luthers oppositionbetween the authority of the Scripture versus that of the Fathers.346 In1521 Melanchthon set down the first systematic summary of Protestantdoctrine, the Loci communes rerum theologicarum.347 In subsequent yearshe kept revising the work, and the book went through more than a hun-dred editions during his lifetime. He also published several commentar-ies and treatises on various topics. His writings became very influentialin the course of the development of Protestant dogmatic thought. It was
Patrum. The Function of the Patristic Argument in the Theology of Philip Melanchthon,(THR 46), Geneva: Droz, 1961; Eginhard P. Meijering, Melanchthon and Patristic Thought.The Doctrines of Christ and Grace, the Trinity and the Creation, (Studies in the History ofChristian Thought 32), Leiden: Brill, 1983; Reinhold Friedrich & Klaus A. Vogel, 500 JahrePhilipp Melanchthon (14971560), (Pirckheimer-Jahrbuch 13), Wiesbaden: Harrassowitz,1998; H.J. Selderhuis, Melanchthon. Zijn betekenis voor het protestantisme. Melanchthonen de Nederlanden in de 16e en 17e eeuw, (Apeldoornse Studies 41), Apeldoorn: Theologis-che Universiteit, 2000; John Schofield, Philip Melanchthon and the English Reformation,(StAndrews), Aldershot: Ashgate, 2006. 343Luther had opposed Melanchthons candidacy for the chair of Greek at the Univer-sity of Wittenberg. 344See supra on p. 166. 345Philipp Melanchthon, Philippi Melanchthonis Epistola de theologica disputationeLipsica.: Excusatio Eckij ad eandem, Basel: Johannes Froben, 1519. Oecolampadius mar-riage prompted Erasmus to remark in a letter to Adrian a Rivulo (Adriaan Beek), a formerLeuven student, that it was inappropriate to talk about the Reformation as the Lutherantragedy, for it was not so much a tragedy as a comedy because it always ended in awedding: Nuper Oecolampadius duxit vxorem, puellam non inelegantem. Vult, opinor,affligere carnem. Quidam appellant Lutheranam tragdiam, mihi videtur esse comdia.Semper enim in nuptias exeunt tumultus (Allen, VII, n. 1979 on p. 369). On Oecolampadius,see: Ernst Staehelin, Oekolampad-Bibliographie, Nieuwkoop: De Graaf, 1963; John Dyck,Johannes colampadius: Lighthouse of the Reformation, in Western Reformed SeminaryJournal 3 (1996), pp. 2529. 346Philipp Melanchthon, Defensio Philippi Melanchthonis contra Iohannem Ekivm Theo-logiae Professorem, Wittenberg: Johann Rhau-Grunenberg, 1519. See: Meijering, Melanch-thon and Patristic Thought. 347Philipp Melanchthon, Loci communes rerum theologicarum seu hypotyposes theologi-cae, Wittenberg: M. Lotther, 1521, reprinted in Basel: Adam (Heinrich) Petri, 1521 (muchreprinted in subsequent years, also with emendations by Melanchthon).190 chapter three
353Caeterum bene refutati sunt Sadducaei, ipsa resuscitatione Christi, et aliorum mul-torum, qui resuscitati sunt et conspecti a multis (Melanchthon, In Evangelium Matthaeiannotationes, col. 961). 354Melanchthon, In Evangelium Matthaei annotationes, col. 1026. 355Melanchthon, In Evangelium Matthaei annotationes, col. 1026. 356Philipp Melanchthon, Loci communes theologici recens collecti & recognati a PhilippoMelanthone, Wittenberg, Iosephum Clug, 1535. (Republished in Strasbourg in 1536 by IohanAlbert). Published in Melanchthon, Philippi Melanthonis Opera quae supersunt, omnia, (CRXXIV), ed. Carolus Gottlieb Bretschneider, Brunswick: Schwetschke, 1854, cols. 230561. 357Melanchthon, Loci communes theologici (1535), col. 524.192 chapter three
This article is one of the foremost precepts of the Gospel and is clearlystated and often emphasized in the NT. According to Melanchthon, it isChrists own words that most evidently speak about this article of faithin the passages where Jesus promises eternal punishment for the wickedand eternal bliss for the just (Mt. 25:46; and Jn. 5:25 and 6:40). In 1Cor. 15Paul, too, keenly affirms this article, Melanchthon added. SubsequentlyMelanchthon cites Is. 26:1921 as proof text from the OT for the doubleexpectation of eternal life and resurrection of the body. In Melanchthonsview, Isaiah unmistakably speaks in this passage about the revivificationof the dead, the joy of the saints, the punishment of the wicked, and thepresent afflictions of the Church. But what is eternal life, Melanchthonasks himself? And the answer he finds is that for the faithful it is eter-nal bliss (perpetua ltitia), perfect knowledge of God, and perfect justicewithout sin or death.358 Melanchthons views on the afterlife prior to the TyndaleJoye con-troversy are only partially made explicit.359 Up until 1535, the Loci com-munes did not cover the issue. Whether this means that for some reasonMelanchthon felt no particular need to pronounce a clear standpoint on
358In his next, still further amended edition of the Loci theologici (1543), Melanchthonelaborated upon the theme of the afterlife (Melanchthon, Loci theologici recens recogniti.Avtore Philip. Melanthone, Wittenberg, Petrus Seitz, 1543 (Republished several times inWittenberg, Basel, and Leipzig). Published in Melanchthon, Philippi Melanthonis Opera quaesupersunt, omnia, (CR XXIV), ed. Carolus Gottlieb Bretschneider, Brunswick: Schwetschke,1854, cols. 5611106). In that edition, too, Melanchthon treats eternal life (this time moreclearly including the immortality of the soul) and the resurrection of the flesh under thecommon title De resurrectione mortuorum. Melanchthon adds several other OT proofsfor the double expectation of eternal life and the resurrection of the body (e.g. Is. 66:2224,65:1720, and 24:21; Ps. 15:9; Job 19:25; etc.). Melanchthon also claims that the accounts ofthe translations of Enoch and Elijah being alive to God prove the existence of eternal life:Enoch et Elias vivi transtuli sunt ad Deum, ut textus de Enoch clare dicit. Haec facta certe suntmanifesta testimonia vitae aeternae. In this version of the Loci, immortality of the soul andeternal life seem to be mutually interchangeable (cols. 92529). 359In 1540, Melanchthon published his Commentarius de anima (Viteberg, Iohan-nis Lufft, later revised as Liber de anima (1553)), an innovative commentary on Aristotlesphilosophical work about the soul, which can only be fully understood in light of Lutherantheology. In this, Melanchthon claimed that any commentary on Aristotles work shouldbe about the Christian rather than about the human soul, and that there was no inherentspirit equivalent to the rational soul in the human person with whose help the humanperson could gain salvation, but rather that the human person as a whole, both body andsoul, became subject to either salvation or damnation. See: Sachiko Kusukawa, Melanch-thons Science Textbooks, in Paradigm. Newsletter of the Colloquium on Textbooks, Schoolsand Society 1,5 (1991); Sachiko Kusukawa, The Transformation of Natural Philosophy. TheCase of Philip Melanchthon, (Ideas in Context 34), Cambridge: UP, 1995, esp. pp. 7489;Sascha Salatowsky, De Anima. Die Rezeption der aristotelischen Psychologie im 16. und 17.Jahrhundert, (Bochumer Studien zur Philosophie 43), Amsterdam: B.R. Grner, 2006. post-mortem existence in the early reformation period 193
Huldrych Zwingli
360See infra on p. 277. On Zwinglis theology about a post-mortem existence, see: ErichVogelsang, Weltbilt und Kreuzestheologie in den Hllenfahrtsstreitigkeiten der Reformation-szeit, in ARg 38 (1941), pp. 90132; Samuel Macauley Jackson, chapter 3. Zwingli and Zrich.Theology and Theocracy, 15181531, in Selected Works of Huldrich Zwingli, (14841531) TheReformer of German Switzerland, translated for the First Time from the Originals, ed. SamuelMacauley Jackson, Philadelphia: UP Pennsylvania, 1901; Iren L. Snavely, Jr., Zwingli, Fro-schauer, and the Word of God in Print, in Journal of Religious and Theological Information3 (2000), pp. 6587; Walter Ernst Meyer, Huldrych Zwinglis Eschatologie. ReformatorischeWende, Theologie und Geschichtsbild des Zrcher Reformators im Lichte seines eschatologis-chen Ansatzes, Zrich: Theologischer, 1987; W. Peter Stephens, The Theology of HuldrychZwingli, Oxford: Clarendon, 1986, pp. 15463; George Richard Potter, Zwingli, Cambridge:UP, 1976; Vogelsang, Weltbilt und Kreuzestheologie in den Hllenfahrtsstreitigkeiten derReformationszeit, pp. 90132. 361Huldrych Zwingli, Vom dem Touff. Vom widertouff. Vnnd vom kindertouff durchHuldrych Zuingli, Zrich: Johannsen Hager, 27 May 1525; Huldrych Zwingli, Vber DoctorBalthazars Touffbchlin/ waarhaffte/ grndte antwurt, Zrich: Christopher Froschouer,5 November 1525. 362Harold Bender, Walking in the Resurrection, in The Mennonite Quarterly Review 35(1961), pp. 1125.194 chapter three
being dark.367 Experience shows us that it is merely the body that sleeps,for upon awakening one remembers ones dreams.368 It is much less pos-sible for the soul to sleep when it is liberated from the body by death.It is therefore only the body that can fall asleep at death and remain sountil the Day of Judgement.369 Furthermore, Zwingli argued, Anabaptistsare ignorant of the fact that the Hebrews used the word resurrectio notalways for the resurrection of the flesh, but also for the interim state, thecontinuation and existence of the soul after it has been freed from thebody, in which state it can neither sleep nor die.370 To substantiate his point, Zwingli cited examples from the Scriptures.Joshua 7:1213 twice uses the Hebrew verb , translated in the Vul-gate with a form of the verb surgere. In both instances the word meansto stand fast, resist, or endure.371 Jesus response to the Sadducees inMt. 22:31 proves that Abraham, Isaac, and Jacob are alive despite theiractual physical deaths. Christs answer confirmed what the Sadduceesdenied, namely, resurrectio, which means to be alive, and not the resur-rection of the flesh.372 In Heb. 11:35, too, resurrectio is taken to mean thelife of the soul severed from the body; the martyrs had such a firm faiththat the resurrectiothat is, the life after this onewill be a better life,
367Unde tam abest, ut dormire possit, quantum a luce aut sole abest, ut obscurumcorpus sit. Quocunque solem abigas, splendet ac incendit, id quod Phaton expertus est;sic anima, quocunque detrudas, animat, movet ac impellit, adeo ut corpore devincta dumimpsum, qu eius est inertia, dormit, ipsa tamen non dormiat (HZSW VI,1, p. 189). 368Meminimus enim eorum, qu in somno vidimus. Quanto magis corpore liberatadormire nequit, cum sit substantia ad perpetuam operationem, qu defatigari non potest,concinnata (HZSW VI,1, pp. 18990). 369Dormit ergo corpus, anima nunquam; sed cum corpore liberatur, iam corpusnoctem ternam dormit (HZSW VI,1, p. 190). 370Postremo ignorant catabaptist resurrectionem mortuorum Hebris non semperaccipi pro carnis ista suprema resurrectione, quam olim videbimus, sed interim pro hac,interim vero pro constantia aut perduratione anim, qua corpore soluta in vita constat acdurat non somno aut morte depressa, neque enim potest deprimi (HZSW VI,1, p. 190). 371Iehosue 7. sic loquitur dominus: Non potuerunt filii Isral surgere coram hostibussuis, et paulo post: Non poteris surgere ante hostes tuos. Hic utrobique ponitur surgerepro: consistere ac perdurare; nam et Hieronymus stare transtulit (HZSW VI,1, p. 190). Inthe autograph, Zwingli inserted the Hebrew consonantal form and the vocalized form before and after the verb surgere (the critical edition erroneously transcribed them as and , respectively). He also introduced the Latin consistere at the same place. 372Mat. 22. sic loquitur Christus: De resurrectione mortuorum non legistis quod dic-tum est a deo dicente vobis: Ego sum deus Abraham et deus Isaac et deus Iacob? Nonest deus mortuorum, sed viventium. Qua responsione nihil aliud docet quam vivos esseAbraham, Isaac et Iacob, etiamsi essent mortui, quos Saduci aut prorsus negabant resurg-ere, hoc est vivere, at saltem catabaptistarum more adserebant dormire. Non enim quadratresponsio Christi ad resurrectionem carnis, sed ad hoc, quod Abraham, Isaac et Iacob,etiamsi mortui essemt, viverent (HZSW VI,1, p. 190).196 chapter three
that they refused to be saved for this life and embraced the life that fol-lows after this one.373 Similarly, Jesus promise to the believers in Jn. 6:40should be understood as a promise to keep those who trust in Him aliveeven beyond their death.374 In 1 Cor. 15, Zwingli claimed, the whole discourse on the resurrection ofthe flesh is clearly linked to and depends on the immortality of the soul. ForPaul speaks about resurrectio in general terms, and from the beginning ofthe chapter until verse 35 the word is used not (exclusively) for the resur-rection of the flesh, but (also) for the continuance or persistence of lifeafter this life.375 It is only from there on that Paul speaks about the bodilyresurrection, Zwingli maintained. To prove this, Zwingli used five argu-ments. (1) First he pointed to vv. 2122 (as death came through a humanbeing, the resurrectio from the dead also comes from a human being,for as in Adam all die, so in Christ all are made alive). It is clear, Zwingliargued, that here resurrectio pertains not only to the resurrection of theflesh, but also to that life which immediately follows after this presentone: through Adam we all die, but through Christ we are preserved in life.376That is why Christ promised that even though those who believe in Himdie, they will live (Jn. 11:25).377 (2) The second argument came from the (inZwinglis view) despicable custom of baptism for the dead (1 Cor. 15:29).He contended that this practice proves and presupposes the survival and
373Hebr. 11. sic loquitur Paulus: Alii vero distenti aut crucifixi sunt nullam recipentesredemptionem, ut meliorem invenirent resurrectionem. Ecce, ut hic resurrectio pro vitaanim, quam soluta corpore habitura est, accipitur. Ad hunc sensum: sic vitam istam, quhanc sequitur, amplexi sunt, ut prsentem nollent, etiam cum offeretur, recipere, tamconstans enim erat fides, ut certi essent eam, qu sequeretur, meliorem esse (HZSW VI,1,p. 190). 374Unde et Christi verbum, quod Io. 6. habetur: Ego resuscitabo eum in novissimodie non debet in alium sensum detorqueri quam: ego, dum is moritur, qui me fidit, invita servabo. Ut vel insinuet: nunquam intermorituros, qui se fidant, vel nunquam noniucundissime pervicturos. Novissimus autem dies isthic non tam est ultimus ille omniumrerum prsentis mundi quam postremus cuiusquam dum ex hoc mundo demigrat. Idquod Io. 5[,24]. facile deprehenditur: In iudicium non venit, sed transiit a morte in vitam(HZSW VI,1, pp. 19091). 375In 1. Cor 15. de resurrectione loquens apostolus hanc, qu pro perduratione et con-sistentia in vita capitur, tanquam superiorem facit, de qua in genere loquitut, donec adhunc locum veniat: Quomodo resurgunt mortui aut quali corpore incedent? Ibi tandem,qu aliquando ventura est, carnis resurrectionis disputationem ingreditur (HZSW VI,1,p. 191). 376Vides, ut istud: Ex homine mors et ex homine resurrectione mortuorum; nam sicutin Adam omnes moriuntur, sic et in Christo omnes vit restituuntur non solum ad carnisresurrectionem pertinet, sed ad istam vitam, qu hanc protinus sequitur. Per Adam enimmoriuntur, sed per Christum in vita servamur (HZSW VI,1, p. 191). 377HZSW VI,1, p. 191. post-mortem existence in the early reformation period 197
active character of the soul beyond death.378 (3) Zwinglis third argumentis Pauls logic in vv. 3031, which is, according to the Swiss theologian, thateternal life must follow immediately upon death; Paul would be a fool toexpose himself to danger every day if there was no life after this one, orif a sleep followed upon death.379 (4) The fourth argument is providedby vv. 3233. There, Paul disapprovingly quotes the Corinthians: let useat and drink; for tomorrow we die, and then he adds: evil communica-tions corrupt good manners. But it is precisely the Anabaptists advocacyof soul sleep and their blasphemous tenet that even Satan would eventu-ally be saved, Zwingli maintained, that undermine society and encouragecrime, because such beliefs remove the fear of any post-mortem penaltyfor the evil committed in this life.380 (5) The final argument is deducedfrom v. 34, where Paul calls upon the Corinthians to wake up and cometo their senses from their folly: . Paul used the verb towake up with great pungency, for the Anabaptists, pressed in their sleepof ignorance, presume that the souls sleep, just as the wolf thinks that allanimals eat raw food since it does so itself.381 And when these would-be
378HZSW VI,1, pp. 19192. The custom also serves as an argument for infant baptismfor Zwingli. 379Tertio istud considera, quod iungit: et nos cuius causa in horam periclitamur?,quottidie morior etc.; huc enim et istud pertinet. Vult enim Paulus, si aut nulla vita istamsequitur aut somnus plus quam Epimenideus, stultus essem quottidie discrimen omnesubiens. Sed longe aliter habet res; hanc vitam terna e vestigio sequitur, nam alioquihuiusmodi periculis me haud temere exponerem (HZSW VI,1, p. 192). Zwingli refers to thephilosopher-poet Epimenides of Knossos (6th century BC). Reportedly, he fell asleep forfifty-seven years in a cave. When he woke up, he possessed the gift of prophecy. His poemCretica () is quoted twice in the NT (Titus 1:12 and Acts 17:28). See: Felix Jacoby,Die Fragmente der griechischen Historiker, vol. 3B, Leiden: Brill, 457 F 1820; J.L. De Belder,Epimenides ontwaken en andere gedichten, Brussels: Manteau, 1943; Hermann Diels,ber Epimenides von Kreta, (Sitzungsberichte der Kniglich preussischen Akademie derWissenschaften 21), s.l.: n.n., 1891; T. Nicklin, Epimenides Minos, in The Classical Review 30(1916), pp. 3337; Eric Robertson Dodds, The Greek and the Irrational, Berkeley, Los Ange-les & London: UP California & UP Cambridge, 1951, pp. 14146; Gabriel Herman, Nikias,Epimenides, and the Question of Omissions in Thucydides, in Classical Quarterly 39 (1989),pp. 8393. 380Quarto, quod ait: Edamus etc. et corrumpunt mores sanctos commercia pravaetiam huc pertinet. Nihil enim que mores corrumpit atque docere animos intermori,aut, ut nunc catabaptist blasphemant, dormire usque ad posrtremum diem ac deindeadserunt et dmonem et omnes salvari. Qu igitur poena perfidos ac sceleratos manet?Qu corruptio non tam large seuqeretur, si isti solummodo negarent carnem revicturam(HZSW VI,1, p. 192). On the idea of universal salvation, see infra on p. 198. 381Quinto ista quoque consideres: , hoc est: evigilate recte. Resipiuntenim hc verba Paulinam acrimoniam. Cum enim isti somno ignoranti pressi putarent,quod lupus, qui omnia credit animalia crudis vesci, eo quod ipse vescitur, animas dormireevigilate ait (HZSW VI,1, p. 192).198 chapter three
382Cum autem propter acumen sibi doctuli viderentur ac ideo minime dormire,recte ait: evigilate; putatis enim vos vigilare et rem acu tetigisse, qum somniculose desomne somnietis (HZSW VI,1, p. 192). Zwinglis description of his adversaries is not par-ticularly charming. He calls the arguments advanced by the Anabaptists foolish, impiousand absurd and lacking in any substantial backing from Scripture, and he seeks to refutethem with the help of God. Stulta igitur, impia et absurda, qu docent, adsignatis paucisscriptur locis (sed talibus, ut eis tota catabaptistarum caterva non possit resistere) convel-lemus (HZSW VI,1, p. 188). Cf. Stultus stulta loquitur (HZSW VI,1, p. 194). TheAnabaptists are oppressed not so much by sleep as by wickedness, and they teach what-ever occurs to them. Et videbis catabaptistas non tam somno quam nequicia depressostradere, quicquid inciderit (HZSW VI,1, p. 193). 383Post hc sequentia quoque expende, lector, et ubi videris in genere primum loquiapostolum de anim post hanc vitam vita, ac deinde ad carnis resurrectionem descendere,huc redi (HZSW VI,1, pp. 19192). 384Tam dmonem quam impios omnes beari (HZSW VI,1, p. 193). Zwingli attackedhere Johannes Denk (c.150027). See: Johannes Lindeboom, Stiefkinderen van het Chris-tendom, The Hague: s Gravenhage, 1929, pp. 193201. Stanislaus von Dunin Borkowski,Quellenstudien zur Vorgeschichte der Unitarier des 16. Jahrhunderts, in 75 Jahre Stella Matu-tina, vol. I., 1931, pp. 94101; Christian Neff & Walter Fellmann, art. Denck, Hans, inCornelius J. Dyck & Dennis D. Martin (eds.), Mennonite Encyclopedia. A ComprehensiveReference Work on the Anabaptist-Mennonite Mouvement, vol. 2, Scottdale: Mennonite Pub-lishing House, 1959, pp. 3235; HZSW VI,1, p. 193, n. 1. On the idea of universal salvationproposed by Origen, see: supra on p. 90. 385Dum morimur, dormiemus usque ad ultimum diem. Isto deinde iudicio absolve-mur. Sublati sunt igitur inferi? Gehena? Ignis inextinguibilis? Flamma, qu zizannia inmanipulos colligata lambet? (HZSW VI,1, p. 193). post-mortem existence in the early reformation period 199
judgement, and there will be no age but sheer eternity, because then alltime will cease.386 In catabaptistarum strophas Elenchus was not the first work in whichZwingli advocated such an interpretation of the word resurrection. Ques-tions on a post-mortem existence had been the subject matter of an ear-lier letter by Zwingli to the Bern reformer Berchtold Haller (14911536).387This letter was dated at Zrich on 6 November 1526. Hallers original letter,to which Zwingli responded, is no longer extant, but it concerned the res-urrection of the flesh, as is clear from Zwinglis answer. Apparently Hallerasked for the clarification of two biblical texts. As will be seen, Zwinglisletter already contains some of the arguments he was going to use in hisbattle against the Anabaptists. The first text Zwingli elucidated was 1 Cor. 15. He began by quotingv. 29: what will those people do who receive baptism on behalf of thedead? If the dead are not raised at all, why are people baptized on theirbehalf? The word resurrectio, Zwingli explained to Haller, is occasionallytaken to mean the general judgement of all mortals at the throne of Christ(pro publica mortalium omnium coram throno Christi comparitione), asdescribed in Mt. 25:3146, yet other times resurrectio refers to the immor-tality of the soul (pro immortalitate animae), as the Hebrew verb canmean to stand up or to survive.388 It is in the latter sense that the word isused in Joshua 7:12, where the Hebrew text reads and the LXX uses (consistere: to remain, or to exist), but the Vulgate translates itas stare (to stand).389 Accordingly, resurrectio means the life of the dead,or the endurance or persistence of souls.390 For further examples of thisHebraism, Zwingli refers Haller to Leo Juds notes taken in the Prophezei.391
386Nam si isthic ternum temporarium esset, quod fieri nullo pacto potest, tunc enimdesiit omne tempus, iam et beatorum salus esset temporaria; sed stultus stulta loquitur(HZSW VI,1, p. 194). 387Published in D.D. IOANNIS OECOLAMPADII ET HVLDRICHI ZVINGLIIEPISTOLAR[VM] LIBRI QUATUOR. PRAECIPVA CUM REGIONIS CHRISTO NObis tra-dit capita, tum Ecclesistice administrationis officia, nostro maxime seculo, tot haten[us]errorib[us] perturbato, convenientia, ad amussim exprimenetes, Basileae, 1536, fos. 1921.Critical edition: HZSW VIII, pp. 75963. 388Interim pro immortalitate animae; quae sic Hebraico more a surgendi verbo velconsistendi adpellatur (HZSW VIII, p. 759). 389Ut Iosuae 7.: Non poterunt filii Isral consistere ante hostes suos. Ubi Hebraeihabent , Graeci , hoc est, consistere; Latini vero, stare (HZSW VIII, p. 759). 390Sitque ut resurrectio mortuorum perinde valeat atque mortuorum vita, quae alibiagitur, vel animarum duratio aut preseverantia (HZSW VIII, pp. 75960). 391De Hebraismo alia quoque exempla invenies aliquando in iis adnotationibus, quasLeo ex ore nostro pr aliis probe excipit, tibique impartitur peculiari amico. Nolim enim200 chapter three
But Zwingli is ready to offer illustrations from the NT, where resurrectioshould be taken to mean the immortality of the soul. Such is the encoun-ter of Jesus with the Sadducees in Mt. 22. Christs answer in v. 32 provesonly that the souls of Abraham, Isaac, and Jacob are alive, i.e. that thesouls continue to exist after they leave the body, but it does not prove theresurrection of the flesh.392 There are people, Zwingli wrote, who believethat the souls are asleep until Judgement Day, a position that plainly con-tradicts the immortality of the soul.393 But their custom of sprinkling holywater on the graves (which Zwingli identified with baptism for the dead)proves the immortality of the soul, because who would be willing to bebaptized for the dead, if the soul ceases to exist when the body dies?394Zwingli did not deny that Pauls words in 1Cor. 15 can refer to the resur-rection at the general judgement, but he asserted that Paul used the wordindiscriminately, referring to both meanings of the word (apostolum deutraque resurrectione promiscue loqui), much as Christ spoke indiscrimi-nately in Mt. 24:451 about both His second coming and the age precedingit.395 According to the Swiss theologian, in 1Cor. 15, Paul speaks about
quibusvis earum copiam etiamnum fieri (HZSW VIII, p. 760). From 19 June 1525 onwards,Zwingli and his Reform-minded friends started a sort of Reformed University, a schoolaimed at training clerics in Reformed theology in Zrich. They studied the Scriptures inLatin, Greek, and Hebrew. Zwingli and others would read a Biblical text in the originallanguages, compare the versions, and comment on and interpret it. See: George R. Potter,Zwingli and the Book of Psalms, in SCJ 10 (1979), pp. 4250; M.H. Goshen-Gottstein, TheTextual Criticism of the Old Testament. Rise, Decline, Rebirth, in JBL 102 (1983), pp. 36599,esp. pp. 37071; Alfred Schindler (ed.), Fritz Busser, Die Prophezei. Humanismus und Refor-mation in Zurich, (Zrcher Beitrage zur Reformationsgeschichte 17), New York: Peter Lang,1994; Traudel Himmighfer, Die Zrcher Bibel bis zum Tode Zwinglis (1531), (Verffentli-chen des Instituts fr Europische Geschichte Mainz 154), Mainz: Philipp von Zabern, 1995.See also infra on p. 203. 392De re vero ipsa exemplum habes Christi, apud Matth. 22.: De resurrectione veromortuorum, non legistis, quod vobis a deo dictum est? Ubi manifestum est, Christumnon loqui de carnis resurrectione, sed de immortalitate animae. Nam exemplum, quodadducit de Abraham, Isaac et Iacob, non trahit ad carnis resurrectionem, sed ad animaeimmortalitatem, cum ait: Non est deus deus mortuorum, sed vivorum. Huc ergo penetratChristus, ut probet Abraham, Isaac, et Iacob vivere. Non enim posset hoc exemplum carnisresurrectionem probare; sed quod animae durent ac vivant, postquam corpore posuerunt(HZSW VIII, p. 760). 393Dicunt somno quodam animas sepeliri ac teneri usque ad ultimum iudicium. Quodquid aliud sit, quam animae immortalitatem negare, non video (HZSW VIII, p. 760). 394Probat igitur ex eorum ritu, animas esse immortales. Nam si minus, hoc permit-tant iam contradicere publicae consuetudini, qua quidam pro mortuis sese tingant. Qui simortuorum animas crederent simul cum corpore extinctas, non baptizetur pro eis (HZSWVIII, p. 760). 395Si vero nunc dicas, videri tibi Paulum eo loci de publica resurrectione loqui,respondeo, me non inficiari, propter omnium doctorum huius loci expositionem, apostolum post-mortem existence in the early reformation period 201
the spiritual body, or, perhaps more accurately, about the soul as the fac-ulty of the intellect and of the senses.396 For the correct interpretation ofthe term, he compared Pauls language here with that of Col. 2:9, whereit is said about Christ that the fullness of divinity dwells bodily in Him.This latter text, Zwingli believed, should not be understood as saying thatGod is a body, because body is taken here for essence: Christ was, byessence, God, similarly to the sense in which the German idiom er ist slyplich is used.397 In the same manner, when Paul says about the spiritualbody that it dies and rises (v. 44), he means that when the earthly bodydies, the spiritual bodyi.e. the very substance of the soullives.398 Butsince there are so many objections to such an interpretation, Zwingli cau-tioned against accepting any idea heedlessly, lest he appear to be a Man-ichaean, who denied the resurrection of the flesh. He claimed that even ifhe interpreted this place as referring to the immortality of the soul, thereare other passages where the resurrection of the flesh can be proven.399Since all ancient interpreters took that passage to mean the resurrectionof the flesh, it is safest to leave the question open, as Paul used the termindiscriminately, sometimes denoting the resurrection of the flesh andother times meaning the immortality of the soul.400 Zwingli mentioned,however, that there was one exception among the Church Fathers, viz.Ambrose, who seems to have equated resurrectio with the life after this
life in his commentary on 1Cor. 15:30, but Zwingli admits that this is onlyan incidental remark of Ambrose.401 The other biblical place Haller wished to have explained by Zwingliwas 1Pt. 4:46. This passage, the Swiss Reformer maintained, is not as dif-ficult as it seems at first sight. The meaning of the words in the epistle ofPeter can be summarized, according to Zwingli, in the following way: Thepeople are surprised, when you do not join them in the excesses of licen-tiousness, and they despise you because of your innocence and accuseyou falsely. But they will have to give account to Him, who is appointed tojudge the quick and the dead (1 Pt. 4:45).402 What follows these words,Zwingli explained, is the rhetorical device of adducing the proofs: for Christwill be the future judge of all mortals, both those who are alive and thosewho are dead.403 For the dead received the proclamation (which is thesense of the Greek term , Zwingli clarified) in order that theybe judged by ordinary law for all things that pertain to the flesh (by whichall human beings will be judged), so in spirit they might live through God(1 Pt. 4:6).404 Zwingli specified that Christs proclamation to the dead isthe preaching of the Gospel to the dead (Mortuis praedicatum est euange-lium), the announcement of their salvation (Christum animarum salutemadvenisse adnuntiari).405 This is attested to in 1Pt. 3:19, where it is saidthat Christ preached to the spirits in prison, and that through His pre-cious death the captives were redeemed, and Christ, the victor, led themupwards, as is professed in the Creed: he descended into Hell.406 Now,
401Veteris enim, quos ego vidi, quum in hunc locum veniunt, adparent paulo tepidiusrem gerere, praeter unum Ambrosium, qui videtur in ista esse sententia. Sic enim superhis Pauli verbis: Quid et nos periclitamur, ait: et subauditur: Nisi quia speramus futuramresurrectionem, sicut supra memorat. Securi enim, quia post istam mortem vera vitasequetur, pericula non timent etc. Expende autem, que dicimus, ad iustam bilancem; etvidebis, non ab re in hac esse sententia (HZSW VIII, pp. 76162). The quotation is fromAmbroisaster, the author of a commenatry on the Pauline epistles. The work used to beattributed to Ambrose: Ambroisaster, Commentarius in epistolam b. Pauli ad Corinthos pri-mam, XVI, 164 (PL 17, col. 266B). 402HZSW VIII, p. 762. 403Quod nunc sequitur, confirmatio est, ac veluti , quod Christus omniummortalium futurus sit iudex, tam vivorum quam mortuorum (HZSW VIII, p. 762). 404Ad hoc enim mortuis quoque adnuntiatus est (sic enim interpretanda est Graecavox ), ut iudicentur, quod ad carnem attinet, vulgari more, quo iudicabunturomnes homines, spiritu vero per deum vivant (HZSW VIII, p. 762). 405HZSW VIII, p. 762. 406Sic ergo mortuis adnuntiatus est, et his, qui in carcere erant, ut idem Petrus 1.cap. 3. testatur, cum mortis eius precio captivitas redempta est, quam victor secum duxitad superos. Et hoc est, quod in symbolo confitemur: Descendit ad inferos (HZSW VIII,p. 762). post-mortem existence in the early reformation period 203
one can wonder, Zwingli proposed, how they came forth from there,whether cloaked in the body or as a pure spiritual substance; but Peteranticipated the question and said that the flesh of those who were liber-ated by Christ the victor will be judged when all flesh will be judged, butin the meantime their spirits will live and rejoice through Christ in God.407Peter put it elegantly when he said that the quick and the dead will bejudged by Christ, who is said to have brought the remedy of the Gospelto the dead (ad mortuos quoque pervenisse euangelii medelam).408 Peterswords also mean, Zwingli believed, that their flesh is not yet resurrectedbut will be judged in the general judgement, from which the resurrectionof the flesh can be proved and established.409 The annotations by Leo Jud in the Prophezei about the Hebrew verb not always denoting the bodily resurrectionto which annotationsZwingli referred in his In catabaptistarum strophas Elenchuswere laterincorporated into Zwinglis exegetical works and Bible translations.410Commenting on Ex. 21:19, Zwingli remarked in 1527 that the use of theverb in this verse is a Hebraism, for it does not mean the bodily resur-rection, but that the injured party can stand up and walk again.411 Earlierin his commentary he had a seemingly comparable remark about anotherHebrew verb, namely, about the verb ( to stand, to take ones stand, toremain, to endure, etc.), which in his comment on Ex. 9:16 he paraphrasedas, among other things, keeping alive.412 His commentary on Isaiah two years later (1529) also contains ref-erences to this alleged Hebraistic use of the verb . The first such
407Iudicabitur quidem et eorum caro, qui Christo victore liberati sunt, tunc cumomnis caro iudicabitur; interea vero spiritus eorum in deo per Christum vivunt ac laetan-tur (HZSW VIII, pp. 76263). 408HZSW VII, p. 763. 409HZSW VIII, p. 763. 410See supra on p. 199. 411Et surrexit. [v.19] Iterum Ebraismus est. Latinus dicit: si convaluerit, Germanice: , hoc est: si convaluerit, ita ut ambulare possit, etiam si baculoinnitatur (HZSW XIII, p. 405). 412Idcirco autem posui te, ut ostendam in te fortitudinem meam Ebraice sic:verumtamen propter hoc feci te stare, hoc est: servavi te in vita, , statui te, feci te consistere, in tanta peste te servavi, ut ostendam tibi vir-tutem meam; vel ut alii dicunt: ut sis tu perpetuum exemplum potentiae meae, quam in teexercui; tu tamen induratus me non agnoveris. Sunt qui , heemadethicha, expo-nunt: induravi te malicia, ut mundo exemplum in te aedam. Hoc maxime consyderandumest tyrannis, qui vi sua et potentia omnia posse se iactant, ipsorumque esse tum bellum,tum victoriam existimant (HZSW XIII, p. 330). The seemingly comparable usage of the twoHebrew verbs will give rise to a misunderstanding by Joye. See infra on p. 402.204 chapter three
r eference is occasioned by Is. 13:6, which actually does not contain the verb in the Hebrew text but claims that the day of the Lord is near: ( quoniam prope est dies domini in Zwinglis translation). Here, Zwingli incorporated a long excursus on the meaning of the term dies domini. He argued that the expression can denote (1) the death of the individual, (2) the daily punishments God sends to His people, or (3) the general judgement at the end of the world.413 In Jn. 6:40 (Omnis qui cognoscit aut videt filium et credit in eum, habebit vitam ternam, et ego resuscitabo eum in novissimo die), the expression last day can refer to the day of the death of the individual: in this verse Christ promises the faithful that He will preserve them alive, just as a chapter earlier, in Jn. 5:24, He promised that the faithful would enter into life from death without being condemned.414 Marthas words in Jn. 11:25, by contrast, refer to the universal judgement, Zwingli asserted.415 Again, Pauls words in 1Cor. 3:13 (the classical proof text for the existence of Purgatory) speak about the daily afflictions.416 In a similar way, he argued, the expression resurrection of the dead can also be understood in two different ways: (1) it often means the life in which the souls are received after this life, and (2) other times it denotes the resurrection of the flesh.417 Then, the resurrection of the flesh can again refer to (1) the general judgement (Lk. 3:6), for not all people will see Christs salvation in this life, or (2) the revivification of the human flesh.418 Accordingly, the noun judgement is sometimes taken for the last and universal judgement, but other times
413Quod si videamus diem domini, interim pro fatali cuiusque hora, interim pro tem-pore vindict, quam de nobis quotidie sumit deus, interim autem pro universalis iudiciidie capi (HZSW XIV, p. 226). 414Hic ultimus etiam dies pro fato cuiusque accipitur. Promittit enim Christus se invita servaturum eos, qui se fidant, quacunque hora hinc migrent, quemadmodum superiusquinto capite dixit: credentes citra omne iudicium transire a morte in vitam (HZSW XIV,p. 226). 415HZSW XIV, p. 226. 416HZSW XIV, p. 226. 417Eodem modo dicendum est de resurrectione mortuorum, quae et ipse semel provita ea accipitur, quae protinus mortalem istam sequitur, iterum vero pro carnis resurrec-tione, quae futura est ultimo die, de quo alias (HZSW XIV, p. 227). 418Item carnis ipsa resurrectio nonnunquam pro universali iudicio omnium hominumponitur, quo modo dicitur: Videbit omnis caro salutare dei, qum caro, quocunque vertas,non recipiat salutarem Christum in hac vita, sed caro pro hominibus accipitur, nonnun-quam autem pro ipsa carnis humanae revivificatione (HZSW XIV, p. 227). post-mortem existence in the early reformation period 205
for the daily judgement, which is meant by Christ in Jn. 12:31, the SwissReformer maintained.419 He took up the theme again while commenting on Is. 26:14, where theHebrew text does have the verb . Here it isclear, Zwingli argued, that Isaiah uses the term in resurrectione mortuo-rum for the common dwelling of the blessed saints after this life.420 ForZwingli, Christs words to the Sadducees (Mt. 22:32) are the proof thatresurrectio can be understood in such a way: His argument says nothingabout the resurrection of the flesh, but it refutes the Jewish error thatmaintained that the souls do not live after this life.421 Zwingli mentionsfurther that Christs words also refute the Anabaptists, who dream thatthe souls fall asleep at the time of death of the human being, and refershis readers to his Elenchus.422 Is. 40:8 provided the third example in theIsaiah commentary to treat this subject. Although the term is sometimestaken to refer to the resurrection of the flesh, Zwingli pointed out, he ren-dered the Hebrew with the Latin Verbum tamendei nostri permanet in aeternum, because he argued that the Hebrew verb denotes to remain or to endure in this verse, similarly to the sense inwhich Paul used the Greek in 1 Cor. 15:29, which Zwingli para-phrased as, who would want to be baptized for the dead if the dead arenot alive after this life?423 Apparently, Zwingli added, the Sadducees and
419Sic iudicio aliquando pro ultimo et universali accipitur, aliquando vero pro quo-tidiano, quod et iuge est, quomodo Christus dixit: Nunc iudicium est mundi etc. (HZSWXIV, p. 227). 420Neque sunt in resurrectione mortuorum. Hic plane videmus resurrectionem profelici iucundoque beatorum contubernio, in quo post hanc vitam degunt, sumi. Sanc-torum autem de meo addidi, quo dilucidius fieret, quid per resurrectionem intelligant(HZSW XIV, p. 276). 421Resurrectionem autem hoc modo ab eis capi, quomodo ante attigimus [vide supran. 417] et Christus ipse testatur, qum saducaeis de resurrectione sic respondet: Non estdeus mortuorum, sed vivorum etc. Non enim est verisimile saducaeos tam crassumerrorem ausos fuisse inter Judaeos adserere, quod animae non viverent post hanc vitam. Atsimul si quis contendat eos carnis modo resurrectionem negavisse, obstat Christi respon-sio, quae ad carnis resurrectionem hoc loco nihil facit, qum tamen perhibeantur omnesadmirati fuisse eius presonsionem, quod nullo pacto factum esset, nisi dissolvisset illorumobiectionem (HZSW XIV, p. 276). 422Adparet igitur somnum quendam animabus tribuisse insulos sciolos, quomodocatabaptistae etiamnum somniant, Christum autem, vitam eorum et beatitudinem, qualisante natum Christum erat, adseruisse, quod non dormirent, sed viventes et vigilantes etsuo aliquo modo beati essent. De qua re in elencticis alicubi (HZSW XIV, p. 276). 423Vel hinc possumus discere surgendi verbum illis pro persistendi manendiqueaccipi. Hinc resurrectio mortuorum pro vita et duratione animarum etiam Paulo capitur,qum ait: Cur, inquam, baptizantur pro mortuis, si mortui non resurgunt?, hoc est: non206 chapter three
those to whom Paul was writing did not profess the crass error that thesouls died; they confessed, like the Anabaptists in Zwinglis own time, thatthe souls slept until Judgement Day, and Zwingli referred back to his ear-lier mention of this idea.424 In Is. 46:10, the Hebrew text once again con-tained a form of the same verb (), and this time Zwingli translated itwith the Latin verb constat, adding a note in the commentary explainingthat the Hebrew read surgit (the Vulgate translates it with stabit.).425 Finally, the same Hebrew verb is employed in Ps. 1:5: . Zwinglis translation, as containedin the Psalter published posthumously by Leo Jud (1532), reads: Hinc fit utneque impii neque scelerati vivant in coetu et concilio iustorum.426 Joye willexplicitly refer to this translation. In the summer of 1531, Zwingli addressed Emperor Charles V in theChristianae fidei brevis et clara expositio ad regem Christianum to defendthe Reformers position.427 Arguing inter alia on the basis of Jn. 5:24,
vivunt post hanc vitam? Quamquam resurrectio aeque pro carnis resurrectione accipian-tur in loco (HZSW XIV, p. 329). 424Adparet ergo sadducaeos et istos, adversus quos Paulus scribit, non crassum istumerrorem profiteri fuisse ausos, quod animae cum corporibus intermoriantur, sed, quodnunc catabaptistae faciunt, animas dormire perinde ac corpora usque ad universale iudi-cium. De qua re supra quoque attigimus (HZSW XIV, p. 329). 425Dicto consilium meum constat. Hebreae: dicendo vel quum dico consilium meumsurgit. Nobiscum sentiunt rabini, quod puncta probant sententialia (HZSW XIV, p. 352). 426Huldrych Zwingli (trans.), ENCHIRIDION PSALMORUM, quos sanctae memoriaeclarissimus uir Huldrichus Zuinglius ex Ebraica ueritate latinitati donauit, et mire claritateillustrauit, Tiguri: Apud Christophorum Froschouer, 1532. The autograph is in the Zentral-bibliothek Zrich (Sign. Ms. Car. C 37). Critical edition in HZSW XIII, pp. 468827. Ps. 1:5 ison p. 474. The German translation (1527), preserved only in the manuscript form, gives thefollowing rendering: Darum werdend die gotlosen nit ufrecht blyben im gricht, nochdie snder in der gemein der gerechten (HZSW XIII, p. 474). In Zwinglisown eighth volume of Jeromes Opera (Basel: Froben, 1516), containing the Psalteriumquadruplex, Zwingli wrote at the margin of Ps. 1:5 after the word resurgunt pro stabunt.Zwinglis copy is preserved in the Zentralbibliotheek Zrich (III ZZ 129). Critical edition:HZSW XII, 1937, pp. 32765. Zwinglis annotation to Ps. 1:5 is found on p. 327. 427The work has survived in two autograph manuscripts and in a copy by HeinrichBibliander. The earlier autograph of twenty-four folios can be found in the Staatsarchivof Zrich (shelfmark: E I.3.1., no. 70). The other is preserved in the Bibliothque Nationalein Paris (shelfmark: Fonds Latin no. 3673 A) and is divided into two parts: a section ofthirty-three folios (numbered 133) and another of ten folios (numbered IX). Both manu-scripts bear Zwinglis signature. The manuscript of thirty-six carefully written quarto pagesby Bibliander, dated 20 October 1532, is kept in the Zentralbibliothek Zrich (shelfmark:Ms G 3981). Zwinglis treatise was posthumously published in 1536. For a description, see:HZSW VI,5, (1991), pp. 149. Critical edition of the text: pp. 50163. In 1543 Joye publishedthe first English translation of the work with an appraisal of Zwingli: George Joye (trans.),The Rekening and declaracion of the faith and beleif of Huldrik Zwingly/ bishoppe of Zijrykthe cheif town of Heluetia/ sent to Charles. v. that nowe is Emperowr of Rome: holdinge a post-mortem existence in the early reformation period 207
Perlemente or Cownsaill at Ausbrough with the cheif lordis & lerned men of Germanye. Theyere of owr Lorde M.D.xxx. In the monethe of Julye, Translated & Imprynted at Zijryk [vereAntwerp: Catherine van Ruremund] in Marche. Anno Do. M.D. XLJJJ. Although the criticaledition describes the German, French, modern English, and modern Polish translations, itdoes not mention Joyes. 428Cum Christus ipse docuerit, quod, qui credunt, vitam eternam habeant, et quod,qui fidunt eo, qui Christum nobis misit, in iudicium non venient, sed iam transierint amorte in vitam, fit manifestum, quod hc mora cruciatus, quam animis hinc migrantibusdant papist, commenticia est et ficta (HZSW VI,5, p. 74). 429Si Christus non tollit mulctam et poenam peccatis debitam, cuiusnam causa factusest homo? (HZSW VI,5, p. 74). Cf. HZSW VI,5, pp. 11626. 430A piis hominibus opera idcirco non intermitti, quod proprie loquendo non merea-mur operibus; sed quanto maior est fides, tanto plura maioraque facimus opera (HZSWVI,5, p. 123). 431Postremo credimus post hanc vitam, qu captivitas et mort potius est quam vita, foe-licem ac iucundam sanctis sive credentibus, miseram autem ac tristem impiis sive perfidisusu venturam et utramque perpetuam (HZSW VI,5, p. 126). Cf. HZSW VI,5, pp. 12632. 432Qua in re et istud adversus catabaptistas, qui animas cum corporibus dormireusque ad universale iudicium contendunt, adserimus animum sive angeli sive hominisnon posse quidem dormire aut occidari; tam abest, ut isti quicquam rationi consonumdicant (HZSW VI,5, pp. 12627). Cf. HZSW VI,5, pp. 13334. 433Cum interim somniantes catabaptist merito somnum dormiant apud inferos, equo numquam expergefiant (HZSW VI,5, p. 132). 434Quoniam vero in catabaptistarum mentionem incidimus, volumus tibi, o rex, pau-cis eius sect rationem prestringere. Genus est fere hominum perditorum et pr angustiarerum extorrium, quorum qustus est anus magnifico de rebus divinis sermone demerei,quo aut alimentum aut non minutam stipem depromant (HZSW VI,5, p. 133). 435For Irenaeus refutal of the Valentinians, see supra on p. 86. For Gregory of Nazian-zen, see supra on p. 95. 436HZSW VI,5, pp. 13436.208 chapter three
Martin Bucer
Although Martin Bucer (or Butzer, 14911551), one of the leaders of theSouth German Reformation, is celebrated today for his irenic attitudeand his endeavours to bring about reconciliation between the factions ofthe German Reformation, for our present topic his controversies and hisPsalm translations are more relevant.437 Around 1525 Luther asked Bucerto translate Johannes Bugenhagens Latin Psalter into German.438 Despite
437Born in Alsace, at the age of fifteen Bucer joined the Dominican order (1506). Hewas sent to Heidelberg, where he met Luther and adopted his doctrine. With papal dis-pensation Bucer left the Dominican order in 1521 and became Court Chaplain to Frederick,the Elector Palatine. In 1522, as a secular priest, he married a former nun, being one of thefirst priests in the Protestant movement to break his vow of celibacy. After being excom-municated in 1523, he went to Strasbourg, where he played a major role in shaping thenew Protestant identity of the capital of Alsace. He played a pivotal role in moving thesynod to take actions against the residing Anabaptist refugees in 1533 (see supra in n. 66 onp. 19 and infra on p. 278). After having questioned their leaders, he let Melchior Hoffmanimprisoned and ousted Caspar Schwenckfeld. Within mainstream Christianity, however,he stroved for the unification of various factions. He undertook several attempts to accom-modate Luthers and Zwinglis teachings on the Eucharist. His harmonizing efforts wereinitially denounced by both parties but eventually (after the death of both Zwingli andOecolampadius) resulted in the Concord of Wittenberg among German Protestants (1536).This agreement, however, did not last long, was rejected by several Protestant congrega-tions, and created a breach between Bucer and the Swiss Protestants. After the SchmalkaldWar (154647), the Diet at Augsburg adopted the Twenty-Six Articles (Augsburg Interim)in 1548, which Bucer fiercely opposed, for he feared Romanizing. Nonetheless, the CityCouncil of Strasbourg consented to the compromise settlement between Catholic and Prot-estant teachings, and Bucer felt obliged to leave. He accepted an invitation by ArchbishopThomas Cranmer and left for England. He was commissioned to make a Bible translationfrom the original languages into Latin, which was to serve as a basis for a vernacular trans-lation. Later he was appointed to teach at Cambridge (1549) and to advise on the Book ofCommon Prayer (1550). Shortly after receiving the degree of doctor of divinity, Bucer died.He was buried in the principal church at Cambridge, but under Queen Mary I his bodywas exhumed and publicly burnt (1556). The best biography of Bucer is Martin Greschat,Martin Bucer. Ein Reformator und seine Zeit, 14911551, Mnchen: C.H. Beck, 1990 (Englishtranslation: Martin Bucer: A Reformer and His Times, Louisville: Westminster John Knox,2004). For a bibliography on Bucer, see: Holger Pils, Stephan Ruderer & Petra Schaf-frodt (eds.), Martin Bucer (14911551). Bibliographie, Gtersloh: Gtersloher, 2005. On histheology, see also: Marijn J.J.P. de Kroon, Wij geloven in God en in Christus. Niet in de kerk.Wessel Gansfort (+1489) en Martin Bucer (+1551), (Theologie en geschiedenis), Kok: Kampen,2004; Nicholas Thompson, Eucharistic Sacrifice and Patristic Tradition in the Theology ofMartin Bucer, 15341546, (SHCT 119), Leiden: Brill, 2005. 438Johannes Bugenhagen, Ioannis Pomerani Bugenhagii in librum Psalmorum interpre-tatio, Wittemberg publice lecta, Basel: Adam Petri. 1524. For a bibliography on JohannesBugenhangen (14851558) and his works, see: Georg Geisenhof (ed.), Bibliotheca Bugenha-giana. Bibliographie der Druckschriften des D. Joh. Bugenhagen, (Bug. 1; QDGR 6), Leipzig:Heinsius Nachf., 1908 (reprint: Nieuwkoop: De Graaf, 1963). See also: Werner Rautenberg(ed.), Johann Bugenhagen. Beitrge zu seinem 400. Todestag, Berlin: Evangelische Verlags-anstalt, 1958; Helmut Claus, Johann Bugenhagen 14851558. Bestandsverzeichnis der Drucke post-mortem existence in the early reformation period 209
the fact that Bugenhagen had little Hebrew, he was said by Luther inthe first foreword of the Psalter to be primus in orbe to interpret thepsalms, because the Psalter had not been adequately translated prior toBugenhagen.439 Luther also expressed his wish that a Latin translationof his own Kirchenpostille be published.440 In spite of Zwinglis advicenot to accept either, Bucer performed both translations.441 Bucers Latintranslation of Luthers Kirchenpostille was published in four volumes byJohann Herwagen in 152526 in Strasbourg.442 Bucers German translation
448Erstlich hat Johannes Pomeranus selb vil geendert und bessert, wie er mir des einexemplar mit seiner hand corrigiert und bessert zgeschikt hat. In dem hat er mir gewatltgeben z ordnen, z- und vonzthun, auch z endern, nochdem ichs dem leyen nutzlichachten mo cht. Dehalb er mir zgeschriben hat under anderem mit disen worten, die-selbigen au dem Latein z verteutschen: Verdolmetsche disen meinen Psalter auff dasfreyest, endre, th z, th von, richts in eine andere ordnung, setze ettlichs an sein ort,lege etlichs klere au oder auch anders, das er also nicht weniger dein dann mein Psaltersey. Hierin solle dir durch mich alles gepu ren, das du hoffen magst unseren Teutschennutzlich werden, Das nun auch die ungelerten und kinder ettvas vom Psalter verstanden,welchs vor der zeyt den gelertisten Doctoren gefelet hat. Far frt, der herr sey mit dir.Amen (MBDS 2, p. 191). Bugenhagen will later refer to his words in the Oratio: Interpre-tare mi Bucere hoc meum Psalterium quam liberrime, muta, adde, deme, in alium ordinecolloca, qudam suo loco repone, qudam vel clarius vel aliter interpretare, ut non magismeum quam tuum sit psalterium. Omnia hic tibi per me licebunt quibus consultum sper-averis nostris Germanis (Johannes Bugenhagen, Oratio Ioannis Bugenhagii Pomerani, quodipsius not sit opinio illa de eucharistia, qu in psalterio sub nomine eius Germanice translatolegitur, Wittenberg, 1526, sig. A3r). 449Non quod excusem Bucerum, qui stultus putavit serio scribere, quod Pomeranusoblique scribebat, nempe permissum esse Bucero, ut mutaret atque [?] aliter interpretare-tur ac enarraret pro arbitrio. Qu verba civilitatem mutuam requirebant, scilicet ut hicnoster illi rescriberet: Indoctior sum, quam quod ausim vel iotam de tuis mutare; quinbene mecum agitur, si suffecero, qu dixisti prior optime Latinis auribus, in Germanamceu coloniam traducere non pessime. Istud esset candoris theologici. Iam vero rusticusnoster simpliciter accepit, qu rhetorica figura in aliud dicuntur, commutat, variat, ver-tit invertitque omnia, quatenus plebeium lectorem putavit referre (HZSW VIII, no. 531,p. 724). 450On 6 January 1526 he wrote to Zwingli: Bucerus anno superiore causa parandivictus Pomeranum vertendum receperat. Tedia multa devoravit. Vertit. Excusus est liberBasile. Quam studium hominis Wittenberga probatura sit, experiemur brevi (no. 428 inCR XCV on p. 477). 451Bugenhagen, Oratio Ioannis Bugenhagii Pomerani, sig. A2r.212 chapter three
452Cur, ubi nihil opus erat, occasionem qusivit inserendi suum dogma quasi meum,ut sic nomen meum et ministerium verbi mihi a deo commissi contaminaret, et fidelibussuspectum redderet, quando interim ergo optima quque de eo senstiebam? (Bugenha-gen, Oratio Ioannis Bugenhagii Pomerani, sig. A3v). See also Martin Bucer, Schriften derJahre 15241528, ed. Robert Stupperich, pp. 17980; Duffield, Psalter of David. 453Johannes Bugenhagen, Contra novum errorem de sacramento corporis et sang. J. Chr.ad D.J. Hessum, 1525. Quasi vero non sim is, qui non solum in aliis libris, sed etiam in pub-licum contra hanc opinionem dita ad D. Hessum epistola, haud obscuris verbis meamtestatus sum sententiam? [...] Qui potuit ista interpres meus ignorare? Bugenhagen, Ora-tio Ioannis Bugenhagii Pomerani, sig. A2v. On Johann He, see: Neue Deutsche Biographie,vol. I, p. 456, and vol. IX, pp. 78. 454Bugenhagen, Oratio Ioannis Bugenhagii Pomerani, sig. A4r. 455Ita ut non sint contenti miseri homines suum virus propriis et iam infinitis librissparsisse, nisi et alienos libros eo veneno illito perdant. Idem fecit et antea Iohanni Pomer-ano in suo Psalterio insigni perfidia, quem non ignorabat per Dis dia pasn ab illa impiaSecta dissentire (Luther to Johann Herwagen (see supra n. 438 on p. 208), dated 13 Sep-tember 1526; WA XIX, p. 471). 456Hanc epistolam, mi Hervagi, ideo ad te scribo, ut si editurus es denuo Tomumillum quartum, omnibus modis eam praefigas vel subnectas, ut sit Lectori in meo libroantidotum adversus Buceri praefationem (WA XIX, p. 473). 457Johannes Bugenhagen, Die souter rvel verduytscht wt die heylige oft Hebreeuschesprake. Verclaringhe des gheheelen psalters seer claer ende profitelic door Johaem Bugenha gwt Pomeren/ aen vele plastsen door hem seluen gebetert, e om nurticheyt der ghemeyntenin goeden verstdeliken duytsche ouer gheset, Basel: Adam Anonymous [vere Antwerpen:Johannnes Hochstraaten], 1526. (PRSch 20). post-mortem existence in the early reformation period 213
458E.g. Bugenhagen, Bibliotheca Bugenhagiana, ed. Georg Geisenhof (Bug. 1; QDGR 6),Leipzig: Heinsius Nachf., 1908 (reprint: Nieuwkoop: De Graaf, 1963); W.H. Neuser in MBDS,2, p. 183. The pseudonymity was intended, of course, to give the censoring authorities thesame idea. 459He also used the same pseudonym for the Dutch translation of Luthers Kirchenpos-tille. Paul Valkema Blouw, Early Protestant Publications in Antwerp, 152630. The Pseud-onyms Adam Anonymous in Bazel and Hans Luft in Marlborow, in Quaerendo 26 (1996),pp. 94110. Formerly, Kronenberg believed the printer to be Johannes Hillenius of Hooch-straten, but Valkema Blouws evidence corrects her. M.E. Kronenberg, De geheimzinigedrukkers Adam Anonymous te Bazel en Hans Luft te Marburg ontmaskerd, in Het Boek 8(1919), pp. 24180. Cf. also Gerhard Hammer, Der Streit um Bucer in Antwerpen, in Lutheri-ana. Zum 500. Geburtstag Martin Luthers von dem Mitarbeitern der Weimarer Ausgabe, ed.Gerhard Hammer & Karl-Heinz zur Mhlen, Cologne, Vienna: Bhlau, 1984, p. 400. 460Published in Hammer, Der Streit um Bucer in Antwerpen, pp. 44054. 461Published in Hammer, Der Streit um Bucer in Antwerpen, pp. 44054. See alsoHammers discussion on pp. 43440. 462There is no further information available on the identity of the authors. See:Hammer, Der Streit um Bucer in Antwerpen, p. 425. 463Daeromme, hoe wel dat Pomeranus selve teghen desen vervalsscheren, ghelijck-erwijs hi mi beloefde te doene, sonder twijfel geno ch gehschreven heeft ofte scrijven sal,nochtans op dat ick oock het mijne daer toe doen soude ende aen haren dolen ontschul-dich sijn soudean den grooten dach des heeren Jesu Christi, so hebben wi, Clemens endeJacob, na die genade, die ons god gegeven heeft, desen hondert ende thienden Psalm wtden Latijne in onsen nederlandschen duytsche overgheset, ghelijckerwijs hi van Pomeranoghescreven is, op dat die loghenachtighe valscheyt deser ketteren te beter aen den dachofte int openbaer comen soude (Hammer, Der Streit um Bucer in Antwerpen, p. 446).214 chapter three
464So gedachte die Sathan ooc een capelle bi deser kercken godts [de Souter van Pomer-ano] te timmeren ende is gevaren inden Bucerum, ende die heeft die reyne godsalige Christiinden Latijnische Souternamelic in desen hondert ende elfsten PsalmPomerani latenstaen ende aen die stadt sijne onnutte clapperijc ende duvelsche ketterije van der verkeer-inghe des woordts Christi int avontmael ghesettet ende des Christelicken bisschops Pomer-ani boeck gevalschet (Hammer, Der Streit um Bucer in Antwerpen, p. 446). Cf. p. 451. 465Hammer, Der Streit um Bucer in Antwerpen, p. 446. 466Hammer, Der Streit um Bucer in Antwerpen, p. 446. 467Hammer, Der Streit um Bucer in Antwerpen, p. 453. 468Versionem in psalmos tuam non legi, sed si bona fide vertisti que scripsit Pomer-anus, non possunt abesse dogmata que nunc pro damnatis habentur a plerisque [...] Egonec Luhteri ac Pomerani criminationem nec tuam purgationem legi. Tantum quod vnoore dicebatur ab his qui legerant credidi (Erasmus to Martin Bucer, on 2 March 1532,published in: Allen, IX, no. 2615, pp. 44950). 469Ergo apologia apologiam pariet, qua dubiis lectoribus ob oculos fumus spargetur(HZSW VIII, no. 531, p. 725). 470Ridiculam videbis tragdiam [...] Pudet me vicem istorum, qui se tantopereprodunt: diminuendo nomini ac fam crucis prdicatores timent (HZSW VIII, no. 531,p. 725). post-mortem existence in the early reformation period 215
the 1547 edition: Martin Bucer, Sacrorvm Psalmorvm libri quinqve, ad Ebraicam veritatemgenvina uersione in Latinum traducti. Primm appensis bona fide sententijs, deinde paridiligentia adnumeratis verbis tum familiari explanatione elucidati. Nunc denu, non paulomaiore qum antea, & fide & diligentia emendati. Aretio Felino autore, Basileae: par Ioan-nem Hervagium, 1547. On the publication of the Psalter see: R. Gerald Hobbs, How Firma Foundation: Martin Bucers Historical Exegesis of the Psalms, in Church History 53 (1984),pp. 47792. On Ulricher, see Franois Ritter, Histoire de lImprimerie Alsacienne aux XVeet XVIe sicles, (Publications de lInstitut des Hautes tudes Alsaciennes 14) Strasbourg: LeRoux, 1955, pp. 31617; Miriam Usher Chrisman, Lay Culture, Learned Culture. Books andSocial Change in Strasbourg, 14801599, New Haven & London: Yale UP, 1982, pp. 620 pas-sim; and Miriam Usher Chrisman, art. Georg Ulricher, in Bietenholz & Deutscher (eds.),Contemporaries of Erasmus, ad vocem. 477Bucer to Zwingli, published in HZSW Zwinglis BW IV, (CR XCVII), Leipzig: M. HeinsiusNachfolger, 1929, no. 871. on p. 197. A translation of the letter with analysis and correcteddating is in Hobbs, Exegetical Projects and Problems, pp. 89108. 478Erasmus, Epistola contra quosdam qui se falso inactant evangelicos, Freiburg:Faber Emmeus, 1529. Republished in Desiderii Erasmi Roterodami Opera Omnia, vol. 10.(Lugduni Batavorum: Petrus Vander Aa, 1706; reprinted by: London: Gregg Press, 1962),cols. 157390. 479Nuper, ut audio quidam istius factionis Ecclesiastes non incelebris, verso nominedicavit librum filio Regis Galliarum, & insparsit identidem voces aliquot Gallicas, ne inAuctorem Germanum cadat suspicio, affictis & aliis aliquot conjecturis, ut Liber Lugduni Gallo & scriptus & excusus esse videatur. Agnoscis esse verissimum quod dico, nequeenim obscurum est, quis hanc technam commentus sit, & alias in lusu simili deprehensus.Hunc ludum si sibi permitteret in re vulgare, & profana, tamen indignus esset gravi viro:nunc quid minus conveniebat eum, qui se profitetur sacrosancti Euangelii prconem?(Erasmus, Epistola contra quosdam qui se falso inactant evangelicos, col. 1581 D-F). 480Martin Bucer, Epistola Apologetica ad syncerioris Chistianismi sectatores per Frisiamorientalem, & alias inferioris Germani regiones, in qua Enuanglij Christi uere studiosi, nonqui se falso Euangelicos iactant, ijs defenduntur criminibus, qu in illos Erasmi Rotterdamiepistola ad Vulturium Neocomum, intendit, Strasbourg: Petrus Schfer & Iohann. Aproni-anus, 1530. Republished as Martin Bucer, Epistola Apologetica, in Martin Bucer, MartiniBuceri Opera Latina, vol. 1, (SMRT 30), eds. Cornelis Augustijn, Pierre Fraenkel & MarcLienhard, Leiden: Brill, 1982, pp. 75225. post-mortem existence in the early reformation period 217
and the Strasbourg Reformers reached its widest point.481 In his apolo-getical epistle Bucer pointed out that even Roman Law only punished thealteration of names in books if it was meant to defame or harm someone.482Furthermore, the OT presents Abraham (Gen. 12:1420), Isaac (Gen. 26:711), and David (1Sam. 21:1015.27) deceiving people about their identity,Bucer claimed. Therefore, he called his pseudonymity only a pious fraud,which harmed no one but benefited many.483 The deceit was successful.Felinus became popular among both Protestants and orthodox Catholics,and even Johann Eck consulted and cited Felinus (albeit with reserva-tions) on several occasions.484 In the volume, which would later play a pivotal role in the Antwerpcontroversy, Bucer gives a translation and a detailed commentary of the150 psalms. Bucer draws extensively on Hebrew material and commentsupon the language, vocabulary, and style of the psalmist. He often refersto Jewish sources, too. One of the most cited Hebrew authors in the bookis Rabbi David Kimhi, whose commentary on the Psalms was the firstbook ever printed to contain a book of the Hebrew Bible.485
(eds.), Reuchlin und seine Erben. Forscher, Denker, Ideologen und Spinner, Ostfildern: JanThorbecke, 2005, pp. 4151, see p. 43; Hobbs, How Firm a Foundation, p. 487, n. 40). Bucerquoted from all three medieval Jewish commentators. On David Kimhi and Rashi, seesupra in n. 152 on p. 154. On Bomberg and his Rabbinical Bibles, see: Juhsz, Cat. 38 in TT,pp. 9495. On the itinerant Jewish commentator Ibn Ezra and his commentary on Psalm 1,see: Shlomo Sela & Gad Freudenthal, Abraham Ibn Ezras Scholarly Writings. A Chrono-logical Listing, in Aleph. Historical Studies in Science and Judaism 6 (2006), pp. 1355; StefanC. Reif, Ibn Ezra on Psalm I 12, in VT 34 (1984), pp. 23236; Uriel Simon, Four Approachesto the Book of Psalms. From Saadiah Gaon to Abraham Ibn Ezra, trans. Lenn J. Schramm,(SUNY series in Judaica), Albany: State UP New York, 1991 (original in Hebrew Ramat-Gan:Bar-Ilan University, 1982). 486Martin Bucer (trans.), Sacrorvm Psalmorvm libri quinqve, p. 1. 487Bucer, Sacrorvm Psalmorvm libri quinqve, p. 11 488Inest prterea huic uersiculo schema, quod uocant, quo ad unum uer-bum plures sententi referuntur. nam uerbo, non consistent, & in iudicio, et in concilio,subiungitur (Bucer, Sacrorvm Psalmorvm libri quinqve, p. 10). 489Stare in iudicio, per Metaphoram, pro uincere iudicium, caussamque probare,accipitur (Bucer, Sacrorvm Psalmorvm libri quinqve, p. 10). 490Cterum resurgent, sed non in resurrectionem uit: astabunt tribunali Christi, sedut pronunciata sententia, mox se recipiant in ignem ternum, paratum diabolo, & huiusangelis (Bucer, Sacrorvm Psalmorvm libri quinqve, p. 11). post-mortem existence in the early reformation period 219
council of the righteous to mean the assembly of the souls of the saints,to which the saints are admitted after this life, Bucer added. From thisassembly the wicked are excluded, so they will perish in body and soul.491 Bucers representation of Rabbi David Kimhis commentary is fairlyaccurate. Kimhis commentary runs as follows: , , . , , ; . , , 492. In line with other medieval Jewish commentators (inter alios Rashi) andwith the Aramaic Targum, Kimhi understood Ps. 1:5 in the light of thefuture judgement. Apparently this judgement takes place, in Kimhisunderstanding, immediately after (on the day of) the death of the per-son. The soul ( ) of the righteous ( ) will be able to stand in thejudgement. And after the persons death, he or she will join the assemblyof the souls of the righteous in glory. But neither the wicked ( ) northe sinners () will be able to stand in the judgement,493 for the sin-ners will perish both soul and body () , and thereforewill not stand in the judgement. Kimhis recurring expression to explain the Hebrew verb is an allusion to Lev. 26:37:. Avery literal rendering of Kimhis expession in English could be: there willnot be for them (the possibilty of) standing ( ). This explanation,
491R. Kim. iudicium hic diem mortis cuiusque intelligit, & concilium iustorum, ctumsanctarum animarum, in quem sancti post hanc uitam admittentur, & ex quo reprobiexcludentur, ut qui pereant animo & corpore (Bucer, Sacrorvm Psalmorvm libri quinqve,p. 11). 492THEY WILL NOT RISE IN THE ASSEMBLYthis wants to say: in the day ofthe judgement, and this is the day of death, they shall not be able to stand. AND THESINNERSalso likewise, and this will be the judgement for those who scorn: they shall notbe able to stand IN THE ASSEMBLY OF the RIGHTEOUS; for the Righteous, when they willdie, they will be able to stand; but surely the SINNERSthey shall not be able to stand buttheir souls will be destroyed together with their bodies on the day of death. And: IN THEASSEMBLY: for when the righteous die, their souls will be delighted with the souls of therighteous in glory in the supreme world (my translation). Republished in: Mikraot GedolotHaketer. Psalms., ed. Menachem Cohen, Ramat-Gan: Bar-Ilan UP, 200304, p. 4. 493There are differing views in medieval Jewish exegesis whether these represent twodifferent groups and whether or not the sinners will rise at all. Rashi e.g. differentiatesbetween the two groups. Cf. Mikraot Gedolot Haketer, (200304), pp. 36.220 chapter three
Besides his comments on the verb , Bucer touched upon issues of theafterlife while explaining the meaning of the Hebrew nouns , , and ( all being synonyms for grave). Ps. 6:56 (Vg: 6:45) gave him hisfirst opportunity to reflect on these nouns. These two verses read in histranslation as follows: Recipe ab ira te, Iehouah, eripe animam meam,serua me pro tua bonitate. Etenim inter mortuos nemo tui memor est, apudinfernos quis te celebret?498 In this passage, Bucer translated the Hebrew with apud or in infernos, although the noun technicallymeans grave (sepulchrum), Bucer noted. The Hebrew language has fourwords that can be translated as grave (, , , and ) , buttheir meanings differ, Bucer stated.499 is the grave which is alwaysopen and swallows everything; is a small pit which is dug out; isthe grave in which everything that is buried will be destroyed; and isthe grave that has to be dug.500 At the same time, the OT has no specificword to describe the state of the souls after this life, Bucer asserted.501 Justas the Latin language uses the word infernus to describe the dead, the OTauthors make use of the noun for referring to the souls of the dead.502By way of illustration, Bucer quoted Gen. 37:35, where Judah cries out inhis grief over Joseph: Descendam luge[n]s , id est in infernum, adfilium meum.503 Another example for such a usage can be found in thestory in Num. 16 about the revolt of Korah, Dathan, and Abiram, Bucerpointed out. There, upon Moses words, it is said about the rebels thatthey uiui desce[n]derint , id est in infernum.504 The two examplesshow that the noun is semantically neutral, for it can denote the stateof the righteous as well that of the wicked, Bucer explained. For nobody
can doubt that Judah had hoped to be carried by angels to the bosom ofAbraham, in the assembly of the blessed faithful fathers, while the rebelsdescended to somewhere else entirely.505 Consequently, can signifythe state of the dead, whether they be the righteous or the wicked.506 Nonetheless, the OT does have a proper term to indicate the place ofthe wicked after their death, Bucer continued. This expression is Gehenna,which is derived from the Hebrew { Geben hinnom.}, id est uallefilij Hinon.507 Into this valley of the Son of Hinnon cadavers and the filthof Jerusalem were dumped, and it is also where, according to Jer. 7:3132;19:26; and 32:35, the ungodly sacrificed their children to Molech, Bucerrelated. From the name of this valley the noun , id est gehennamis contracted, and by way of transfer of meaning it is used to describe thecondition of those who are sentenced to eternal punishment.508 Thesepeople are like the excrement of the world (mundi excrementa) for whomthere can be no place in Jerusalem, the city of the saints, Bucer concludedhis explanation.509 But why were the OT saints so afraid of death? asked Bucer. He foundthe answer in the idea that the knowledge about the future life was not asclearly revealed to them as it was after Jesus glorification.510 Among theexamples illustrating his point, Bucer cited Phil. 1:23: There is no Chris-tian, the Alsatian exegete wrote, who does not hope to live eventuallywith Christ in the blissful mansion in eternal, inconceivable happiness.But how few people can eagerly say together with Paul that they longto depart and be with Christ? If people really hoped to win the blissfullife with God, they would sooner lay down this present life with all of itsdreadful sufferings as soon as possible than they would deny the Lord,
Bucer maintained.511 Therefore, to think about death as a gain (ut mori prolucro habeamus), it is necessary to be fully convinced about the benefits ofthe future life (de bonis futur uit), Bucer exhorted his readers.512 Death istherefore not to be feared, he argued, because the future life is a life withChrist in the fullness of happiness. From Bucers use of Pauls words it isclear that the Strasbourg Reformer understood this being with Christ astaking place immediately after the death of the human person and as areal, temporal alternative to remaining in the body. Bucer reflected on the word again in his comments on Ps. 16:910. The joy and the confidence of the Psalmist in verse 9 stem from hisfaith in the resurrection, which is professed in the following verse, Bucerexplained, because the faith in the resurrection renders everything lightand sweet, and the fruit of true faith is the intense joy of the soul.513 Whilein his translation Bucer opted to use sepulchrum, the literal meaning ofthe word in verse 10, in the paraphrase Bucer rendered it with infer-num because, he argued, the Hebrew word means both the grave (sepul-chrum) and the state of the dead (conditionem mortuorum).514 The versealso contains another Hebrew synonym for grave: . This, as Bucernoted, is translated in the Greek of the LXX as , which means cor-ruption or decay.515 The Greek noun reflects the root of the Hebrew nounbecause the body in the grave decomposes and perishes. The translators ofthe LXX therefore expressed more simply (simpliciter) what the Psalmist
511Nemo siquidem est Christianus, qui non credat sibi apud Christum beatam man-sionem paratam, in qua olim incredibili flicitate in ternum uiuat. at quotusquisquetamen ex animo dicat cum Paulo: Cupio dissolui, et esse cum Christo? Inuenias quidem &huius fidei aliquot, sed plures qui hunc nondum uenerunt: & si ade credant apud Deumbeatam se uitam uicturos, ut hanc diris cruciatibus posituri sint citius, que Dominumabnegaturi (Bucer, Sacrorvm Psalmorvm libri quinqve, p. 73). 512Bucer, Sacrorvm Psalmorvm libri quinqve, p. 73. 513Ver fidei fructus [...] solida animi ltitia est. [...] Vbi enim spiritus fide certadonatus est, & uerum diuin bonitatis, gustum percepit, redundat illico eius gaudium, &in carnem, ut nihil trepidet, secureque manum Domini sustineat, & si crux illi ferenda sit, &renasci nequeat, nisi antea destructa. Nam illi resurrectionis spes, omnia leuia & dulciareddit. Hanc uersus decimus canit, nam ait, Non deseres animam meam in sepulchro: idest non ita destitues me, ut anima mea morti concedat (Bucer, Sacrorvm Psalmorvm libriquinqve, p. 134). 514Verse 10 was translated as Neque enim deseres animam meam ut sepulchrum subeat:neque permittes, ut uideat bonus, quem tibi delegisti, foueam. Bucer paraphrased the trans-lation in the commentary: Quia non deseres animam meam ad infernum, non dabis bonumad uidendum foueam (Bucer, Sacrorvm Psalmorvm libri quinqve, pp. 129 and 134). 515 Grci, per reddunt, quod corruptionem significat (Bucer, SacrorvmPsalmorvm libri quinqve, p. 135). Bucer is correct asserting that the verb means tocorrupt, to destroy.224 chapter three
says figuratively ( figurat).516 Bucer also pointed out that the LXX cor-rectly renders as and not as , for the Psalmist uses theparticle ( to/towards/into) and not the particle ( in).517 This means thateven the translators of the LXX might have conceived Gods protection ofHis saint as not letting the saint descend into the netherworld.518 Also, inthe Acts of the Apostles, Ps. 16:910 is quoted in this form, although whenthe apostles Peter and Paul quote the psalm (Acts 2:27 and 13:35), theyapply it to prove the resurrection of Christ. There are uneducated people(rudiores), Bucer maintained, who therefore would object in the follow-ing way to such a reading of the psalm: according to our faith, Christ didgo to the netherworld, did die, and was really buried, but His spirit couldnot be detained by the netherworld, nor could His body be kept in thegrave.519 But when they cite Ps. 16:10 to prove their case, the Jews, whoconceive the Psalm to be referring to David, laugh at us Christians and say:David was thus mistaken when he thought that he would be preserved byGod, in whom he put his hope that God would preserve him and not lethim descend to the grave or to the netherworld.520 But Peter foresaw thisargument and refuted it when he pointed out that David died eventually,and his monument was still present in Peters time (Acts 2:29).521 Con-sequently, the Psalm could not refer to David, Bucer argued, because hissoul descended into the netherworld and his body decayed in the grave.522But the prophecy is fully fulfilled in the Saviour, who, although He diedand was buried, did not remain dead and buried in the grave, but instead
rose on the third day, and His body was inaugurated into the happy andimmortal life.523 So if Christ said of those who believed in him that theywould not taste death, this can be applied even more so to Himself, whois called life and resurrection (Jn. 8:52; 11:25; cf. Mt. 16:28 et par.).524 Commenting on Ps. 49(48):16, Bucer also alluded very briefly to theintermediate state of the soul between death and resurrection. This verse,which Bucer rendered with Sed animam meam reducet ab inferno Deus:nam suscepit me. Selah, speaks about God bestowing immortality (dareimmortalitatem) on those who leave behind this world: while the body isgiven to earth and becomes food for worms (corpus humo demandatumesca uermium est), the soul enjoys Gods comfort.525 And when the Psalm-ist declares his reason for rejoicing in this verse (because He receives me),he preaches about all believers, for the Saviour promised that the elect, towhom He gave His spirit, will never taste death.526 The believers will beresurrected at the end of the world, but in the meantime God gives happi-ness to their souls in Heaven, a mystery which can barely be understood,and therefore the Psalmist added Selah at the end of the verse.527
523At in Seruatore uer completum illum scimus. Licet enim mortuus & sepultus fue-rit, non tamen in morte & sepulchro hsit, sed in triduo rediuiuus, immortalem & beatamuitam in corpore quoque suo auspicatus est, ut non iniuria dicatur inferos nunquam adi-jsse, neque uidisse sepulchrum (Bucer, Sacrorvm Psalmorvm libri quinqve, p. 135). 524Etenim si de credentibus in se propter resurrectionis expectationem Seruator dixit,mortem huiusmodi nunquam gustaturos: id multo rectius de ipso, qui ipsa uita est & resur-rectio, dicitur (Bucer, Sacrorvm Psalmorvm libri quinqve, p. 135). 525Bucer, Sacrorvm Psalmorvm libri quinqve, p. 323. 526Huius uer felicitatis dum caussam reddit, prdicat eandem omnibus credentibuscommunem. Ait enim, Quia sescepit me. Quoscunque enim suscepit Deus, suscipit autemquos eligit ad uitam, quibus suum donat spiritum, ij omnes ut Seruator dixit, mortemnunquam gustabunt (Bucer, Sacrorvm Psalmorvm libri quinqve, p. 323). 527Nam suscitabit illos in die nouissimo, et interim mentibus sua gaudia donabit inclis. Et hoc nigma est, quod caro & sanguis intelligere haud possunt, ideo & Selahadiectum est (Bucer, Sacrorvm Psalmorvm libri quinqve, p. 323). Bucer noted that the Ara-maic Targum renders the last clause of the verse by because He will teach me His Law for-ever, but Kimhi interpreted the qal imperfect third-person masculine singular fromthe verb as he will take me away, as it is said in Gen. 5:24 about Enoch that he wastaken away and existed no longer, because Kimhi thought that the soul would be extin-guished together with the body. Yet Ibn Ezra interpreted the clause as referring to Godreceiving the soul of the Psalmist after his death, as the Psalmist says at another place: hewill guide me with his council and will receive me with honour (Ps. 73(72):24). Chaldushabet hic: Quoniam docebit me legem suam in ternum. Kimhi uero accipit { Lacah.}pro tollet me, sicut accipitur Gen.5. de Chanoc: Et non erat, qua , id est sustulit illumDeus. uult enim sensum esse, Redimet Deus animam meam ab inferno, uel sepulchro,quum sustulerit me & mori fecerit, ut scilicet anima cum corpore extinguatur. A.Ezraautem, suscipiet me, idem esse putat atque, assumet ad se in morte spiritum meum. Iuxtaillud: Deducet me consilio suo, & postea gloria suscipiet me. Again, Bucers quotations226 chapter three
Heinrich Bullinger
In the summer, or autumn at the latest, of 1526 the Swiss theologian Hei-nrich Bullinger (150475) wrote a small pamphlet with the title Quod ani-mae a corporibus separatae non dormiant, sed cum Christo in clis vivant.528
The booklet was to satisfy the repeated requests of Paul Beck (d. 1547)of Munderkingen, who had joined the Reformation in Zrich at an earlystage and to whom Bullingers book is addressed.529 Bullinger began hisexposition by referring to the pagan writers of Antiquity (including Sen-eca, Ovid, and Cicero). Since it involved oblivion, they considered sleep() to be an image of dying (mortis imago). Bullinger posed the rhe-torical question: Somnus enim quid alius est quam quies et cessatio?530But the soul, Bullinger believed, is perpetual, as Aristotle saysin his De animahence, it cannot cease to exist.531 Not only ancient pagan philosophy but also the teachings of Christ,who is the Truth, demonstrated the immortality of the soul, Bullingerargued, when He answered the Sadducees in Mt. 22:32. Jesus answer is ageneral law that does not contain anything about the bodily resurrection.532Therefore, Bullinger asserted, all deceased believers must be alive becauseGod is the God of every believer. Since their bodies are sleeping, they canonly be alive according to their souls (iuxta animam). But Christs answerwas given to the exact question that was put to him, because the Saddu-cees, according to Josephus, denied the immortality of the soul, so theirquestion must have been about the immortality of the soul and not aboutbodily resurrection.533 Next, Bullinger quoted Jn. 6:40: This is indeed thewill of my Father, that all who see the Son and believe in him may haveeternal life; and I will raise them up on the last day. Here, Bullingermaintained, Christ evidently refers to two distinct notions: (1) the eternallife of the souls that starts at the moment of corporeal death and (2) the
Theologe, in Gudrun Litz, Heidrun Munzert & Roland Liebenberg (eds.), FrmmigkeitTheologieFrmmigkeitstheologie. Contributions to European Church History. FS fr BerndtHamm zum 60. Geburtstag, (SHCT 124), Leiden: Brill, 2005, pp.423436; W.J. TorranceKirby, The Zurich connection and Tudor Political Theology, (SHCT 131), Leiden: Brill, 2007;Emidio Campi & Peter Campi, Heinrich Bullinger. LifeThoughtInfluence. Zurich, Aug.2529, 2004, International Congress Heinrich Bullinger (15041575), (Zrcher Beitrge zurReformationsgeschichte 24), Zrich: Theologischer, 2007. 529Paul Beck was registered at the University of Heidelberg in January 1516, wherehe obtained his B.A. in 1523. Subsequently, he was chaplain in Heidelberg, parish priestof Munderkingen, preacher in Geislingen and Langenau, and dean in Esslingen. (GeorgBurkhardt, Paulus Beck, der este evangelische Geistliche Geislingens, in Bltter fr Wrtem-bergische Kirchengeschichte 35 (1931), pp. 24965; and 36 (1932), pp. 63108.) 530HBTS, II, p. 129. 531Anima porro perpetua est (HBTS, II, p. 129). Cf. Aristotle, De anima. II,1. 532Quae quidem sententia generalis est; unde nihil agunt, qui resurrectionemtantum obiiciunt (HBTS, II, p. 129). 533Lege Iosephum, Antiqui. lib. 18, cap. 2 (HBTS, II, p. 129).228 chapter three
soul and referring to eternal life, the Swiss exegete maintained. And whenhe was stoned to death, the protomartyr Stephen saw the glory of Godand Christ standing on the right hand of God, and he prayed, Lord Jesus,receive my spirit (Acts 7:5559). Stephen asked Jesus to receive his spirit,which means his soul (spiritum, hoc est animam), but not to receive it inthe reign of dreams (non in somni regiam).540 To the possible objectionthat the souls of the deceased rest in the bosom of Abraham (in Abrahaesinu quiescere), Bullinger explained that the bosom of Abraham is not adormitory (non somni aulam), but signifies eternal life (vitam sempiter-nam), because it is said that many will come from east and west and willeat with Abraham and Isaac and Jacob in the kingdom of Heaven (Mt.8:11) and that Lazarus was comforted there (Lk. 16:25). Now, because theWord of God cannot be false (Num. 23:19; Heb. 6:18; Ps. 33(32):4), Bullingerargued, the souls are not detained by sleep, because resting can by nomeans be characterized as bliss.541 But the very usage of the verb to sleep in the sense of dying (this usage,according to Bullinger, takes its origin from 1 Thes. 4:13ff) should revealthat it can be applied properly only to the body and not to the soul. For insleep, one falls asleep for a short period of time, and afterwards one risesagain. In a similar way, the body is abandoned by the soul for a while,and it rises afterwards and lives together with the soul forever. There-fore, sleeping and rising again can properly refer only to the body, not tothe soul, Bullinger maintained,542 for only things that pass away can riseagain, and the soul does not pass away.543 Finally, the passages in whichPaul speaks about our dwelling place (conversatio) in Heaven, from wherewe expect our salvation (Phil. 3:20), and about the crown of righteousnesshe is going to receive (2 Tim. 4:8), as well as Johns words in 1 Jn. 3:2 (weare Gods children now; what we will be has not yet been revealed)allof these places refer to the final Day of Judgement at the end of the world,Bullinger argued, when God will transform the body of our humiliation sothat it may be conformed to the body of His glory (Phil. 3:21), and we willbe like Him, for we will see Him as He is (1 Jn. 3:2).544
A few months later, at the end of 1526, Bullinger wrote another book-let on the article of the Creed about Christs descent into Hell.545 Theoccasion for the writing of the book was the teaching of a certain RudolfWeingartner (d. 1541), who was the addressee of several letters andworks by Bullinger between 1524 and 1528.546 In a short letter to Zwingli,Bullinger asked Zwinglis assistance in answering Weingartner concern-ing Christs descent into Hell.547 Zwinglis answer has not survived, butwe know Zwinglis position on the matter, as it is articulated in his let-ter to Berchtold Haller.548 Bullingers stance shows several points relatedto Zwinglis. Bullinger started by clarifying 1Pt. 3:17ff and 4:17 to explain the sote-riological character of Christs descent. He pointed out that Christ died forour sins so that we, purged by His blood from sin, would become apt tobehold God (1Pt. 3:18).549 To that Peter adds that Christ went to preach tothe spirits in prison (1Pt. 3:19) and the Gospel was even proclaimed to thedead (1 Pt. 4:6). Bullinger maintained that these spirits in prison, as wellas the dead who stayed apud inferos, were the faithful of the OT who weredetained there from the time of Adam until Christs death.550 They hadbeen waiting for the coming of the Messiah in order to be released. Butthe question arises as to how they were released by Christ. Based on thequotation Peter uses in Acts 2:27 where he cites Ps. 16:10you will notleave my soul in inferno551and based on Gen. 42:38 and 44:29, Bullingeridentified the word infer(n)um with sepultus (grave).552 Consequently,Bullinger rejected both the bodily and the spiritual interpretation of this
article of faith.553 Rather, he argued that the virtue of Christs death andsalvation had its beneficial effect on the faithful of the OT, just as baptism,through the virtue of Christs resurrection, washes away the sins of thebaptized. It is Christ who is announced to the dead and it is by Him thatthey are redeemedthe very same Christ who is also announced to us.554 But how, Bullinger asked, would these souls of the blessed leaveinfer(n)um if they are pure spiritual substances? His answer is that theywill do so per procatalipsin (: anticipation). Their flesh willbe judged with all other flesh (with all other people), but in the mean-time their souls have already been liberated, and they live by Christ andrejoice in God.555 From this, Bullinger interjected, one can see whetherthe souls are sleeping.556 And to avoid all ambiguity Bullinger marked inthe margin: animae vivunt.557 Bullinger also raised the question of what happened to Christ duringthose three days. Surely He could not have been apud inferos, could He?558Bullingers answer is unambiguously negative (Non, Hercule!).559 Christis believed to consist of spirit, soul, and body.560 His spirit is of divinenature, and this part was never separated from God the Father.561 His souland body were human, but the body was locked in the grave, and Hishuman soul was in the hands and glory of God the Father because thatis where the dying Christ commended it (Lk. 23:46).562 The hands of Godthe Father, Bullinger explained, signify the conservation and protection inthe heavenly kingdom. Consequently, he claimed, all stories about Christsentrance and incursion into Hell, and His fight, glory, and triumph arepure poetical fables and similes.563 Concerning the destination of the lib-erated souls Bullinger held that their aspiration is the bosom of Abraham
553Ita ut per Christum non corpus aut animam Christi intelligas, sed totum redemp-tionis negotium per synechdochen, sic et inferorum nomine eos accipias, qui tenebanturapud inferos, iuxta metonymiam (HBTS, II, p. 174). 554HBTS, II, p. 177. 555HBTS, II, p. 176. 556Hic obiter vide, an animae dormiant (HBTS, II, p. 176). 557HBTS, II, p. 176. 558Interim tamen rogas, scio, ubi interea et per triduum fuerit Christus; numquidapud inferos? (HBTS, II, p. 178). Cf. Bonaventure, Sent. III. d. 22, qu 3. 559HBTS, II, p. 178. 560Credimus enim Christum constare ex spiritu, anima et corpore (HBTS, II, p. 178). 561Spiritum divina natura est, ceterum iuxta eam partem numquam fuit a patre sepa-ratus (HBTS, II, p. 178). 562Spiritum vero, hoc est humanam animam, quae spirat, vitae et humanorum adfec-tuum sedes est (HBTS, II, p. 178). 563HBTS, II, p. 178.232 chapter three
the souls do not sleep is also proved by Phil. 1:23 and Jn. 14:23.569 Theimmortality of the soul was even proved by Christs answer to the Sad-ducees in Mt. 22:2932.570 But the Anabaptists are wrong because on thebasis of the unity of body and soul they attribute to the soul what reallypertains to the body. This, however, gives rise to dogmatic problems,because then Christs soul, too, must have died with His body, and theresurrection is done away with, which, Bullinger asserted, was clearly ablasphemous position.571 The doctrine about soul sleep is not only repug-nant to Scripture and faith, and not only eliminates Christs resurrectionand the Gospel, but is against common sense and displays a vulgar andimprudent ignorance.572 Bullinger later reiterated his position in his commentary on the Gospelof Matthew (and in his commentary on Mark he referred the reader tohis commentary on Matthew).573 The Sadducees, Bullinger claimed, forwhom the Torah was the sole authority and who attributed everything tofree will, taught that one can be justified by ones own efforts, and they
denied the existence of spirits and angels.574 They also denied resurrec-tion of the dead. Since resurrection is the renewal or resuscitation ofwhat fell, it can refer to the immortality of the soul and the resuscitationor restoration of the body.575 Bullinger reaffirmed that the verb resurgereis used in Scripture in the sense to endure or persist, and consequentlyresurrectio can be used for the endurance or immortality of the soul andspirit.576 And even if Christs answer does not prove the resurrection of thebody, there are enough passages in those books of the OT which are notrecognized by the Sadducees as authoritative, and their fallacy, Bullingerasserted, and all of the later heresies concerning the resurrection wereeffectively refuted by Augustine and Epiphanius.577
The polemics against the Catholics brought about not only new Bibletranslations, commentaries, sermons, and treatises, but other, practical
574Porr Sadduci prter legem Mosis nullas alias obseruationes custodire uideriuolunt. Iidem fato nihil, libero arbitrio omnia tribuunt. Omnia enim nostr potestatisubijciunt, bonorumque nosipsos authores fatentur. Negant spiritus & angelos, quod &Lucas in Actis apostolicis retulit, & resurrectionem mortuorum (Heinrich Bullinger, InEvangelium secundum Matthaeum, fo. 31v). Porr Sadduci nouum quoddam Iudaicorummonachorum genus, nimirum Iustitiarij ex eo dicti, quod sancte uiuere, non spe praemij,sed amore iustiti uiderentur. Negabant enim resurrectionem mortuorum, negabant &angelos & spiritus: quemadmodum 3. cap. huius operis ex Luca & Iosepho indicaui (fo.198v). Bullinger pointed here to Josephus as a source of information, without specifying theexact place. For information on the Essenes, he noted: De Essenis qui copiosa legere cupit,inueniet apud Plinium lib. Nat. hist.5.cap.17.& apud Iosephum de Antiq.lib.18.cap.2. &de Bello Iudaico 2.cap.7 (fo. 31v). 575Est item Resurrectio eius quod cecidit instauratio sive resuscitatio. Refertur itaqueResurrectio, tam ad immortalitatem animarum quam corporum resuscitationem sive res-titutionem. However, Bullinger noted, dying, falling, and decomposition can only be prop-erly said of the body, for the soul does not decompose, nor does it die or fall unless bythe tumbling and death of sin: Haec enim proprie moriuntur, cadunt & computrescunt:animae non computrescunt, neque cadunt aut moriuntur, nisi lapsu & morte peccati(Bullinger, In Evangelium secundum Matthaeum, fo. 198v). 576Resurgere autem in scripturis accipitur pro eo quod est emergere & non interireaut occidere, sed permanere atque subsistere: ita resurrectio usurpari poterit pro animac spirituum permanentia siue subsistentia vel immortalitate (Bullinger, In Evangeliumsecundum Matthaeum, fo. 198v). 577Locus ille Deuteronomii nihil faciebat ad approbandam vel improbandam mortuo-rum resurrectionem [...] Erant praeterea multa alia prophetarum de resurrectione illustriatestimonia, quae cum Sadducaei non reciperent, bonam scripturae partem ignorabant(Bullinger, In Evangelium secundum Matthaeum, fo. 198v). Cf. Henrich Bullinger, In Euan-gelium secundum Marcum, fo. 31r. On Augustine, see supra on p. 97. On Epiphanius, seesupra on p. 92. On the canon of the Sadducees, see infra on p. 373. post-mortem existence in the early reformation period 235
works and aids, such as thematic collections of biblical texts and biblicaldictionaries. They served as guides and resources for preachers of the newlearning. One such work, which was used by Joye, was compiled by theGerman Reformer and Lutheran theologian Bartholomus Westheimer(1499c.1567), who later was also active as a printer in Basel between 1536and 1547.578 Richard Rex suitably described his publications as biblio-graphical nightmare[s], for every time Westheimer brought out a newedition of a work, he gave it a new title.579 The book Joye used bears thetitle Collectanea Troporvm Commvnivm Bibliorum and is made up of twoparts (tomus).580 The first one (Schematum et troporum Bartholomaei Wes-themeri tomus primus) treats the definition of various rhetorical figuresof speech (e.g. prolepsis, zeugma, anaphora, epanalepsis, homoeoteleu-ton, asyndeton, climax, antipophora, procatalepsis, metanoea, aethiolo-gia, synonymia, paradoxum, eclipsis, litotes, epitasis, analogia, mimesis,ellipsis, etc.) with examples from the Scriptures (and some from ancientclassical literature). The second (Troporum in sacris literis usus) explainsthe usage of a number of words and concepts as tropes in the Sripture,based mainly on excerpts of commentaries and clarifications by otherbiblical scholars. In his first introduction, under the heading Scriptvrae sacrae tractan-dae ratio, in primis consyderanda, Westheimer summarized how one can
578On Westheimer, see: Josef Benzing, Buchdruckerlexikon des 16. Jahrhunderts (DeutschesSprachgebiet), Frankfurt: Vittorio Klostermann, 1952, pp. 2526; Philippe Mieg, BarthelemyWestheimer, Pasteur Mulhouse et Horbourg 14991567, in Annuaire de la Socit historiqueet littraire de Colmar 6 (1956), pp. 4149; Marie-Joseph Bopp, Die evangelischen Geistlichenund Theologe in Elsa und Lothringen von der Reformation bis zur Gegenwart, Neustadt/Aisch:Degener, 1965, no. 5604; Hermann Ehmer, art. WESTHEIMER, Bartholomus, in Biographisch-Bibliographisches Kirchenlexikon, vol. XXI, 2003, cols. 155960. 579Richard Rex (ed.), A Reformation Rhetoric. Thomas Swynnertons The Tropes and Fig-ures of Scripture, (Renaissance Texts from Manuscript 1), Cambridge: RTM Publications,1999, p. 39. 580Bartholomus Westheimer, COLLECTANEA TROPORVM COMMVNIVM Bibliorum,non stimandis sudoribus recognita & locupletata, summa tum diligentia, tum iudicio, exsacrorum Patrum scriptis, excerpta. BARPTHOLOMAEO VESThemero collectore, BASILEAE:APUD Thomam Volfium, M.D. XXXIII. Mense Martio. An earlier version was publishedwith the title: Tropi insigniores Veteris atque Novi Testamenti, summa, Basel, 1527. The Plac-ard of Charles V in 1540 as well as the Indices of forbidden books issued by the Universityof Leuven in 1550 condemned Phrases seu modi loquendi Divinae Scripturae ex sanctis etorthodoxis scriptoribus per eruditissum Barptolomaeum Westhemerum, in studiosorumusum diligenter congestae. This refers to the Antwerp edition by Johannes Grapheus forJohannes Steels, 1536. In 1551 a reworked edition was published under the title: Troporum,schematum, idiomatumque communium liber/ ex omnibus orthodoxis ecclesiae patribus sin-gulari industria tam collectus, quam in ordinem [...] alphabeticum, dispositus [...] Barptole-maeo Westhemero [...] collectore (Basileae: per Ioannem Hervagium, 1551).236 chapter three
581Si qvando literae sacr diidere uidentur, non adferendum est nostri cerebri, autcapitis glossema friuolum, sed per clariorem locum alium, illustrandus uenit obscurior.Consulenda linguarum (quibus primum scripti sunt) proprietas, attendantur prcedentiauna cum sequentibus san collatis, ipse uerborum contextus (Westheimer, CollectaneaTroporvm Commvnivm Bibliorum, fo. 1r). Cf. supra on p. 100. 582Denique pio et timido animo non nostra quidem, sed gloria Dei summi patrisper Christum, in dificationem proximi, omni studio inquirenda summa est: dona dei,eruditio, linguarum peritia, in scripturis exercitatio, qurenda & magnifacienda sunt:nequamque illis uel fidendum uel superbiendum (Westheimer, Collectanea TroporvmCommvnivm Bibliorum, fo. 1r). 583Imo improbus conatus industri, crebis prcibus adiuuandus, donec aperiat nobislibrum septem signaculis obsignatum, is qui habet clauem Dauid. Qui claudit & nemoaperit, arcana patris, qu nemo nouit nisi filius, & cui uoluerit filius reuelare. Cui enimipse mentem intelligendarum scripturarum non donauerit, obsignatus ille liber erit, quic-quid acuminis eruditionis uel periti habuerit, usque adeo sine ipso nihil possumus, necogitare quidem aliquid boni tanquam ex nobis sufficientes. Sed sufficientia nostra ex Deoest per Christum (Westheimer, Collectanea Troporvm Commvnivm Bibliorum, fo. 1rv). 584Troporvm vsvs obseruandus & necessarius (Westheimer, Collectanea Troporvm Com-mvnivm Bibliorum, fos. 1v3r). Cterum ad quid sana Troporum consideratio conferat,August. de doctrina Christiana in hc uerba scriptum reliquit. Troporum cognitio prop-terea Scripturarum ambiguitatibus dissoluendis est necessaria. Quia, cum sensus ad pro-prietatem uerborum, si accipiatur, absurdus est, qurendum est utique, ne forte illo uel illoTropo dictum sit, quod non intelligimus: & sic pleraque inuenta sunt qu latebant, Namlocutiones Tropic, ut idem de Ciuitate Dei adserit, proprijs prophetico more miscenturut ad intellectum spiritualem intentio sobria cum quodam utili & salubri labore perueniat.Pigritia uero carnalis, uel inerudit, uel inexercitat tarditas mentis, ctenta liter super-ficie, nihil putat interius requirendum. Hc ille. Idem de doctrina Christiana scribit: Tico-nius quidam fecit librum, quem Regularum uocauit. Quia in eo quasdam septem regulasexecutus est, quibus quasi clauibus diuinarum scripturarum aperientur occulta. Quarumprimum ponit de Domino, & eius corpore, Secundam, de Domini corpore bipertito. Ter-tiam, de promiis & lege. Quartam, de specie & genere. Quintam, de temporibus. Sextam,de recapitulatione. Septimam, de diabolo, & de eius corpore (fo. 2rv). On Tichonius andAugustine, see supra on p. 100. post-mortem existence in the early reformation period 237
585Quoniam quidem maxima pars itteligenti sita est in Tropis locutionis, prsertimin sacris literis, qu suos habent Idiotismos: Quorum ignorantia grandes nebulas suscitatquandoque in clara luce. Est enim Hebris ante alios mos, creberrimis Tropis uti. Quodlingua eorum, ut angusta, ita densitate Troporum angusta, ut ueluti cogantur lingu par-simonia ad Troporum uim conuerti. Vnde & sacrosancta scriptura Tropis plena est, quibusstudiosos adsuefieri oportet (Westheimer, Collectanea Troporvm Commvnivm Bibliorum,fo. 1v). 586Verum in nullo Scriptur loco admittendus est Tropus, nisi id urgeat circumstantiauerborum euidens, & absurditas rei manifest in aliquiem fidei articulum peccans. Sedubique inhrendum est simplici purque & genuine signifcationi uerborum, quam Gram-matica & usus loquendi docet, habetque (Westheimer, Collectanea Troporvm CommvnivmBibliorum, fos. 1v2r). 587Quod si cuiuis liceat, pro sua libidine, Tropos in Scripturis fingere, quid erit scrip-tura tota, nisi arundouentis agitata, aut uertumnus aliquis? Imo nihil certi neque statueturneque probabitur in ullo articulo fidei, quod non pois aliquo commento Tropo cauillari.Sicque uniuersa sacra scriptura, hac licentia simul & semel inuerteretur. Vitari ergo debetomnis tropus, sicut prsentis simul uenenum, quem non cogit ipsiima sciptur sen-tentia. Porr mysticas intelligentias, quia mirum in modum periculos sunt, magnoperefugiendas suadet syncerior Theologia. Vitanda etiam est Allegoria, ne simplicita te sensusamissa, in mortuis nostris somnijs uagemur, nisi alijs scriptur locis euincatur Allegoria.Id quod sit euidenti circumstantia dictorum, aut aliquo manifesto Scirptur testimonio &authoritate (Westheimer, Collectanea Troporvm Commvnivm Bibliorum, fo. 2r). 588Sed quia, eodem teste, non omnia qu ita scripta sunt, ut non facile intellegan-tur, possunt his regulis inueniri, sed alijs modis pluribus, quos hoc numero septenariousque adeo non est complexus, ut idem ipse multa exponat obscura, in quibus harumregulaurm adhibet nullam: opereprcium erit hisce generalibus & communioribus aliquotmagis speciales, ut ita dicam addere, quibus mediocriter docti non paruum profectumse facturos sciant, maxime ubi trilinguis eruditionis studiosi fuerint. Neque enim satiscuriosi in seruanda uocum synceritate possumus esse. Quod simul atque ill siginifica-tione spiritus detort fuerint, an peregrina etiam sensa prolabamur. Quod autem Hebraomnium prima & communis fuerit, testatur Augusti, de Ciui.dei lib.6.ca.11. Enimuero siAugustino de doctrina Christiana credimus: & Latine quidem lingu homines, duabusalijs ad scripturarum diuinarum cogitationem opus habent Hebra scilicet & Grca, utad exemplaria prcedentia recurratur, si quam dubitationem attulerit Latinorum inter-pretum infinita uarietas. Id quod & Rabanus ille, de Vniuerso scribens, attestatur in hcverba. Propter obscuritatem sanctarum scripturarum, trium linguarum cognitio neces-saria est, ut ad alteram recurratur, si aliquam dubitationem nominis uel interpretationissermo unius ling attulerit (Westheimer, Collectanea Troporvm Commvnivm Bibliorum,238 chapter three
In the second part of the volume, where the various biblical conceptsas tropes are discussed, Westheimer included an article on resurrectionentitled RESVRRECTIO . There, following Zwingli, Westheimer arguedthat the expression resurrection of the dead does not refer exclusivelyto the resurrection of the body at the end of the world, but also to theimmortality of the soul (the life after this life) and the resuscitation ofcorpses.589 The first illustration for this usage is to be found in the denialof the resurrectio by the Sadducees. This means, Westheimer suggested,that they thought that the soul enters into sleep (or dies) when it leavesthe body at death. According to the German theologian, this is evidentfrom Christs answer to the Sadducees, which proved that the patriarchsare alive; hence, resurrectio should be understood as the state of thesouls after death.590 The following example is taken from the Gospel ofJohn. In chapter 6, Jesus promises to those who believe in him that he willraise them on the last day (Jn. 6:3944). Now, last day should be under-stood here, Westheimer maintained, as their last day and not as the Dayof Judgement, and accordingly, Christs promise is that their souls will bepreserved when they die.591 This is corroborated by Christs similar pro-nouncement in the previous chapter, where He promised that those wholisten to His words and believe in Him and in God, who sent Him, will haveeternal life and will not enter into judgement but will pass from deathinto life. This means, Westheimer argued, that even if they undergo bodilydeath, they will not perish but will enter into immortal life.592 Similarly,
fos. 2v3r). Westheimer is quoting Rabanus Maurus Magnentius (also known as Rhabanusor Hrabanus; c.780856), Frankish Benedictine theologian and later archbishop of Mainz:Rabanus, De universo libri XXII, XVI,1. 589RESVRRECTIO MOTRVOrum Hebris non solum ultimam illam corporum resus-citationem, sed etiam uitam ac subsistentiam anim immortalem, post hanc uitam signi-ficat, etiam antequam corpus reuiuiscat (Westheimer, Collectanea Troporvm CommvnivmBibliorum, fo. 313v). Cf. supra p. 204. 590Saduci negabant resurrectionem, hoc est, putabant animas post egreionem corporibus dormire (nam non uidetur uerisimile tam crassam sectam fuisse inter Iudos,qu aut immortalitam anim negaret, aut animas cum corporibus dormire uel interireassereret) quo in loco ut ex responsione Christi, qui Saducis animas Abrah, Isaac &Iacob uiuere probat, colligitur, resurrectio, pro eo statu uit capitur, quo anima post mor-tem corporis uiuit (Westheimer, Collectanea Troporvm Commvnivm Bibliorum, fo. 313v). 591Item Ioannis. 6. Resuscitabo eum in nouiimo die, inquit Christus, ubi, per nouii-mum diem non illum ultimum intellegit, sed diem mortis cuiusque, ut sit sensus, resus-citabo eum, id est, in uita seruabo eum, dum moritur (Westheimer, Collectanea TroporvmCommvnivm Bibliorum, fo. 313v). 592Ioan.5.Christus dicit: Amen amen dico uobis, quod qui uerbum meum audit, &credit ei qui misit me, habet vitam ternam, & in iudicium non ueniet, sed transit mortein uitam. Hoc est, dum corporaliter moritur in nullam mortem aut perditionem uadit, sed post-mortem existence in the early reformation period 239
in Jn. 11:24, where Christ calls Himself Resurrectio and Vita, Resurrectio,Westheimer asserted, should be taken for life, as Vita stands in apposi-tion to Resurrectio.593 Also, in Heb. 11, where Paul writes that the OTmartyrs rejected deliverance in order to obtain a better resurrectio, hereally means that the martyrs could easily despise this life because theywere to enter into a better life.594 According to the Lutheran exegete, Pauluses the term here in the same sense as it is applied in Jn. 5:29: they willrise to the resurrection of life, that is, they live forever.595 Furthermore,in 1 Thes. 4, where Paul denounced the exaggerated grief of the Thessa-lonians over their dead, he spoke not only about the resurrection of thebody at the end of the world, but also about the immortality of the soul,Westheimer believed. For Pauls logic can be paraphrased as follows: ifthe soul died together with the body, then the Thessalonian Christianswould not grieve without reason, but since we are certain that those whopassed away from this world not only left all troubles upon their deathbut also gained perennial life, it is unwise and clearly unchristian to grieveso much about the dead, as if they had perished.596 To explain why theGospel was preached to those who are dead, Westheimer quoted 1 Pt. 4:6:so that even though the dead will be judged in the flesh as humans, theymay live in the spirit according to the will of God as souls in the bosomof Abraham. The dead will be judged just like any other human beingat the resurrection of the flesh, but in the meantime they live according
a novelty, Brunfels pointed out, because the book was not a commentarybut a consistent application of the Protestant principle of sola scriptura byvirtue of presenting the pure text of Scripture without any notes.607 Theapostles did not have commentaries, Brunfels argued, and the sole reasonthe Jews do not believe in Jesus is that they depend on the rabbinical com-mentaries while neglecting to consult the pure word of the Scriptures.608That his own contemporaries were thrown into such a dense darkness ofignorance is explained by their perpetually relying on the works of schol-ars instead of scrutinizing Scripture itself.609 Therefore, Brunfels asserted,most commentaries are wrong.610 The tenth chapter is a gathering of texts relating to the Four Last Things(death, judgement, Heaven, and Hell) and other issues of the afterlife.611The first title is De resurrectione, where the following texts are adduced:Job 19:25; Is. 26:19; Ez. 37:114; Zeph. 3:78; Mt. 22:3132 and 25:31; Lk. 14:1314; Jn. 5:21.25; Rom. 6:8; 1Cor. 15; Phil. 3:2021; Col. 3:4; 1Thes. 4:14; Acts23:6 and 24:15; and Rev. 20:6.612 This list is followed by the references tothose who denied the resurrection: Mt. 22:23; 1Cor. 15:12; 2Tim. 2:1718;and Acts 23:8.613 It should be pointed out that some of the passages inthis list do not contain the term resurrection or any cognate of it at all
mentioned the attack by Beda (see supra in n. 202 on p. 162), whom he called a stupidtheologian without any erudition: Quanquam mouit quoque nonnihil & hoc, quod uide-bam quendam Beda, thologum [sic] insultare tibi, hominem tam sine omni eruditione,ut deplorandus mihi potius uideatur quam incessendus, cuius stultis atque ineptis com-mentis, in hoc quoque uolumine, sine ullis quidem ambagibus: uerum supplicibus tantumscripturis respondebitur: ut nisis prorsus animam non habeat, ipse possit agnoscere uic-tum se (sig. Bb7r). 607Si quidem quod hactenus multis Commentarijs actum est ab eruditis uiris, ut nego-tium euangelij confirmaretur, id nos sine ullis prorsus commentis, scripturis solis praestiti-mus (Brunfels, Pandectarum Veteris et Noui Testamenti, sig. Bb6v). 608Apostolos nihil commentarium habuisse. Iudos nulla alia ratione Christo diffi-dere, quam quod Rabinorum commentis abducti, scripturas non conferunt, neque meti-untur (Brunfels, Pandectarum Veteris et Noui Testamenti, sig. Bb6v). 609Nos prter ea nulla alia caussa [sic] in tam densissimas tenebras prcipitatos,quam quod perpetuo scribarum commentarijs nixi, rem potius ipsi scrutati non sumus(Brunfels, Pandectarum Veteris et Noui Testamenti, sig. Bb6v). 610Et ut dicam libere quod sentio [...] nephas est commentari. Non quod omnesquidem damnem commentarios, sed quod cuperem esse pauciores, & id sciam, ubi plu-rimum accesserit sensus humani, illic quoque uanitatis plurimum intercidere (Brunfels,Pandectarum Veteris et Noui Testamenti, sig. Bb6v). 611 Liber Decimus. De quatuor nouissimis, Angelis, & animae immortalitate. (Brunfels,Pandectarum Veteris et Noui Testamenti, pp. 27996.) 612Brunfels, Pandectarum Veteris et Noui Testamenti, pp. 27980. 613Quaedam negant resurrectionem. (Brunfels, Pandectarum Veteris et Noui Testamenti,p. 280.) post-mortem existence in the early reformation period 243
but speak about a (future) life (e.g. Jn. 5:25) and that some of them can-not refer logically to the general resurrection of the flesh at the end of theworld (e.g. 2Tim. 2:1718). At the end of the chapter Brunfels included a heading on the immor-tality of the soul (Septimo. De Anim immortalitate).614 Contrary to hisgeneral practice, here Brunfels judged it necessary to introduce the textsadduced under this heading with a few words that carry a clear anti-Jewish message. With the marginal note Error Iudaicus, Brunfels wrotethat the immortality of soul can be proved by many texts of the Scrip-ture, yet the Jews tell tales that these promises of God are only tempo-ral, relating to this earthly life. But they talk nonsense, Brunfels added,because they err, not knowing the Scripture.615 Interestingly, in his rebut-tal of the Jews questioning the immortality of the soul Brunfels alludedto Christs words to the Sadducees about the question of resurrection(Mt. 22:29 et par). After his anti-Jewish remark, the Lutheran writer listedthe following proof texts in favour of the immortality of the soul: Gen.37:35; Num. 16:30; 1Sam. 28:325 (with the remark that if Saul had notbelieved in the resurrection and immortality, he would not have caredto resuscitate Samuel);616 2Sam. 2:13; and 1Kgs. 17:1724 (with the remarkthat the resuscitated son of the widow must have been alive prior to theresuscitation, even if his flesh was dead).617 The next proof is a generalremark on the parlance of the OT: when the people passed away from
614Brunfels, Pandectarum Veteris et Noui Testamenti, pp. 29596. Other headings are:Secundo de morte. Mors omnib. incumbit. & horror illius (280), Mors non timenda hominiChristiano, sed viriliter subeunda pro nomine Christi (282), Non libenter quidam ex patribusmortui sunt (283), Etiam mali optant mori morte iustorum (283), Mors peccatorum & tyran-norum pessima, & horribilis semper fuit (283), Tertio, de iudicio domini, seu aduentu Christiad iudicium. Aduentus domini ad iudicium certus (286), Dies Aduentus domini in iudiciumincertus (289), Licet incertus sit iudicij dies, tamen semper expectandus (289), Christo datumest iudicium facere (290), Quarto, De vita beata. De gaudio flicitatis tern (290), Quinto,de diabolo. Lucifer de clo prcipitatus (292), Diabolus non cessat die ac nocte infidiari nobisqurens quem deuoret (292), Diabolus non habet potestatem in quenquam, nisi Deus per-mittat (293), Diabolus mendax (293), Sexto, De Spiritibus & Angelis bonis ac malis. Spiritusquidam mali sunt (293), Angeli boni assistunt hominibus, & custodiunt eos (294), Angeli suntnuncij dei & executores mandatorum eius (295). 615Anim immortalitas ex multis scripturis probari potest, tametsi fabulentur Iudi,omnes promissiones temporales esse, & huius uit, nihilque adeo meminisse deum depromissione uit futur. Id autem nugantur, quia errant, nescientes scripturas (Brunfels,Pandectarum Veteris et Noui Testamenti, p. 295). 616Saul nisi credidisset resurrectionem & immortalitatem, non curasset suscitariSamuelem (Brunfels, Pandectarum Veteris et Noui Testamenti, p. 295). 617Viuebat igitur, etiam carne mortuus (Brunfels, Pandectarum Veteris et Noui Testa-menti, p. 295).244 chapter three
this world, Scripture says that they slept (with their fathers); but if theysleep, Brunfels argues, then they are going to be raised and are not dead(cf. 1Kgs. 1:21; 2:10; and 11:21).618 The list of proof texts continues: Tob. 2:18;Eccl. 12:7; Wis. 5:1415; Is. 14:441 (with the remark that the Babylonianking was surely defeated in the netherworld);619 2Macc. 6:26; 7; and 14:46;and Mt. 10:28. The following proof text is Jesus debate with the Sadduceesin Matthew, listed with the remark that the Sadducees denied resurrec-tion and immortality.620 Also, the parables of the wicked steward (Lk.16:18) and Lazarus and the rich man (Lk. 16:1931) prove the immortalityof the soul, Brunfels stated.621 The last four proofs are Rom. 7:24; 2Cor. 5:1;Phil. 1:23; and Acts 7:59. Although resurrection and immortality of the soul are seemingly twodistinct concepts for Brunfels, it is not difficult to understand how anyonewho had read Zwingli, Melanchthon, and Westheimer would discover inBrunfels collection of proof texts and remarks a confirmation of the ideathat the Hebrew and Greek original of the Latin term resurrectio couldrefer to the immortality of the soul.
At the end of the year 1527, just around the time when Joye probablyarrived there, a tract of forty-eight unnumbered leaves was published inthe city of Strasbourg.622 The book, which became known as A Brefe Dialoge
618Patres cum migrauerunt de incolatu huius seculi, testatur scriptura de eis. Et dor-miuit ille, uel cum patribus suis.&c. Si dormiunt, ergo resurrecturi, non mortui (Brunfels,Pandectarum Veteris et Noui Testamenti, p. 295). 619In Esaia propheta cap. 14. describitur detrusio Nabuchodonozar ad inferos, ubicerte uicturus erat (Brunfels, Pandectarum Veteris et Noui Testamenti, p. 296). 620Saduci cum negarent resurrectionem & immortalitatem anim, respondit eisDominus. Non legistis quid scriptum sit?, Ego sum Deus Abraam, Isaac, & Deus Iacob.Non est Deus mortuorum, sed uiuentium.{Exod 3[,6]} (Brunfels, Pandectarum Veteris etNoui Testamenti, p. 296). 621Parabol Domini de Lazaro & diuite, de uillico iniquitatis, indicant animae immor-talitatem (Brunfels, Pandectarum Veteris et Noui Testamenti, p. 296). 622William Roye, A Lytle treatous or dialoge very necessary for all christen men to learneand to knowe, Argentine: Johann Schott, 1527. The work received its common name fromthe heading on B1r: A Brefe Dialoge bitwene a Christen Father and his stobborne Sone/ whomhe wolde fayne brynge to the right vnder stondynge of a christen mans lyvynge. Critical edi-tion: William Roye, A Brefe Dialoge bitwene a Christen Father and his stobborne Sonne: TheFirst Protestant Catechism Published in English by William Roye, eds. Douglas H. Parker &Bruce Krajewski, Toronto: UP, 1999. [Hereafter PK, A Brefe Dialoge]. On Joyes presencein Strasbourg, see supra on p. 19. post-mortem existence in the early reformation period 245
bitwene a Christen Father and his stobborne Sonne, was an English adap-tation of Wolfgang Capitos (14781541) De pueris instituendis, whichappeared earlier in the same year in the same city.623 The adaptation wasthe work of the English Protestant Reformer William Roye, an apostateFranciscan Observant of the Greenwich house. Roye was born in Calaisand was of Jewish descent.624 He was a former collaborator of Tyndalewho had helped Tyndale in Cologne and in Worms with the publication ofhis NT.625 The tract was the first Protestant catechism ever to be publishedin English, providing a popular understanding of the New Learning in thevernacular, and only the fourth known Protestant publication in English.626Even if the claim on the jacket of the critical editionthat the BrefeDialogue electrified the spiritual imagination of English-speaking reform-minded believers as intensely as Tyndales 1526 English New Testamentis probably overstated, the book certainly formed a practical corollary toTyndales Lutheran translation of the NT in propagating the cause of theReformation.627 Roye started his preface To the Right nobles Estates/ and
to all wother of the toune of Cales with an advertisement for the Worms NTand recommended it be read, despite its suppression by soche cruell/ andinfame dogges.628 He also urged the reader to read his own catechism,not only once but ten times, hoping that both yonge and olde wouldlearn what greate vniversites/ and notable Rabys knowe nott, i.e. theGospel (understood in a Lutheran sense).629 The book is construed in the form of a dialogue between the Protestantfather and his interested but stubborn son.630 Over the course of theirdialogue the father introduces the son to the Lutheran doctrine of justifi-cation by faith, explains the Creed and the two sacraments (baptism anda spiritualized Eucharist in symbolic terms), advises his son on how tomeditate on the Ten Commandments and how to pray the Lords Prayer(again a spiritualistic interpretation), and offers practical tips on how tolive a good Christian life. The book is seasoned with railings against pil-grimages, auricular confession, and the veneration of saints. Expounding upon the articles of the Creed about Christs death, burial,descent into Hell, and resurrection, the father explains that Christ died thesame death as every other human, and that with Him Christians will alsodie and be buried, which can only be achieved if we forsake all flesshelyworkes/ and soffre god only to worke in vs.631 This, the true sanctifica-tion of the Sabbath, cannot be realized in the flesh, but only after death.632Christ descended into Hell in order that all his therby shuld be deliveredboth from death and also hell.633 To answer the sons question of in what
cause. Yet he recognizes that the most famous member of the outer circle of early EnglishProtestant writers, and the one whose ability is most difficult to assess, was William Royor Roye (Clebsch, Englands Earliest Protestants, p. 229). 628It is not vnknowne to you all my lordes/ and masters/ and all wother my singulergode frendes and brethren in Christ/ howe that this last yere/ the newe testament of ouresaveour/ was delyvered vnto you/ through the faythfull and diligent stody/ of one of ourenacion/ a man no doute/ ther vnto electe and chosen of God/ named William Hitchyns/vnto whome I was (after the grace geven me of the lorde) as healpe felowe/ and partetaker of his laboures/ that every christen man/ myght therby heare and vnderstonde/ athome/ and in his owne housse/ the sprete of God speakynge therin/ and thorowe his holyapostels (Roye, A Lytle treatous or dialoge, sig. A1v; PK, A Brefe Dialoge, p. 99). 629Roye, A Lytle treatous or dialoge, sig. A3r; PK, A Brefe Dialoge, p. 100. For good thyn-ges ten tymes redde agayne please (Roye, A Lytle treatous or dialoge, sig. A3v; PK, A BrefeDialoge, p. 101). 630In Capitos original work the roles are just the other way. The Father poses ques-tions of the catechism, and the son answers them according to his Protestant faith. 631Roye, A Lytle treatous or dialoge, sig. C6r; PK, A Brefe Dialoge, p. 120. 632For this is the halowynge of the Saboth daye which fyrst after this lyfe shalbe ful-fild (Roye, A Lytle treatous or dialoge, sig. C6r; PK, A Brefe Dialoge, p. 120). 633Roye, A Lytle treatous or dialoge, sig. C6r; PK, A Brefe Dialoge, p. 120. post-mortem existence in the early reformation period 247
sense Christians can be called free from death, when Scripture also affirmsthat all persons have to die, the father replies by denying the mortality ofthe soul and claims that the souls enter heavenly bliss instantaneouslyupon death, despite the fact that they slepe in the lorde and rest untiltheir resurrection.634 Royes words are undoubtedly made in referenceto the doctrine of soul sleep as opposed to the immortality of the soul.Admittedly, Royes words are somewhat misleading at a casual reading(cf. his terminology slepe and rest), yet it is clear that Roye thoughtof the souls situation between death and resurrection as an active life,the beginning of the perpetual blissful life.635 At the end of the world, allpeople will be judged and will be admitted to life eternall or to perpetu-all fyre of hell according to Gods predestination.636 It should be noted that Roye, not unlike Joye, was only a year laterto suffer Tyndales ingratitude and carping. While Roye regarded Tyndaleas the electe and chosen of God, Tyndale depicted Roye as dishonestand reckless. In the preface to The parable of the wicked mammon, Tyn-dale characterized Roye as a man somewhat craftye when he comethvnto new accoyntaunce and before he be thorow knowen and namelywhen all is spent.637 Tyndales remark that he could control his helper
634Though christen menne slepe in the lorde. yett dye they not/ for the souledepartynge out of this wretched body entreth immediatly into grett ioye and rest/ forremaynynge vntill that oure lorde shall a wake it agayne (Roye, A Lytle treatous or dialoge,sig. C6r; PK, A Brefe Dialoge, p. 120). 635Christ is oure lyfe in whom yf we dwell withouten dout through mercy obtaynedyn hyme/ we shall perpetually live/ and with hym arise agayne (Roye, A Lytle treatous ordialoge, sig. C6rv; PK, A Brefe Dialoge, p. 120). The commentators of the critical editionhave the following baffling remark: A reference to the doctrine of soul-sleep as opposed toresurrection. [sic] The controversy over this issue arose between the reformers themselves,the most serious in England being between William Tyndale and George Joye. [...] Theview represented in lines 713716 [quoted here in this note and in n. 1185] would seem tosupport the soul-sleep doctrine, endorsed by both Zwingli and Joye (PK, A Brefe Dialoge,pp. 20001). The Latin original by Capito had the following dialogue: P. Qui vero credisCarnis resurrectionem? F. Qui in domino hinc demigrant, in fide, hoc est, sinu Abrahaequiescunt, redemptionem corporis eorum expectantes, donec appetat iudicii dies, Rom.8.Tum gloria Dei, tam diu et tantopere desyderata, revelabitur in nobis, creaturae a servi-tute corruptionis liberabuntur. Mali iuxta ac boni resurgent in carne, mortaleque, si innobis reliquum est, a vita absorbebitur. The following question is about eternal life. Inhis answer the son affirms that translati vero in aliam vitam, liberi erimus et a peccatoet morte, victuri semper in Deo. Contra impii, ubi vitae huius umbra evanuerit, in ipsammortem transferentur (PK, A Brefe Dialoge, p. 282). 636Roye, A Lytle treatous or dialoge, sig. C7v; PK, A Brefe Dialoge, p. 122. 637Tyndale, The parable of the wicked mammon, sig. A2r.248 chapter three
only as long as Roye was penniless is interesting for two reasons.638 (1) Itbetrays Tyndales feeling of superiority: apparently Tyndale did not treathis co-worker as equal to him but thought that it was his business to ruleRoye.639 (2) Tyndales remark also reveals his interest in financial matters.Tyndale also intimated that as soon as he could get rid of Roye, Tyndaledismissed him with the hope of never seeing him again.640 And speak-ing about a rhyming lampoon on Cardinal Wolsey, the Church, and theEucharist authored by Roye and Jerome Barlowe that was published in thesame year, Tyndale announced that Roye whose tonge is able not only tomake foles sterke madde/ but also to disceave the wisest that is at the fyrstsight and accoyntaunce [...] set him [i.e. Barlowe] a werke to make rimes/while he him selfe translated a dialoge out of laten in to englisch.641 It is evident that Tyndale recalled the association with bitterness andcalumny.642 Clebsch accurately observed that Tyndale took the samestance of injured superiority that he later assumed toward Joye becauseTyndale had the impression that Roye had both tricked Barlowe andbetrayed Tyndale.643 Since Tyndale knew that the English authorities,on the basis of reports from Cochlaeus and Rinck, identified Roye as oneof two Englishmen who printed the NT in Cologne and Worms, Tyndalefeared that Royes activities would bring him into discredit through guilt
638As longe as he had money/ somewhat I could ruele him. but as sone as he hadgoten him money/ he became lyke him self agayne (Tyndale, The parable of the wickedmammon, sig. A2rv). 639Cf. also Tyndales supercilious remark: And when he had stored him of moneyhe gote him to Argentine where professeth wonderfull faculties and maketh bost of nosmall thinges (Tyndale, The parable of the wicked mammon, sig. A2r). This condescend-ing attitude cannot be explained by Tyndales alleged superior linguistic abilities. Royescommand of languages is attested to by a letter from two former confreres of Roye dated12 June 1529, who refer to Roye as sometime the familiar of our convent at Richmondwho does speak all manner of languages (cited in CWTM VIII/3, p. 1159). Roye, when heemphasized the importance of the knowledge of the three biblical languages, seems clearlyto have spoken from experience: Thou mayst in maner with one laboure learne as mochegreke and hebrewe with thy laten/ as shall suffyse. For one tonge healpeth/ and garnessethanother. Insomoche that by theym a manne sone maye come to the trewe meanynge andintent off the authoure. and obtayne a profownde iudgement in all thynges (Roye, A Lytletreatous or dialoge, G3v; PK, A Brefe Dialoge, p. 158). 640Never the lesse I suffered all thinges till yt was ended which I coulde nor doo alonewithout one both to write & to helpe me to compare ye textes to gether. When that wasended I toke me leve and bode him farewell for oure two lyves/ and as men saye a dayelonger (Tyndale, The parable of the wicked mammon, sig. A2v). 641Tyndale, The parable of the wicked mammon, sig. A3r. 642Clebsch, Englands Earliest Protestants, p. 230. 643Clebsch, Englands Earliest Protestants, p. 230. post-mortem existence in the early reformation period 249
644Cf. Clebsch, Englands Earliest Protestants, p. 231. Cochlaeus later recounted thestory of the abortive printing of Tyndales NT in Cologne in his Commentaria de Actis etscriptis Martini Lutheri (St-Victor near Mainz: Francis Behem, September 1549). Cochlaeusonly mentioned two English apostates who had been in Wittenberg (Duo Angli Apostat,qui aliquandiu fueant Vuittenberg) and who wanted to print and hide the copies of aLutheran NT in English among other merchandise and to smuggle them secretly into Eng-land (occulte sub alijs mercibus deueherent inde in Angliam) (pp. 13235. For a more detailedaccount, see: Juhsz, Cat. 93, pp. 14951). Cochlaeus two earlier (shorter) reports of thesame story are similarly vague (Cochlaeus, An expediat laicis, legere Noui Testamenti libroslingua vernacula?, Dresden, vi. Idus Junij [=10 June] 1533, sig. A6, and Cochlaeus, Scopa [...]in araneas Richardi Morysini Angli, Lipsi, March 1538, sig. B2). In a letter by HermannRinck, a senator of Cologne, whom Cochlaeus had approached to take measures againstthe plans of the two Englishmen, the names of Tyndale and Roye are mentioned in con-nection with the Worms NT. The letter is dated 4 October 1528 and is written to Wolsey,who apparently had asked Rinck to buy up everywhere books printed in English and toarrest Tyndale and Roye (Liter grati vestra ad me [...] de commercandis undique librisAnglica lingua excussis, et de capiendis Roy et Huckynck). Rinck wrote that they had notbeen seen in Frankfurt since Easter and the market after Lent (April 1528), and that he didnot even know if they were still alive, but he would do everything in his power to arrestthem (Insuper et summa opera curabo in prdictis Roy et Huckyng cterisque regigrati et vestr mulis et rebeltionibus, tum capiendis, tum ubi locorum agant, percipi-endo). He also reported that he questioned Johannes Schott (the publisher of Roye), andSchott had no knowledge of their whereabouts but had told Rinck that their books werepawned to the Jews of Frankfurt. Rinck reported that he had seized all of the books, but henot only had to pay the pawning costs to the Jews but also had to provide remunerationfor the paper and the work of the printer. He also intimated that if he had not discoveredthem and interfered, the books would have been shipped to England and Scotland, hiddenin paper covers and packed in ten bundles covered with linen so that they would not incitesuspicion, under the guise that they were destined to be sold as blank paper. Rinck wasconfident that none or only very few books were sold that way. (Debeant autem libri ipsi,(nisi percepissem et intervenissem) in thecas chartaceas compingi et occultari et deceminclusas sarcinis, lino obductis, callide et sine omni suspicione, per mare, tempore trans-mitti in Schotiam et Angliam, ut ibidem ac sola et nuda papirus venderetur, sed admodumpaucos aut nullos transvectos vel venditos puto.). Rincks letter was published in: Arber,The First Printed English New Testament, pp. 3236. On the Cologne printing, see: GuidoLatr, William Tyndale: Reformer of a Culture, Preserver of a Language, Translator for thePloughboy, and Cat. 92 in TT, pp. 1123 and 14849. See also supra on p. 14. 645Tyndale, The parable of the wicked mammon, sig. A3v. 646Jerome Barlowe & William Roye, A proper dyaloge/ betwene a Gentillman and ahusbandman/ eche complaynynge to other their miserable calamite/ through the ambicionof the clergye, Marburg: Hans Luft [vere Antwerp: Merten de Keyser], 1529; William Roye250 chapter three
been ascribed with much probability to the joint efforts of Jerome Barloweand William Roye, and the second to Roye alone.647 If these ascriptionsare correct, then Roye and Barlowe were issuing their tracts at the samepress Tyndale was using at the same time.648 This, according to Clebsch,could suggest that Tyndales temper may have cooled somewhat since hehad vowed lifelong separation from Roy in 1528.649 In early 1529, a little over a year after Royes Brefe Dialoge, an anon-ymous pamphlet called Supplicacyon for the Beggers appeared fromthe press of the Antwerp printer Johannes Grapheus (fl. 152069). Thebooklet amounted to only a few pages, but its importance can hardly beunderestimated.650 And although its author intended to write a (mainly)political tract, the book gained its importance due to a couple of linesbearing doctrinal importance on the Catholic teaching on Purgatory.The author was a certain Simon Fish, an Oxford graduate and amateuractor who went to London around 1525 and entered Grays Inn, where hebecame one of the most important dealers of Tyndales NTs.651 He wasdenounced as a heretic, fled to the Continent in 1527, and died in theplague of 1531.652 In his satire of the Church and religious practice of hisage, Fish called upon the King Ovre souereygne lorde to take measuresagainst the unruly members of the Church, the minions of Satan. Fishmost lamentably compleyneth that the wofull mysery of lepres, andother sore people, nedy, impotent, blinde, lame, and sike did not receivethe generous almesse given by all the weldisposed people of Henrysrealm because of the Bisshops, Abbottes, Priours, Deacons, Archedea-cons, Suffraganes, Prestes, Monkes, Chanons, Freres, Pardoners and Som-ners, who haue gotten ynto theyre hondes more then the therd part of
all youre Realme and steal the money from the poor by probates of tes-tamentes, priuy tithes, and by mennes offeringes to theyre pilgremages,and at theyre first masses.653 Therefore, Fish claimed, the wealth andlegal autonomy of the Church were the cause of much social tensionand moral corruption. The greediness of the Church is the cause of thepoverty of the people, and consequently of all of the difficulties to levytaxes, fiftenes and subsidies by the King, which Henry most tenderly ofgreat compassion hath taken emong your people to defend theim fromthe thretened ruine of theire comon welth.654 Accordingly, Fish appealedto the monarch to make them obedient by subordinating the hierarchyof the Church (this vnkind idell sort) to himself.655 One of the tricksof the clergy to extract the money from the people was the Catholicteaching on Purgatory, Fish asserted, which maintained that only by theprayers of the clergy and by the pardon of the Pope can souls be freedfrom Purgatory.656 Yet Purgatory had been questioned by knowledgeablepersons who had risked their reputation by claiming that the Catholicteaching had no scriptural basis and was invented as a false device by theChurch to rob the commonwealth.657 If Purgatory existed, Fish argued,and if the Pope had the power to liberate the souls from Purgatory, thenthe Pope is a cruel tyrant because he could liberate everyone from thereout of charity, but he only liberates those who pay for it.658
The third pamphlet that receives our attention in this section was writ-ten by someone who probably had no intention of achieving any fameduring his lifetime, let alone after his death. Yet it was his testament thatmade William Tracy famous.659 Tracy, a Gloucestershire man like Tyn-dale, died shortly after his testament (dated 10 October 1530) was drawnup. Two years later, however, his body was exhumed by Thomas Parker,vicar general of the bishop of Worcester, and burned as that of a heretic.660All this was done on account of the fact that in his testament Tracy for-bade payments for masses for his soul, supported by his belief that faithin Christ is the sole means of justification.661 Tracys testament also con-tained his confession of his faith in the remission of his sins by Christsmerits through His death and resurrection, and expressed his hope in theresurrection, founded on Job 19:2527.662 Tracy used the peculiar formula-tion resurrection of bodye and soule, which, seen in the light of Luthersdoctrine of soul sleep, caused problems to the effect that Tracy wouldhave believed in the mortality of the soul, but this cannot be established
659On Tracys testament see: John Craig & Caroline Litzenberger, Wills as ReligiousPropaganda. The Testament of William Tracy, in JEH 44 (1993), pp. 41531; Caroline Litzen-berger, Official Religious Policy in Gloucestershire (15411580), Cambridge Ph.D. thesis, 1993;John T. Day, William Tracys Posthumous Legal Problems, in John A.R. Dick & Anne Rich-ardson (eds.), William Tyndale and the Law, (Sixteenth-Century Essays & Studies 25),Kirksville: SCJ Press, 1994, pp. 10313. 660Tracys son, Richard Tracy, sued Parker for the exhumation and disgrace of the bodyof his father, and the vicar general was fined 300 (Clebsch, Englands Earliest Protestants,p. 107). Tracys will was found among Tyndales belongings at the time of his arrest. Theexhumation of Tracys body in 1532 would became the subject of one of Tyndales posthu-mously published works. 661And as towching the wealth of my sowle/ ye fayth yt I haue and rehersed/ is suffi-cient (as I suppose) with out any other mannis worke/ or workes/ My gronnde & my belefeis/ that ther is but one god & one mediatour betwene god & man/ whiche is Jesus christ. Sothat I do except none in heauen nor in earth to be my mediatoure betwene me and god/but onely Jesus Christ/ al other be but petitioners in receyuing of grace/ but none able togeue influence of grace. And therfore wil I bestowe no part of my goodes for that intentthat any man shulde saye/ or do/ to healp my soule for therin I trust onely to the promyseof god/ he that beleueth and is baptyzed shalbe saued/ and he that beleueth not shalbedamned/ marcke the last chapter (William Tracy, The Testament of master Wylliam Tracieesquier/ expounded both by William Tindall and Ihon Frith. Wherin thou shalt perceyue withwhat charitie ye chaunceler of worcetter Burned and made asshes of hit after hit was buried,1535 [vere Antwerp: Merten de Keyser, 1536], sig. A3rv). 662First/ and before all other thinge, I commyt me vnto God/ and to his mercye/ trust-inge with owt any dowte or mistrust/ that by his grace and the merytes of Jesus Christ/ andby the vertue of his passion/ and of his resurrection, I haue and shall haue remission of mysynnes/ and resurrection of bodye and soule/ accordinge as hit is written Job. xix. I beleuethat my redeamer lyueth/ and that in the last day I shall ryse owte of the erth/ and in myflesh shal see my sauiour/ this my hope is layde vp in my bosome (Tracy, The Testamentof master Wylliam Tracie, sig. A3r). post-mortem existence in the early reformation period 253
It was only three and a half years after the appearance of Luther that theEnglish Church took open steps to repudiate the teachings of the GermanReformer.665 The first such public performance was a sermon to refuteLuther, delivered at St Pauls Cross on 12 May 1512 by John Fisher, bishopof Rochester (150435) and former Chancellor of the University of Cam-bridge (150414).666 In his sermon the bishop focused on the operation
of the Holy Spirit in the world through the Church, especially throughthe successor of Peter; but the principal subjects of Luther (the supremeauthority of Scripture and justification by faith) were treated only as top-ics of minor importance.667 King Henry VIII joined the polemics withhis Assertio Septem Sacramentorum, confirming papal authority and thevalidity of indulgences.668 Fishers voluminous Assertionis Lutheranae Confutatio came out inAntwerp in 1523.669 He reacted to Luthers rejection of the Popes author-ity to grant indulgences systematically and refuted all forty-one articlesof Luthers Assertio.670 The bishops book contained numerous mentionsof Purgatory in various articles (4, 17, and 18 on indulgences, and 3740addressing the question of Purgatory itself). Although Fisher recognizedthat the teaching on Purgatory was not accepted by the Eastern Churchand that the early Church Fathers do not mention it frequently, heinsisted that the existence of Purgatory cannot be called into question.671The silence of the early Church on Purgatory is explained by the fervourof the Church Fathers to do penance for their sins during their earthlylife, and only when the fear of the pains of Purgatory diminished did the
not what he saith (Tyndale, The obedie[n]ce of a Christen man, sig. I1r). According to Hatt,these impassioned, if unspecific, accusations [...], the often disingenuous objectionsto the bishops terminology or his quotations and the rather inept facetiousness are ofmore psychological than theological value (Hatt, English Works of John Fisher, p. 55). OnFishers life and theology, see also: Edward Surtz, The Works and Days of John Fisher. AnIntroduction to the Position of St. John Fisher (14691535), Bishop of Rochester, in The EnglishRenaissance and the Reformation, Cambridge (MA): Harvard UP, 1967; Richard Rex, TheTheology of John Fisher, Cambridge: UP, 1991. 667Cf. Hatt, Engli
|
https://pt.scribd.com/document/363130203/SHCT-165-Juhasz-Translating-Resurrection-2014-pdf
|
CC-MAIN-2022-05
|
refinedweb
| 78,143
| 54.32
|
Linux route different networks to local host
I want to build a Gateway with three Network Interfaces on a Linux board. I want to use eth0 wlan0 and usb0.
Connman manage eth0 and wifi, only one is active eth0 is preferred. So only one of the Connection is used. usb0 is not managed by connman, the Interface is en/disabled via an external Trigger. My Problem is, on the board runs a flask webserver, which should be reachable over all Interfaces.
usb0 provides a dhcp Server for the connected Client, eth0 and wlan0 are configured as dhcp Client. I want to reach the webserver on following ways:
- usb0 with the 192.168.2.1 (dhcp Server range 192.168.2.10 to 192.168.2.20) - eth0 and wlan0 via the dhcp client address on each interface.?
- Passing input data into a lazy-loaded Angular module
I have a component called
NewsComponentwhich is shared within my app. I would like to expand it into a
NewsModuleand add a routing system to display individual articles, so that my routes would look like
/some-component /some-component/news /some-component/news/article/12345 /other-component /other-component/news /other-component/news/article/23456
To make its routes relative, I am lazy-loading the module:
const routes: Route = [ { path: 'some-component', component: SomeComponent }, { path: 'some-component/news', component: SomeNewsWrapperComponent, children: [ { path: '', loadChildren: './news/module#NewsModule' } ] } // same for /other-component ]
The problem is that
NewsComponentdisplays visuals based on some input data, and I used to pass it via
@Input. But now that the component is encapsulated within its lazy-loaded module, this is no longer possible.
I could create a
NewsServicewithin a third module imported both
NewsModuleand
AppModuleand pass data that way, but I feel that this is a breach of modularity and would like to avoid it. Is there a better solution for one-directional data flow into the module?
- Angular 7: 'Cannot find name ' '
I am working on a personal portfolio webiste in Angular 7 and am having problems when getting the routing to work. The site opens but displays nothing on the page. If I comment out my paths the site loads properly. I cannot find any resources that solve this problem.
//This is what I receive on my command line when I run ng serve.
「wdm」: Compiled successfully. ERROR in src/app/app.module.ts(20,31): error TS2304: Cannot find name 'Contact'. src/app/app.module.ts(21,33): error TS2304: Cannot find name 'Portfolio'.
//This is my code to get the routing working.
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { SideBarComponent } from './side-bar/side-bar.component'; import { MainContentComponent } from './main-content/main-content.component'; import { NavigationBarComponent } from './navigation-bar/navigation-bar.component'; import { RouterModule, Routes } from '@angular/router'; import { PortfolioComponent } from './portfolio/portfolio.component'; import { ContactComponent } from './contact/contact.component'; const appRoutes: Routes = [ {path: 'contact', redirectTo: '/contact', pathMatch:'full'}, {path: 'portfolio', redirectTo: '/portfolio', pathMatch:'full'}, //this seems to be where I get the problem { path: 'contact', component: Contact.Component }, { path: 'portfolio', component: Portfolio.Component } ] @NgModule({ declarations: [ AppComponent, SideBarComponent, MainContentComponent, NavigationBarComponent, PortfolioComponent, ContactComponent, ], imports: [ BrowserModule, RouterModule.forRoot(appRoutes,{ enableTracing: true }) ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
- Redirecting URL containing index.php with params in CakePHP
There was old website having URLs like that:
index.php?id=11&lang=enand it still will be indexed by the google for a while. And I made new website based on CakePHP and I would like to redirect old URLs to new ones.
Following attempt don't work:
$routes->redirect('/index.php?id=11&lang=en', '/controller/action/someId', ['status' => 302]);
There is some conflict with .htaccess file placed in webroot folder I guess:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
Can it be done by cakephp routing?
-.
- Cannot ping local Ubuntu server behind VPN, but SSH locally works fine?
I have a Ubuntu server currently behind an ipvanish VPN, using Openvpn. I can SSH locally to it but I cannot ping it. On the server I'm trying to mount a local Samba drive to the server, but that also doesn't work(I think that has something to do with the fact that I can't ping it).
- How do I correctly use named tables with 'ip route'
I'm using this on my server to route any traffic to certain ip over a specific interface
ip route add 80.100.141.27/32 via 167.99.208.1 dev eth0 src 10.18.0.10
This works great, traffic to 80.100.141.27 will go over 10.18.0.10
Now to organise these rules I'm thinking I could use named tables.
First I create a new table called 'table-name'
- name: create named ip route table lineinfile: path: /etc/iproute2/rt_tables line: '200 table-name' create: yes tags: ip_route
Then I can add rules as follows
ip route add table table-name 80.100.141.27/32 via 167.99.208.1 dev eth0 src 10.18.0.10
Rules are now added to this table
ip route show table table-name
However the rules are not active. Traffic does not go over the specified route.
- Why iproute2 did not display uidrange information?
From some articles, we can use
ip rule add uidrange 1000-1000 table 101
such like this to create a rule that match a uid range from 1000 to 1000. and when this rule created once, we can use
ip rule list
to show these rules, just like:
$ ip rule list 0: from all lookup local 32765: from all uidrange 1000-1000 lookup 101 32766: from all lookup main 32767: from all lookup default
But when I create such rule, I got the list just like this:
$ ip rule list 0: from all lookup local 32765: from all lookup 101 32766: from all lookup main 32767: from all lookup default
If I use other condition just like to or fwmark option, it's worked and displayed correct, but just uidrange is not working and not display.
Does anybody see this before? Thanks!
|
http://quabr.com/48905317/linux-route-different-networks-to-local-host
|
CC-MAIN-2019-13
|
refinedweb
| 1,025
| 57.57
|
Are you sure?
This action might not be possible to undo. Are you sure you want to continue?
Beginning web animation with Macromedia Flash MX
Macromedia Flash is the de facto standard application for authoring rich media content on the World Wide Web. This course will teach you how to use Flash MX, Macromedia's latest and most advanced version of the software. We'll cover the basics for new users and set you on the right track to creating rich media Web sites of your own.
1. What is Flash?.
2. Learn the Flash interface.
3. Animate the face In this lesson, you learn the terms and methods used in the Flash animation process. You then apply what you've learned to the Face Facts project and animate the face you drew in Lesson 2. 5. Publish for everyone.
4. Add ActionScript to your movie In this lesson, you transform Face Facts from animation into interactive media by adding user control via buttons and ActionScript. You learn to import images into Flash and to add text with the Text tool. 6. Keep learning This course teaches you the basics of Flash publishing, but Flash has much, much more to offer. This lesson discusses what you've learned and where to go to find more information.
What is Flash?
Let's get started. Welcome to Beginning Flash MX. This course teaches you how to use Macromedia Flash MX, a program for authoring and viewing multimedia content on the Web.
Get the software
What to expect from this course
Macromedia Flash MX is the "must have" tool used by over one million professionals to deliver the best user experiences on the web, increasing both revenue and customer satisfaction while lowering costs.
First, we go over a few topics to get everyone up to speed. Some students may know nothing about Flash except the name, whereas others may have already used Flash, so there'll be a brief introduction to what Flash is and how it's used. You also learn the basics of Web development, how the Flash program fits into the picture, and some benefits of using Flash. In Lesson 2, you set up your Flash program and begin learning how to use it. Drawing in Flash differs from every other drawing program available, so learn how to use each of the different drawing tools. You also learn what the timeline is and try your hand at beginning animation techniques.
» Macromedia® Flash 8
In Lessons 3 and 4, you get a feel for more advanced techniques, such as making symbols and storing them in a reusable library. You also learn the basics of ActionScript, Flash's built-in scripting language. (Don't worry; we won't delve too deeply into the code.)
In Lesson 5, we discuss ways to make your Flash Web site accessible to everyone, as well as a variety of different ways to publish your Flash content. The key objective here is inclusive Web design.
What to expect from this lesson
Finally, Lesson 6 presents best-practice techniques and common mistakes that beginning Flash users make. If you want to learn more, we provide you with topics to research and a list of resources, such as links, forums, and discussion groups.
What you need to know
This lesson discusses the concepts that you should know before starting this course. We talk a little bit about the history of the Internet, differences in image file formats, how Flash came to be, and what Flash is. After you've learned this information, you encounter the pros and cons of using Flash. The lesson closes with some advanced examples of Flash on already existing Web sites to give you a few ideas of what can be achieved by using Flash. The Internet, as it exists today, was started in the early '90s by scholars and researchers as a way to share documents and research papers electronically. They developed a simple method called HTTP (Hypertext Transfer Protocol) for trading files, and a simple format called HTML (Hypertext Markup Language) for those files. Virtually every Web site you've ever seen (including Flash Web sites) has used these two technologies.
HTML, though a grand idea, did not originally offer much control over presentation of documents. Soon, the language grew to include the option for images, colors, and more visual style. Web designers began to use HTML and constantly asked for more and more control over presentation. It quickly became obvious that the language could only go so far to please everyone, and the researchers thought much of this control would be better suited to alternate technologies. Unfortunately, not every technology could be designed this way because there weren't enough resources to cover all the possibilities and features people requested, so the designers of HTML decided to make a standard way to include, or embed, other functionality and content into a Web page. These other technologies could be developed by third parties and embedded in an HTML document by the use of a plug-in. A plug-in is a small piece of software that adds functionality to a computer program. In the case of Flash, you use a plug-in to add functionality to a Web browser, such as Microsoft Internet Explorer, AOL, or Netscape Navigator. Macromedia Flash is an embedded technology.
Some of these alternate technologies, such as JavaScript and CSS (Cascading Style Sheets), were designed to work seamlessly alongside HTML. JavaScript adds interactivity and functionality to Web pages whereas CSS allows a large amount of control over style properties such as colors, fonts, and layout.
Explore graphic formats
Another concept you need to understand to learn Flash is the difference between the two main types of graphic formats: raster and vector.
A raster graphic is made up of a grid of pixels, or small dots of color, that when viewed together, give the appearance of an image. Raster is the most common image format on the Web and most raster formats are very well suited for detailed images, such as photographs. Graphic file formats such as JPEG (Joint Photographic Experts Group), GIF (Graphic Interchange Format), and BMP (Bitmap) are all raster graphics.
A vector graphic is made up points, lines, and shapes. Vector graphics are very well suited to line art, corporate logos, icons, and cartoon-like illustration. Some examples of vector graphic file formats are EPS (Encapsulated Post Script) and SVG (Scalable Vector Graphics).
These definitions may be confusing for some of you, so look at Figure 1-1. As they say, a picture is worth a thousand words.
Figure 1-1: A close-up view of the differences between vector and raster graphics.
The 45-degree line in Figure 1-1 clearly shows that the raster graphics are pixel-based and vector graphics are line-based.
Figure 1-1 is a raster graphic, even though the right half represents a vector graphic.
The vector version is saved as two points connected by a line. No matter how large this graphic is scaled, it can still be represented as a smooth line. The raster version is represented as seven separate square pixels, each one-pixel over and one-pixel up from the preceding. This method loses quality when scaled and displays a jagged, instead of smooth, line. Another benefit of vector graphics is smaller file size based on scalability. No matter how large the graphic is, it's still represented by two points and a line. The raster version is saved as a nine-bynine pixel grid making 81 total pixels. At 16 times zoom, in order to maintain the same amount of quality, the raster version requires 20,736 pixels. Flash MX can incorporate both vector and raster images into a Flash movie. Now that you know the difference, you can understand when it's appropriate to use each type to keep file size at a minimum. Macromedia Flash is the de facto standard application for authoring rich media content on the Web. As previously mentioned, Macromedia Flash is one of the Web technologies that can be embedded in an HTML document. It's an all-inclusive way to serve multimedia content (such as text, graphics, animation, interactivity, audio, and video) to the viewer. There are other embedded technologies available for Web multimedia, but the popularity and adoption rate of Flash is so large that it has become the only one worth seriously considering if you'd like a large audience. Macromedia statistics claim that about 545 million Flash Players have been downloaded, and that more than 98 percent of Web users have the capability to receive Flash content.
So what, exactly, is Flash?
Understand the terms
Throughout this course, you'll see the word Flash used in a couple of different ways. It's very important that we clearly define the difference before continuing.
The Macromedia Flash Player is a Web browser plug-in for viewing Flash content over the Web. The Flash Player is free and can be downloaded from the Macromedia download Web site . You may want to ensure you have installed the latest version of the Flash Player before continuing this lesson.
The Macromedia Flash Authoring Tool or Flash Program is a commercial software application available for Windows and Macintosh Operating Systems. Only people interested in creating Flash content need to install the Flash Authoring Tool. Students interested in following the lessons and exercises should purchase and install the Macromedia Flash MX Authoring Tool on their computer. Studio MX, another Macromedia product, includes Flash and several other applications, such as Dreamweaver and Freehand, which work well with Flash and would be of benefit to many students. If you haven't purchased Flash MX, consider the Studio MX package as an alternative. The Macromedia Web site offers a free trial version of Flash MX. The trial version should be suitable for the course material; however, serious Flash authors should purchase a license before the trial version expires.
Pros and cons: why use Flash?
Let's take a look at some pros and cons of using Flash. The main benefit of using Flash is that it can add richly interactive content to your Web pages. However, some other technologies, such as DHTML, offer a similar capability to add interactive content. We need to discuss the differences between these technologies to give you a clear view of the pros and cons of using Flash.
Flash versus DHTML
First, what is DHTML? DHTML (Dynamic Hypertext Markup Language) simply refers to the creative combination of HTML, JavaScript, and CSS. DHTML enables Web page authors to add interactivity to their Web sites without being dependent on a plug-in. Although this independence is a benefit for DHTML, it can also be a hindrance. The problem arises because not all Web browsers are the same. As beginning Flash users, you won't be expected to test every possible browser combination, but serious Flash authors test many browsers to ensure that their work can be used in as many browsers as possible. The following list contains just a few of the Web browsers available. Internet Explorer Netscape Navigator Apple Safari Opera AOL Mozilla / Firebird / Camino Lynx Various handheld devices such as mobile phones
You may have heard the term cross-browser. Cross-browser compliance refers to Web pages and code that display and work well in a variety of Web browsers. Similarly, cross-platform means that something works well on multiple operating systems, such as Windows, Macintosh, and even Linux.
The first major benefit of Flash over DHTML is the consistency of the Flash Player as a presentation medium. Web developers using DHTML interfaces have always been plagued by differences between various Web browsers; for example, some code that works on Internet Explorer may not work on Netscape Navigator, or vice versa. Because Macromedia controls the Flash Player, developers can ensure a cross-browser, cross-platform medium for presentation of Web content. This gives you, as a Web developer, the piece of mind that any Web user can view and access your content in exactly the same way, assuming there is a Flash Player plug-in developed for that user's browser. Another major benefit of Flash is the file size. Flash has the ability to use and animate vector graphics. As we discussed, a vector graphic is made up of lines and points instead of pixels. Using vector graphics for most of your Flash movie can keep the file size much smaller than an equivalent DHTML interface.
Flash disadvantages
Flash MX adds many advanced features, such as better integration with audio and video. Seamlessly incorporating audio and video into DHTML is difficult, if not impossible.
Unfortunately, Flash has its drawbacks, too. As we mentioned, viewing Flash content requires the user to have installed the Flash Player plug-in. If the user does not have the plug-in, he can't get the content at all. Fortunately for us, the people who do not have the Flash Player represent a very small percentage of Web users.
Advanced Flash use
Another drawback of using Flash has historically been handicapped accessibility. Blind users, for example, may use a screen reader to access a Web page. A screen reader is a computer program that speaks screen text out loud to blind or low-vision users. Although Flash MX content is still not as accessible as plain-text content, Macromedia has added many fantastic accessibility features, which we discuss in Lesson 5. Let's continue by looking at some example uses of Flash on the Web today.
All of the following examples are very advanced uses of Flash and you should not expect to understand them without a large amount of experience and practice using the Flash Authoring Tool. We merely wanted to bring them to your attention so you could see the advanced possibilities Flash
Why are you here?
There's nothing like peer support in a
offers. Nike Lab is an interactive experiment by the Nike Shoe Company to build brand awareness and promote the company image to the world. You could easily spend hours on this Web site, so grab a snack first.
learning environment. If you ever belonged to a study group in school, you'll remember the value of putting heads together to discuss the subject and work through solutions. The Message Board is your online studygroup lounge -- a place where you can meet your classmates, share your reasons for signing up for this class, and talk about your goals and dilemmas as you work through this course. You never know who has the answers you seek.
JoshuaDavis.com is developed and maintained mainly as a portfolio Web site for the site's creator. Joshua Davis also used to maintain a Web site named PrayStation, featuring hundreds of interactive art pieces developed in previous versions of Flash.
The Cartoon Network 's Web site is a perfect example of how vector graphics can be used effectively. The line-art nature of the subject matter (cartoons) allows for delivery of a rich user experience in a relatively low-bandwidth Web site.
Moving on
Look for other Flash Web sites on your own. Examine them and decide what types of sites you like and dislike. You may even want to post your examples to the Message Board so that everyone can see and discuss them. This lesson covered the basics of Web development, what Flash is, and how Flash fits into the rest of the Internet. In the Lesson 2, you start using the Flash Authoring Tool to create your very own Flash movies. Be sure to complete the assignment and the quiz for Lesson 1. And please bring your questions, comments, and discussion topics to the Message Board, where you can say hello to your fellow
Assignment #1
students.
Quiz: #1
A) B) E) A) B) C) D)
1. If you haven't already, install Macromedia Flash MX on your computer. You'll need it for the rest of the course exercises and examples. If you're not sure you want to purchase the program, you can download the trial version from Macromedia . 2. Download and install the Flash Player plug-in. Even if you already have the Flash Player plug-in, please install it again. It's always good to have the latest version, and you may need it for some of the examples in this course. 3. Some students may want to download and install multiple standards-compliant Web browsers. This is not required, but most Web developers like to have several. Mozilla , Netscape , Opera , and Internet Explorer are available for both Windows and Macintosh. Safari and Camino are also available for Mac OS X.
Question 1: What's the main objective of the Beginning Flash MX course? (Check all that apply.) Know the pros and cons of using Flash. Create your own Flash movies. Use basic ActionScript for interactivity. Make Flash content accessible. Find out where to learn about more advanced Flash authoring. A cable for transferring files from your computer to Internet. A small piece of software that adds functionality to a program.
Question 2: What's a plug-in? C) D) A) B) A) B)
Question 3: Which type of image format would be better for a photograph? Question 4: What's a Flash Player? C) D) A) B) A) B) Raster Vector
A technique that allows you to plug a picture into a Flash movie or Web site.
A program menu for making Flash content accessible to blind and low-vision users.
An experienced Flash developer, also known as a Flash guru. A software application for creating Flash content. A plug-in for viewing interactive Web content. A Web page that allows you to watch video in Flash.
Question 5: What does the term cross-browser refer to? Question 6: What's a screen reader? C) D)
A Web page or code that performs well on multiple programs, such as Internet Explorer, AOL, and Netscape Navigator. A Web page or code that performs well on multiple operating systems, such as Windows, Macintosh, and Linux. A news announcer or politician who reads words off a teleprompter in front of a television camera. A computer program that speaks screen text out loud. A friend or coworker who reads screen text to a blind or low-vision computer user. Scrolling text on a Web page that alerts users to news or advertisements.
Learn the Flash interface
Explore the Flash workspace. In the Lesson 1 we answered the question, "What is Flash?" Lesson 2 poses a new question, "What can Flash do?" Flash MX has a host of tools and panels that enable you to create, modify, and import content. Luckily, Macromedia has combined these powerful tools into a consistent and easily navigated interface called the workspace, shown in Figure 2-1. Let's explore the workspace and drawing tools first, and then later in the lesson, the fun really begins as you create the graphics for your example movie Face Facts.
Time for a new system?
If running Flash in addition to your other programs is causing your computer to slow down dramatically, upgrade to an HP business desktop PC, which offers performance and flexibility at an affordable price.
» HP Compaq dc5100 microtower desktop PC
Play with Panels of Plenty
Figure 2-1: The Flash MX workspace. View a larger version of this image.
» Desktop buying guide
If you don't have the Flash program running, start it now. If this is your first time running Flash MX, you'll see the Welcome panel in the center of the screen. This panel leads you step by step through the process of setting up your workspace. Close this panel because this lesson shows you how to set up your workspace. Flash MX has panel sets for both designers and developers. These panel sets display the tools most used by people working in these roles. Flash also enables you to customize your own panel set. Because this is a beginning Flash course, the Designer panel set best suits your needs. Select Window > Panel Sets > Designer [1024 x 768] . At the center of the workspace is the Stage . Think of the Stage as your digital canvas, on which you create your Flash masterpieces. The Stage is where you draw and import your graphics.
To the left of the Stage is a group of icons labeled Tools . This is the Toolbox, shown in Figure 22. As the name implies, the Toolbox holds the tools you use to create Flash movies. There are four distinct sections in the Toolbox, listed from top to bottom: Graphic creation and modification tools View navigation tools (pan and zoom) Stroke and fill color boxes Tool option modifiers
Figure 2-2: The Toolbox has four sections.
At the top of the Flash workspace is the Timeline, shown in Figure 2-3. The left side of the Timeline lists the layers in your movie. Layers help you organize the many graphics that reside on the Timeline. This list of layers is called the layer stack. The main body of the Timeline shows the frames in your movie. Each frame represents a still image like the frames on a movie reel. This is where the animation magic happens. Figure 2-3: The Timeline shows layers and frames. View a larger version of this image.
The right side of the workspace holds the panels, one of which is shown in Figure 2-4. The panels give you extended options when you're working with your graphics on the Stage, the Timeline, and Actions. Click a panel name to minimize that panel. Click the name again to maximize it. Because there are many panels to work with, this is a good way to gain access to a panel and to get it out of the way when you aren't using it.
Figure 2-4: The Align panel.
Below the Stage is the Properties Inspector, shown in Figure 2-5, which displays the most frequently used properties for a tool or object. With no tool or object selected, the Properties Inspector displays the settings for the Stage, which include: Stage size Publishing settings Background color Frame rate You'll use the Properties Inspector to modify the Stage and prepare your Face Facts movie.
Set the stage
Figure 2-5: The Properties Inspector.
The size and boundaries of the Stage define the size and boundaries of your final published Flash movie. In the Properties Inspector, click the Size button to open the Document Properties dialog box shown in Figure 2-6. In the Dimensions field, type 550 for the width (the default size) and 500 for the height. You can also set the background color and frame rate in this dialog box. Click the color chip next to Background Color . Your cursor changes to an eyedropper and a color selection grid pops up. Drag your eyedropper over the colors in the selector grid. Notice that the color under your cursor is displayed at the top of the color selector. To the right of the current color is the color's Hex code, which you may recognize if you're familiar with HTML. You can type the Hex code here if you want. For now, click a color chip to pick a new color for the stage. Leave the other settings as they are, and click OK . The Stage has been resized and the background color has changed.
Save your file
Figure 2-6: The Document Properties dialog box.
In just a few steps, you've set the Stage for your first Flash MX movie, Face Facts. Go ahead and save this file by selecting File > Save As . Select the folder where you'd like to save your movie, type faceFacts in the File name field, and press Enter . You should save your file periodically during this lesson as you create Face Facts. To save your work, select File > Save in the top menu or press Control+S ( Command+S on the Mac.) Save often while working to ensure that your saved file is always updated. This prevents the loss of work and valuable time in the event of an unexpected power outage, system crash, or a rampaging pet attacking the power cord of your computer.
Draw a head
Click the color chip in the Property Inspector and instead of clicking a color in the selector grid, move your cursor over any region in the Flash workspace. The eyedropper picks up the color of whatever pixel is under your cursor. Click once to select the color. Pretty cool, huh?
Your example movie, Face Facts, consists of a cartoon-like face, drawn and animated by you; some text describing the features of the face and their importance in character animation; and some interactive buttons that enable you to navigate to each facial feature description and animation. You'll get to the animation and interactive scripting in Lessons 3 and 4. First, you must draw a head. Position your mouse pointer over any tool in the Toolbox. After a moment, the name of the tool displays near your cursor. Take a minute to mouseover each of the tools in the Toolbox and become familiar with their names. Now click the Oval tool or press the O key on your keyboard. You'll use this tool often. In the Colors section of the Toolbox, click the Fill Color paint chip. As it implies, the Fill Color is the color inside of the shapes you draw in Flash MX. Select a color for your head. Now, click the Stroke Color paint chip. The Stroke Color is the color of the outline around your shape. Select a color for the line surrounding your head shape. When the Oval tool is selected, the Properties Inspector displays the Oval tool name and its options. Select the different tools in the Toolbox to see how the options in the Properties Inspector change with each new tool you choose. This is the real power of the contextual Properties Inspector. It enables you access to many different properties all in the same location and based on which tool you have active. Select the Oval tool and again and look at the Properties Inspector. You
see color options, Stroke Height, and Stroke Style . Adjust these settings as you wish by selecting a different Stroke Height and Stroke Style.
Now draw the head. Click and drag on the Stage to draw an oval, as shown in Figure 2-7. You just created a head! It may not seem like much now, but you're just getting started.
Explore shapes
Figure 2-7: Click and drag on the Stage to draw an oval.
Let's take a minute to look at how Flash renders shapes. Click the Arrow tool in the top-left corner of the Toolbox. Your cursor changes to the Arrow tool. This is the tool that you use to select, modify, and move shapes and other objects in Flash MX. Select your oval by clicking once in its center. Notice how the fill appears grainy but the stroke (outline) does not. This signifies that the fill has been selected. Double-click the shape. Now both the fill and stroke are selected. Click anywhere else on the Stage to deselect the oval. To select only the stroke, click once on the stroke. You can also drag a selection rectangle, called a Marquee, around your oval to select it. On the Stage, click and drag a Marquee around your oval as shown in Figure 2-8. Click anywhere on the Stage to deselect the oval again.
Move the oval
Figure 2-8: Drag a Marquee around your oval.
The Move icon appears next to the Arrow when your cursor is over a selected fill or stroke. Select the stroke, and then click and drag the stroke to a new position where it's partially overlapping the oval fill. Figure 2-9 shows an example.
Figure 2-9: Click and drag the stroke to a new position.
Now move your cursor over the fill so that the Move icon appears next to the Arrow tool. Click and drag the fill. Wow! The stroke has bisected your fill and you've moved only a piece of the fill to a new position, as shown in Figure 2-10. This method of drawing is unique to Flash and enables you to easily create complex shapes by chopping up simple ovals, rectangles, and polygons. You can also use the Marquee to select portions of the oval. Only the portions that fall within the Marquee will be
selected. It appears you have a somewhat mutilated head on your hands now. Repeatedly click Edit > Undo or press Control+Z ( Command+Z on the Mac) to Undo until you're back to the original oval head shape.
Snap to objects
Figure 2-10: Move a piece of the fill.
Select the Arrow tool. In the Options section at the bottom of the Toolbox, look for a horseshoe magnet icon called the Snap to Objects icon and make sure that it is toggled. The Snap to Objects modifier allows you to accurately move and place objects in relation to other objects on the Stage. Flash will signify that you are snapped to another object by placing a small outlined circle either near the cursor or at the end of the line that you are drawing. Click and drag with the Oval tool and draw another oval near the first but don't release the mouse button. As you are dragging the cursor near the first oval, the cursor will snap to that oval's outline. See Figure 2-11. Drag the cursor around and experiment with the Snap to Objects function. When you are finished, click Edit > Undo in the top menu or press Control+Z ( Command+Z on the Mac) until you are left with only the head oval.
Try the Free Transform Tool
Figure 2-11: This image shows the cursor snapped to the outline of the oval.
Select both the oval fill and stroke by double-clicking the oval. In the Toolbox, select the Free Transform Tool or press the Q key on your keyboard. A transform box appears around the oval on the Stage. The box has handles, which are small boxes, on its corners and sides. Move your mouse over any of the small boxes in the corners or center of each side. The icon showing a line with arrows on each end, shown in Figure 2-12, represents the Scale transform.
Figure 2-12: Transform the scale of the oval.
Move your mouse just outside one of the corners. A circular arrow icon appears. It's the Rotation transform. Now move your mouse over any of the sides, but not on the scale boxes. The icon showing two arrows, one on top of the other, is the Skew transform. Experiment by clicking and
Use groups
dragging the different transform icons. Try out each of the transforms to see how it behaves. Adjust the oval until it is the size and shape you want for your face.
At times you need to be able to select and move shapes as discreet objects without having them erode each other in the manner discussed earlier. Other times, you may want to treat several shapes as one entity. To do this, use the Group command. Select both the fill and stroke of your oval. Choose Modify > Group or press Control+G ( Command+G on the Mac). This transforms your oval into a group. When you select the oval, the Properties Inspector displays group as the object type. Double-click the oval to edit it. Just above the Stage you'll see a scene clacker icon with the underlined phrase Scene 1 and the group icon with the word Group . This tells you that you're within the group and can edit its shapes. Click the underlined Scene 1 or double-click an empty area of the Stage to return to the Stage. To ungroup shapes, select the group, and then select Modify > Ungroup or press Control+Shift+G ( Command+Shift+G on the Mac).
Organize with Layers
Keyboard shortcuts are quick keystrokes that you can use to execute the commands found in Flash MX. These shortcuts make your workflow faster. As you become more familiar with Flash, you'll pick up shortcuts that work best for your particular style of work. Keyboard shortcuts are listed beside their corresponding commands in the menus and appear as tool tips when you mouseover tools in the Toolbox. When creating your Flash movies, you'll sometimes have many groups and shapes on the stage at a time; layers help you organize them. In Face Facts, you'll have separate features that make up your face. Each facial feature will reside on its own layer. As mentioned earlier, the layer stack sits to the left of the Timeline above the Stage. You currently have one layer entitled Layer 1.
Create and modify Layers
Insert a new Layer
Double-click the layer name. It becomes active and you can edit the layer name. In the active text field, type head to rename the layer. There are four icons at the bottom of the layer stack. From left to right they are Insert Layer Add Motion Guide Insert Layer Folder Delete Layer
Click the Insert Layer icon to add a new layer. A new layer, named Layer 2, appears above the head layer, as shown. in Figure 2-13. New layers you insert with the Insert Layer icon appear above the currently selected layer. Rename this new layer ears. Your ears layer is selected and displays a pencil icon next to its name. Any new shapes that you draw are drawn on this layer until you select a different layer. You can select different layers by clicking once on their layer names.
Change the Layer stack order
Figure 2-13: Add a new layer.
Make an ear by selecting the Oval tool and drawing another oval. This oval appears above the head shape because the ears layer is above the head layer in the layer stack. Click and drag the ears layer to below the head layer. Now the ear is behind the head and looks a little better. Create a new layer and name it eyes. Move the eyes layer above the head layer. Draw an eye on the eyes layer by making a white circle with a black stroke.
Hide, lock, and outline Layers
Another advantage of using layers is the capability to hide or lock a layer that you're not currently editing. You can also view a layer or all layers as outlines, which helps you see details that might be hidden beneath a fill. There are three icons at the upper-right side of the layer stack that enable you to manipulate layers: Eye (Show/Hide All Layers) Lock (Lock/Unlock All Layers) Box Outline (Show All Layers as Outlines) Try clicking the other dots in the layer stack to see how they respond. Objects on a locked layer cannot be modified, and new objects cannot be created on that layer while the layer is locked. Simply unlock the layer to begin editing again. When a layer is in outlines mode, you can select the stroke of a shape but not the fill. Now, return all layers to the unlocked, shown, and nonoutlined positions, and fasten your seatbelt. You're moving on.
Click the Eye icon at the top of the layer stack. All layers are now hidden. Click the Eye again and all layers are shown. Each layer has a dot that corresponds to the Eye icon at the top of the stack. To hide the head layer, click the dot beside that layer and below the Eye icon. The head layer is now hidden and a red X has appeared in place of the dot. Click the red X to show the head layer.
Duplicate the eyes and ears
You now have a head with one eye and one ear. Your face needs one more of each feature unless you're drawing an otherworldly, alien face. You could do that easily if you wanted, but for this example let's stick to a vaguely humanoid face. Faces are generally symmetrical. You could draw two different ears and two different eyes with the Oval tool, but it might be tedious to get them both exactly the same. To create identical features for each side of the head, you can draw only one and then duplicate it for the other side.
Using the Arrow tool, select the ear oval (double-click). Press Control+C ( Command+C on the Mac) to copy it and Control+V ( Command+V on the Mac) to paste the new ear onto the Stage. You may not be able to see the new ear you just created, so hide the head layer by clicking its dot in the Eye icon column. Go ahead and hide the eyes layer as well. Now you should only see the original ear and the one you just pasted onto the Stage. Copying and pasting is the simplest way to duplicate shapes on the Stage. You'll learn a more advanced method in Lesson 3.
With the Arrow tool, select your new ear and delete it by pressing the Delete key. Show the head layer by clicking the red X in the Show/Hide column of the layer stack. This will give you a reference for the position of the new ear. Make sure that the Snap to Objects button in the Toolbox is toggled on. Select the original ear. Now, while holding the Alt key, click and drag the ear to the left or right depending on which ear you're missing. While the holding the mouse button, you should see a plus sign below the cursor to indicate duplication, as shown in Figure 2-14. If you drag directly to the right or left, the Snap to Object circle icon appears and the object outline snaps in alignment with the original ear. Release the mouse button when you've positioned the ear where you want it. You've duplicated the ear and the new ear should be directly aligned with the original. Alt-dragging enables you to quickly copy objects on the Stage.
Figure 2-14: Alt-drag to duplicate the ear.
Now, show the eyes layer by clicking the red X in the Show/Hide column. Repeat the Alt-drag process to duplicate the eye.
Finish the eyes
Eyes look strange without some detail. Create a layer called pupils and use the Oval tool to draw two smaller ovals within the eyes to represent the pupils of the eyes, as shown in Figure 2-15. Draw your pupils without strokes around them. You can accomplish this in two ways. You could draw the ovals, select only the strokes, and then delete them. Or you can select the Oval tool, and, in the Properties Inspector or Toolbox options, click the Stroke Color chip. At the top of the Color Selector, select the white box with a red diagonal line through it. This is the No Color selection. Then draw the pupils. You can use the No Color selection for fills as well.
Draw the mouth and hair
Figure 2-15: Add two ovals without strokes for the pupils.
Use the Line tool
Thus far you've drawn most of your facial features with the Oval tool. Now you'll explore a few other tools to complete your face. Create a new layer named mouth, and another one named hair. Drag both layers and place them above the head layer in the layer stack. Select the mouth layer. Select the Line tool from the Toolbox. Draw a horizontal line where you want the mouth to be. Select the Arrow tool and position it over the middle of the line you just drew. Notice the curved line icon beneath the Arrow tool. Position the Arrow tool over one of the ends of the line, and you should see a corner icon beneath the Arrow tool. Experiment with the Arrow tool by clicking and dragging the middle of the line. As you drag, the straight line becomes curved and you can adjust the curve up or down as well as side-to-side. Click and drag one of the ends of the line to adjust the end point of the line. This is a smooth way to adjust any shape that you draw. You can modify fill shapes in the same manner. Adjust your line so that it looks like the bottom of a basic smile. Select the Line tool again. Draw a line between the ends (corners) of your smile. Using the Arrow tool, drag this line down as well to complete the mouth shape. You should now have a smiling crescent-shaped mouth, like the one shown in Figure 2-16.
Visual clarity
Your monitor is not just a tool, it's a creative partner that brings your ideas to life, giving them shape, clarity, and color. The monitor you choose makes a tremendous difference to the way you work and to the results of your work.
» HP Flat panel monitor L2335
Use the Ink Bottle tool
Figure 2-16: Adjust the two lines to form a crescent shaped mouth. Your face is smiling.
You may have selected the color for your mouth before you drew your lines. To change the stroke color of a shape that's already drawn, use the Ink Bottle tool. Select the Ink Bottle tool from the Toolbox. Select a new stroke color for the lines of the mouth. Now click the lines of the mouth with the Ink Bottle tool. The stroke color changes to the new color.
Use the Paint Bucket tool
You can use the Ink Bottle tool to change the stroke color of the other features in your face. Remember that if your shapes are in a group, you need to double-click the group until you can edit the shapes with it.
Your mouth should look pretty good now but it needs a fill color. Select the Paint Bucket tool from the Toolbox. Select a fill color and click inside the mouth shape. The mouth fills with the color you selected. Use the Paint Bucket tool to change the fill color on the other features of your face as you see fit.
Use the Pencil tool
Now draw the hair. Select the hair layer in the layer stack. Select the Pencil tool from the Toolbox. The Pencil tool has three different modes in the Options section of the Toolbox: Straighten Smooth Ink
Click the Pencil Mode button and select one of the modes from the drop-down list. Experiment with the three different modes and draw hair for the head. Try using different stroke heights and styles to achieve various hairstyles. You can draw many strands of hair, or draw filled shapes as shown in Figure 2-17.
Get perfect alignment
Figure 2-17: Three filled shapes can represent the hair.
The Align panel to the right of the Stage is an indispensable tool for arranging objects on the stage. Position your mouse over each button in the Align panel to see a description. Try selecting each eye oval, and then pressing the Align Bottom Edge button. Select the eyes. Select Modify > Group to group the eyes. Hold down the Shift key, and select the head shape. Shift+selecting is the method you use to select multiple objects as once. Now the head and both eyes are selected. Press the Align Horizontal Center button. The eyes symmetrically align with the center of the head, as shown in Figure 2-18. Use the same process to get all of your features aligned as you want them.
Add finishing touches
Figure 2-18: Align the eyes to the center of the head.
You have a fairly complete face at this point. You can add other features and change colors as you see fit. I added a simple nose on its own layer using an unfilled oval. I then selected the top half of the nose with the Marquee and deleted it. That complete face is shown in Figure 2-19.
Moving on
Assignment #1
Figure 2-19: Here's a face with a nose and final adjustments made to stroke color, alignment, and scale.
You have now explored many of the drawing and editing tools in Flash MX. You created a face for the character in your project, Face Facts. In Lesson 3, you'll animate the face to give it a little life and expression. Be sure to do the assignment and test yourself with the quiz for this lesson before moving on. Also, visit the Message Board to find out what your fellow students are up to. Now that you've learned a few of the tools in Flash MX, use your new skills to practice drawing. Flash MX enables to you create graphics in many styles, from cartoon and lighthearted to elegant and subtle. Visit one of my favorite Web sites, Home Star Runner , to see great Flash cartoons. Question 1: What's the Flash interface in which you work called? A) B) C) D) A) B) Workshop Stage Workbench Workspace
Quiz: #1
Question 2: What resides, by default, at the center of the Flash interface and could be considered your digital canvas? C) D) A) B) A) B) A) B) Timeline Toolbox Stage Flash Player
Question 3: True or False: The left side of the Stage contains the list of Layers in the Flash movie. Question 4: True or False: The Stroke Style controls the color of the lines in a shape. Question 5: True or False: The main body of the Timeline is made up of little rectangles called Cellboxes. True False True False True False
Question 6: What holds the many Tools you use to create graphics in Flash?
Animate the face
A) B)
C) D)
Lunchbox Toolchest Toolbox Toolset
The timeline revisited
In this lesson, you learn the terms and methods used in the Flash animation process. You then apply what you've learned to the Face Facts project and animate the face you drew in Lesson 2. In Lesson 2, you created your first vector graphic, a face, using the Flash drawing tools. In this lesson, you animate the face and bring it to life using the Timeline, as shown here.
Explore Frames
If you don't have it open, start Flash MX and open your Face Facts file.
As the name implies, the Timeline helps you edit the timing of your animation in Flash. The Timeline is laid out as a grid of cells called frames extending from left to right beside each layer. Look at the top of the Timeline. Frames are numbered beginning with 1, your starting frame, at the far left of the Timeline grid, at the edge of the layer stack. Frame 1 should be highlighted in red at the top of the Timeline. The red line running vertically through frame 1 and the red rectangle above is called the playhead. The playhead marks the current frame being displayed on the Stage. For layers that contain graphics, there's a filled circle in frame 1. A gray shaded frame with a filled circle inside is called a keyframe. Flash creates a keyframe on frame 1 the first time you draw graphics on a layer. At the bottom of the Timeline are three text fields showing information about the Timeline. The first shows the current frame on which in the playhead resides. The second shows the FPS (frames per second) of the Flash movie. The third gives you the elapsed time in seconds for the position of the playhead.
A brief history of keyframes and tweens
The term keyframe has its roots in traditional hand-drawn animation. Lead animators would draw a series of images that roughed out the animation. These were the key frames. Junior animators would then draw in the images between the key frames; their images were called the in-betweens, later shortened to just tweens. Animating in Flash is similar to traditional animation. You create keyframes for the animation of your face, and Flash fills in the tweens for you, making your animation task much easier. Flash uses two tween types: Shape: These tweens are useful when you want to morph shapes into other shapes. You'll use the shape tween to animate your face's mouth. Motion: These tweens can only be used with symbols. You'll use the motion tween to animate the eyes and hair of your face.
Explore symbols, instances, and the Library
Symbols are a very important aspect of Flash. After you convert a graphic into a symbol, it's stored in the Library. To view the Library, select Window > Library from the top menu or press F11 on your keyboard. Since you have yet to create symbols, your Library should be empty.
You bring instances of symbols into your Flash movie by dragging them onto the Stage. An instance is a copy of a symbol. For example, you want to animate a group of ducks walking across a street. You draw just one duck on the Stage; convert it to a symbol named Duck, and then drag instances of Duck onto the Stage. All the ducks on the stage will be instances of your Duck symbol in the library. Now, if you want to modify the appearance of the ducks in the group, you edit the Duck symbol in the Library and all instances of Duck on the Stage reflect your changes. Symbols give you another advantage. When you publish your movie to the Internet, the Duck symbol is exported only once. Flash copies the Duck symbol to the instances that you created when it plays in the user's browser, thus shortening download time.
Examine types of symbols
Converting a graphic to a symbol enables you to use a motion tween to animate certain properties of the symbol, such as height, width, scale, and position on the screen. Symbols have their own unique layers, Timelines, and Stages. There are three types of symbols in Flash: Graphic symbols are best used for still images or for reusable animations that are tied to the main Timeline. They aren't used for complex interactivity or sound effects. Button symbols are used to create interactive buttons that respond to the user's mouse. When used with ActionScript, buttons can create complex and interesting interaction for the user. Movie Clip symbols are possibly the most used of symbols in complex Flash projects. A Movie Clip has its own Timeline that plays independent of the main Timeline. Movie Clips are used to create reusable animation sequences, can contain complex scripting for advanced interactivity, and can also contain other Graphic, Button, or Movie Clip symbols.
Prepare your graphics for animation
It's good practice -- and usually absolutely necessary -- to have a separate layer in the Timeline for each symbol or shape that you are animating. Animating two separate symbols on the same layer in the Timeline has unpredictable results. So the rule to follow is: Place each symbol on its own layer. Follow this practice and you'll enjoy a reliable animation process. At the end of this lesson, your Face Facts movie will consist of separate animations for the eyes, mouth, and hair. In Lesson 4, you'll add interactivity to the movie, enabling the user to click on buttons labeled Eyes, Mouth, and Hair, which will cue the animation for that specific feature. You'll also add text that describes each facial feature as it is animating. You need to adjust the layout of your movie to accommodate the buttons and text. Using the Arrow tool, drag a Marquee around the entire face, making sure that every shape is selected. Click and drag the whole face and move it to the top and center of the Stage. You may need to use the Free Transform tool to scale the face as needed to allow enough room at the bottom. Figure 3-1 shows how the layout should look.
Incorporating photos
Use scanned images to personalize your Flash animation. HP's high performance scanners allow for fast scans of up to legal size documents.
» HP Scanjet 7650 document flatbed scanner series
» Scanner buying guide
Create a symbol for the eyes
Figure 3-1: Position your face near the top center of the Stage.
You're going to animate the whites of the eyes together as one element. It may seem as if you're already breaking our rule (one symbol per layer), but you aren't. You can have as many groups and shapes in one symbol as you want. If you wanted to animate the whites of the eyes separately, as you would if your face were winking one eye, you'd create a symbol of one eye and place instances of the eye on two separate layers. You'll use a similar approach when you animate the pupils. Select the eyes in the eyes layer. Select Insert > Convert to Symbol, or press F8. In the Convert to Symbol dialog box, type eyes in the Name field as shown in Figure 3-2. In the Behavior section, select Graphic. Click OK. The selection on the Stage is now an instance of the eyes Symbol.
Figure 3-2: Name the symbol eyes.
Explore the Library
If your Library is not open, open it now by pressing F11. You should see your newly created symbol in the Library list. To see a preview of your symbol, select the symbol in the Library. The preview appears at the top of the Library.
The Library window give you access to information about the symbols used in your movie. The list of symbols shows you: Name Kind (Movie Clip, Button, or Graphic) Use Count (number of instances of a symbol in your movie) Linkage (not covered in this course) Date Modified On the right side of the Library window are two buttons for controlling the view of the Library, as shown in Figure 3-3. Click each one to change the Library view.
Figure 3-3: These buttons control the view of the Library.
Create a symbol for the pupils
Click and drag an instance of eyes onto the Stage. This is another method to use to add instances of symbols to the Stage. Delete the instance of eyes you just created. You're now left with the original instance of eyes. You're going to animate the pupils separately. Select and delete the pupil on the right side of the face. Select the left pupil. Another method you can use to create a symbol is by using mouse to open a drop-down menu on the Stage. Right-click ( Command+click on the Mac) the selected pupil. A drop-down menu appears. Select Convert to Symbol from the menu. Name this symbol pupil and set its Behavior to Graphic.
In the layer stack, rename the pupil layer to pupil left. Now create a layer for the right pupil and name it appropriately. Select pupil right layer in the layer stack and then drag an instance of pupil onto the Stage. Position the new pupil instance over the eye. Align as needed to get the positioning right. You have two layers, one for each pupil, with a separate instance of pupil on each layer, and can animate the pupils independently.
Create a symbol for the hair
Select one or all of the shapes that you drew for the hair. Convert the shape(s) to a symbol using one of the methods you've learned. Name the symbol hair and set its Behavior to Graphic. We chose to convert only the top portion of the hair to a symbol and put it on its own layer, as shown in Figure 3-4.
Figure 3-4: We converted only the top hair shape into a symbol.
Animate the eyes and pupils
You can create something similar with your character's hair. Just remember to put each symbol that you intend to animate on its own layer.
Insert a keyframe in the eyes layer
Animating in Flash MX consists of adding keyframes and then adjusting the properties of your symbols, such as position, scale, and rotation. You then add additional tween frames to adjust the timing of the animation. You'll start by animating the eyes symbol.
Scrubbing tip
In the eyes layer, select frame 10. The frame is highlighted. Right-click ( Control+click on a Mac) the frame and select Insert Keyframe in the drop-down menu. The frame becomes shaded and contains a filled circle. The playhead, the red vertical line, is now on frame 10 and you should see the eyes symbol on the Stage while everything else seems to have disappeared. All other frame cells on the other layers for frame 10 are empty, thus you won't see graphics. Select the eyes symbol on the Stage. Expand the Transform panel if it's not expanded. The Transform panel enables you to input numerical data to transform objects on the Stage. Deselect the checkbox named Constrain. In the Height field, type 45%, and press Enter. The eyes should now appear narrowed as if squinting. Right-click on keyframe 1 and in the drop-down menu, select Create Motion Tween. The tween frames turns a pale purple color and there is an arrow from keyframe 1 to keyframe 10. Press Enter to preview the motion tween you just created.
You can also add keyframes by selecting Insert > Keyframe from the top menu or by pressing F6 on your keyboard. The right-click drop-down menu is easy and convenient, so we use it often.
Sometimes while scrubbing, you'll notice that symbols on certain frames have remained selected. This can be distracting at times. There is an easy fix. Scrub through the animation, and when you see a selected symbol, click anywhere on the Stage to deselect it. Repeat this process for any area of the animation you want to scrub and not see selected symbols.
Insert keyframes in the two pupil layers
Click and drag the playhead left and right. This action is called scrubbing. It enables you to play through the frames to better analyze you animations. Scrubbing is a very useful process. Scrub through the animation of the eyes now to see them animate.
At frame 10, insert keyframes for both pupil left and pupil right layers. Making sure that the playhead is at frame 10, select and then move one of the pupils to the left corner of its eye. Make sure the pupil is still selected. In the Transform panel, select the Constrain checkbox. This sets both Height and Width scale factors to be equal. In either Height or Width field, type 60% to scale the pupil. Repeat the process for the other pupil. Create motion tweens for both pupils at frame 1, using the right-click method you learned earlier. Now both pupil left and pupil right layers are shaded purple and show the arrow through the tween frames.
Scrub the animation to see the results. You should see the pupils shrink and move to the left within the eyes, making the eyes appear to look left. The eyes should also narrow, giving an impression of suspicion or contemplation.
Add frames to show the entire face
It would be nice to see the animation of the eyes in context with the other parts of the face. Sometimes it's necessary to see other parts of your animation to make the next decision for a keyframe or tween. To add frames to a layer, select the frame cell in the layer in which you want to add frames and select Insert > Frame in the top menu, or press F5. To add frames to multiple layers at once, Shift+click the frame cells in the layer in which you want to add frames, and then select Insert > Frame. If you can't see all the layers in the stack at once, click and drag the bottom edge of the Timeline down to expand the Timeline view. Add frames in all layers of the face now. Shift+click the frame cells in all the layers at frame 30. See the Timeline in Figure 3-5.
Figure 3-5: Shift+click the frame cells to select multiple frames. View a larger version of this image.
In the top menu, select Insert > Frame or press F5. Flash fills in frames from the last keyframe or tween frame up to the frame that you selected. These frames will be shaded gray like the keyframe before it. The last frame in the sequence of added frames will contain a hollow box. This signifies that the keyframe at the start of the sequence should repeat for all of the shaded frames until the hollow box frame is reached. This allows you to maintain the state of a keyframe through the timeline without having to insert a keyframe for every frame. Figure 3-6 shows the Timeline with frames added to all layers up to frame 30.
Figure 3-6: All layers have frames up to frame 30 in the Timeline. View a larger version of this image.
Scrub through your animation of the eyes now. Seeing the whole face during the animation helps you to better analyze your work and gives you a better picture of the direction your animation is taking.
Complete the animation for the eyes and pupils Copy frames
There are two other methods for selecting the frames that you want to edit. You can click and drag in an empty frame cell to select frames on adjacent layers in the stack. You can also Control+click (Command+click on the Mac) individual frames on layers that are not adjacent.
Insert a keyframe at frame 20 for both pupils. Select one of the pupils at frame 20 and move it to the opposite corner of the eye. Repeat the process for the other pupil. Don't add a motion tween here because what you want is for the pupils to move immediately, giving the impression that the eyes are rapidly looking in the opposite direction. Insert a keyframe at frame 30 for the eyes. Select the eyes. In the Transform panel, change the Height scale transform back to 100%. This returns the eyes to the open state. Once again don't use a motion tween -- you want the eyes to pop open.
In Flash, you can copy and paste frames to other positions on the Timeline. You generally use this method when you want to replicate the state of one keyframe to another, or to move many frames from one layer to another.
Right-click keyframe 1 in the pupil left layer and in the drop-down menu, select Copy Frames. Now Right+click keyframe 30 in the pupil left layer. In the drop-down menu, select Paste Frames. Right+click keyframe 30 again and select Remove Tween. This removes the motion tween that was copied from frame 1, because it isn't needed at frame 30. Repeat this process for the other pupil. Scrub the animation to see the results. The pupils and the eyes all return to the state as seen in frame 1. You'll use this same technique at the end of every face animation to create a consistent starting expression for the face at the beginning and end of each animation.
Why keyframes every 10 frames?
Animate the mouth
You may be wondering why you placed all the keyframes at increments of 10. Building an animation is easier if you rough in the keyframes first. Placing keyframes at increments of five or ten is merely a convenience. You'll rough in the animation for all the facial features in this manner. Later in the lesson, you'll learn to add and remove frames as necessary to adjust the timing of the animation. The mouth animation starts where the eyes left off, at frame 30.
Printing frames
Use a shape tween rather than a motion tween for the mouth. Shape tweens only work for shapes on the Timeline on which the shape tween is applied, and thus the reason you didn't create a symbol for the mouth. You can create shape tweens on other Timelines, inside of a Movie Clip symbol for instance, but you won't do so for this exercise.
Add more frames
This time around, you're going to add the frames for the entire segment first, and then build up the animation with keyframes. Click and drag to select all the frame cells at frame 60, for all layers. You may need to use the scroll bar at the bottom of the Timeline to scroll to frame 60. Press F5 and add frames to all layers. This process is similar to that shown in Figures 3-5 and 3-6 earlier in this lesson.
Printing the individual frames of your animation, either for your own review or to go over with other animators, coworkers, or clients, will allow you to make notes about details you want to tweak in Flash.
Insert a keyframe in the mouth layer at frame 30. This gives you a starting mouth position keyframe from which to animate the mouth. Insert another keyframe at frame 35. Edit the mouth shape on frame 35. Select the Arrow tool from the Toolbox and reshape the mouth by clicking and dragging the points of the lines and the lines themselves. Recall from Lesson 2 that the cursor indicates what you are editing when you mouseover the shape. Make whatever expression you'd like. We created a mouth shape that seems to express confusion, as shown in Figure 3-7.
» HP Color LaserJet 3600 printer series
» Printer and MFP buying guide
Figure 3-7: The mouth has been reshaped to give the impression of confusion.
Making sure that keyframe 30 in the mouth layer is selected, open the Properties Inspector, which has a frame icon on the far left. Find the drop-down menu labeled Tween, and select Shape from the menu. Now frames 30-35 are shaded green and show an arrow through the tween portion, similar to the motion tweens that you created previously. Scrub through the frames to see the animated mouth. Shape tweens are very useful for animating organic shapes. Insert a keyframe at frame 45. Again using the Arrow tool, create another expression for the mouth. We made the mouth appear closed with the corners slightly down-turned. You won't use a shape tween here; instead, the mouth switches immediately to the new expression on frame 45. Insert a keyframe at frame 55. This is the starting keyframe for the return to the expression in frame 30. Insert a keyframe at frame 60. Copy and paste keyframe 30 to keyframe 60 using the right+click method you learned earlier in the lesson. Remove the tween from keyframe 60. Select
Animate the hair
keyframe 55 and in the Properties Inspector set the Tween to Shape. You now have a mouth that animates through two expressions and returns to the starting expression. You're nearing the end of the animation work for Face Facts. The last step you need to complete is to animate the hair. Thus far, you've learned to animate a symbol's position and scale using a motion tween, and to morph a shape into another shape using a shape tween. Now you'll learn to animate a symbol's Color properties. For this you'll again use the motion tween.
Download the source
Understand the Alpha color property
Select frame 90 in all layers and press F5. This adds the additional 30 frames needed for the hair animation. Insert a keyframe at frame 60 in the hair layer. This is the starting keyframe for the hair animation. Insert a keyframe at frame 70.
Download this zip source file and unzip the contents to see the techniques in this lesson at work.
On the Stage, select the hair symbol. Open the Properties Inspector, which shows the Graphic icon on the far left side. Find the drop-down menu labeled Color at the right side of the Properties Inspector. Select Alpha from the drop-down menu. The term Alpha refers to a symbol's Alpha channel. The Alpha channel is the percentage of a symbol's opacity. By animating the Alpha property, you can create interesting effects, the most basic of which is a fade. You can fade in or fade out a symbol. To the right of the Color drop-down is the percentage slider. Type 0% in the input field or use the slide to set the Alpha to zero percent. The hair symbol now has an opacity of zero percent and is completely transparent. Even though you cannot see the hair symbol, it's still there. Click the Stage to deselect the hair and then click the area where the hair is. Notice that the selection box still appears around the hair symbol, as shown in Figure 3-8.
Figure 3-8: The selection box still appears around the hair symbol, even when it is completely transparent.
Create a motion tween at frame 60 in the hair layer. Insert keyframes at frames 80 and 90. Move the playhead to frame 90. Select the hair symbol. From the Properties Inspector, select None in the Color drop-down. Create a motion tween at frame 80. Scrub the frames in the hair animation to see the results of your work. The hair should fade out for a time and then fade back in.
Tweak your timing Moving on
Now that all of the keyframes are in place for the animation, you want to adjust the timing. You do so by adding and removing tween frames between your keyframes. Flash automatically recalculates the tween between keyframes for you. To insert frames into all layers in the stack, position the playhead between the keyframes where you want to insert more frames. Press F5 to add frames. Press Shift+F5 to remove frames. Be sure that you don't have individual frames selected. If you do, you only insert frames on the selected layer. Use this process of adding and removing frames to adjust the timing of the face animations. You've learned the basic of animating in Flash MX. This is only the first step in your quest to become a proficient Flash animator. In Lesson 4, you'll add some interactivity to Face Facts by adding ActionScript to frames and buttons. If you've had no experience with writing script, don't worry; we only scratch the surface of the immense power of Flash MX ActionScripting. Flash makes adding interactivity to Flash movies simple and straightforward. You'll also add text to the project using the Text tool.
Assignment #1
Before you move on to Lesson 4, take a few minutes to do the assignment and take the quiz for this lesson. They help solidify what you've learned. Don't forget to check the Message Board and post any questions you have. You've completed the animation process of adding keyframes to the Timeline and making changes to the symbol properties or shapes at those keyframes. You've tweaked the timing of the keyframes to change the pace of the animation. It often takes time to really make an animation look and feel as you intended. It's a process of adjusting timing, adjusting again, changing a few keyframes here and there, and re-evaluating your work. Rework your animations until you're satisfied with the final looks and timing. Experiment with the Color Properties you used to animate the hair. Use Tint in place of Alpha. Make the hair change color or grow gray. Question 1: What's the red line running vertically through the current Frame called? A) B) C) D) A) B) Player Timeline Framehead Playhead
Quiz: #1
Question 2: What are the frames between the Keyframes called? C) D) A) B) Twains Twins Inbetweeners Tweens
Question 3: What are reusable assets that are stored in the Library called? C) D) A) B) E) F) Signs Cymbals Books Symbols
Question 4: What are the three types of Symbols? (Check all that apply.) C) D) Movie Clacker Button Image Movie Clip Graphic Push Button
Question 5: True or False: To create a Motion Tween on the Timeline, you must use a Symbol. Question 6: True or False: Shape Tweens are used to morph one shape to another. A) B) True False A) B) True False
G)
Graphite
Add ActionScript to your movie
Explore Flash ActionScript
In this lesson, you transform Face Facts from animation into interactive media by adding user control via buttons and ActionScript. You learn to import images into Flash and to add text with the Text tool. ActionScript is the scripting language developed by Macromedia exclusively for Flash. It evolved from small code snippets in earlier versions of Flash into a true object-oriented programming language similar to JavaScript. The syntax of ActionScript is based on ECMAScript, the standardized version of JavaScript. If you know JavaScript, you should have no trouble learning ActionScript.
The Actions panel Control the Player
Many Web sites and books have been devoted to the vast topic of ActionScript. Visit FlashKit , a Web site that addresses all levels of Flash programming and design. This course barely scratches the surface of ActionScript, but we encourage you to explore more ActionScript if you're interested.
Flash MX enables you to add simple scripts to your buttons without advanced programming knowledge. The Actions panel is your interface with ActionScript. To open the Actions panel, select Window > Actions or press F9 on your keyboard. The Actions panel appears near the Properties Inspector. ActionScript can be attached to frames, buttons, and movie clips. ActionScript can even be imported at runtime or loaded externally via other Flash movies. In this lesson, we focus on using frames and buttons to attach ActionScript, as shown here.
In its current state, Face Facts plays from start to finish starting at frame 1. Using ActionScript, you can pass instruction to the Flash Player under certain conditions, such as: When the user clicks a button When the Player reaches a predetermined frame
Because your animation is broken up into sections and you want the user to be able to control which section she views, you need a method to reference each section. You could reference your sections via their beginning frame numbers. Before final tweaking, the eyes section started at frame 1, the mouth section started at frame 30, and the hair section started at frame 60. If you adjusted the timing of your animations as recommended at the end of Lesson 3, your start frames for your sections have changed. Note the start frames in your animation now. Write them down if you need to.
If you use these start frames as a reference for ActionScript, you're telling the Player, "Go to frame X and do something (typically either play or stop)." This method works fine, unless you decide to adjust the timing again or add additional animation in a section. Then you would have to note the start frames again and change your ActionScript accordingly. There's another method that provides you with more flexibility than frame numbers do: labels.
Use frame labels
You give a name to a keyframe with a frame label. No matter what frame number that keyframe has, its label stays constant. It's good practice to create a separate layer for your labels to maintain clarity and layer organization. Add a layer at the top of the layer stack and name it labels. Insert a keyframe in the labels layer at the start of each animation section. You should have three keyframes, one each for eyes, mouth, and hair.
Select the first keyframe in your labels layer, which should be on frame 1 of the Timeline. This is the start frame for the animation of the eyes. Open the Properties Inspector. On the far left-hand side, type the word eyes in the Frame Label input field. Repeat this process to label the other two keyframes in the labels layer. Label each section appropriately, according to its section content: mouth for the mouth animation and hair for the hair animation.
Attach ActionScript to frames
Remember from Lesson 3 that you made each animation section start and end at a common expression (in our case, we had our face smiling and the eyes wide open). Now you'll see the
reason for this. When the user has viewed a particular section of Face Facts, you'll want the Player to reset to the start of that section. No matter which animation the user selects, the animation always returns to the same starting expression. This makes the transitions seem more fluid.
The simplest way to tell the Flash Player to "go back to the beginning when you reach the end" of a section of animation is by attaching ActionScript to keyframes. Insert a new layer above labels in the layer stack and name it script. Like the label layer convention used earlier, it's good practice to put all frame ActionScript on its own layer. Insert keyframes on the last frame of each animation section in the script layer. For instance, if the hair animation starts at frame 60, insert a keyframe at frame 59. When you've done this for all three sections, you should have three new keyframes. You're going to place ActionScript on these keyframes that tells the Player to "go back to the beginning of this section." Select the keyframe in the script layer that is at the end of the eyes section and open the Actions panel by pressing F9. There's written a description at the top of the Actions panel that says something like, "Actions for Frame 29 of Layer Name Script." (The frame number in your case is most likely different.) The Actions panel is divided into two main areas. On the left side is a list of ActionScript commands organized by type and function. On the right is the Actions window where you can see the actual text of the ActionScript you're creating. Click the arrow between the two sections to minimize the list, because you're primarily concerned with the right side of the Actions panel.
There are many ways to add or write ActionScript in the Actions panel. Let's focus on the easiest method, normal mode. At the top left corner of the Actions window is a button with a + sign on it. This button adds Actions to the window and applies them to the keyframe that you selected. Click the Add Actions button and open the drop-down menu, which reflects the list you saw on the left side of the Actions panel. From the drop-down menu, select Actions > Movie Control > goto. In the Actions window you see gotoAndPlay(1);
This is the literal ActionScript code that controls the Flash Player. Above the Actions window are a number of options. At the top of the list, select Go to and Stop. You don't want the animation to loop in this case. If you did, you would leave the Go to and Play option checked. From the Type drop-down menu, select Frame Label. This option tells the Player to look for the labels you created instead of a frame number or one of the other options available. From the Frame drop-down menu, select eyes. You're on the last frame of the eyes animation, and you want the Player to return to the beginning, which, in this case, is the frame you labeled eyes. The Actions window reflect the changes you made and shows: Wasn't that simple? You've just added your first line of ActionScript. gotoAndStop("eyes"); Flash also lets you preview simple frame scripts in the Workspace. Select Control > Enable Simple Frame Actions from the top menu. Position the playhead at frame 1 and press Enter on your keyboard. The playhead plays as normal until it gets to the final frame in the eyes animation, then immediately returns to the eyes frame and stops. Repeat this entire process for the last frames in the other two sections. Remember to be sure the appropriate frame is selected on the Timeline and listed in the Actions panel before you add actions. The script for the last frame of the mouth animation should be For the hair animation, the script is gotoAndStop("mouth"); gotoAndStop("hair");
After you have all the Actions in place, position the playhead at the start of each section and press Enter. The playhead should play through the animation and at the final frame return to the beginning. Minimize the Actions panel so you can watch your animation in action.
Add buttons
You need to add one more Action. Select keyframe 1 in the script layer. In the Actions panel, select Actions > Movie Control > stop. Now, when a user loads Face Facts, the playhead stops at frame 1 and waits until the user clicks one of the navigation buttons before playing any animation. Minimize the Actions panel by clicking anywhere on the title bar of the panel.
Import images
At the moment, there's no way for the user to interact with Face Facts. If you published the movie now, the user would see only the eyes animation. You need to add buttons that allow the user to navigate through the movie.
Photos add interest
When creating animations in Flash, incorporating digital photos can create impact and interest in a way that simple animation won't. HP digital cameras
You'll use images for the graphics in your buttons. Using images instead of vector objects serves two purposes in this course. First, you learn to import images in your Flash movies. Second, using images for the buttons segues into Lesson 5, which covers accessibility issues. Flash enables you to import a number of different image formats. To simplify the process in this lesson, though, we've provided image files for you, so you won't have to create the images first. Download the images, which are in the .gif format. The images are included in a Zip file, buttonsnew.zip . Extract them and put them in the same folder as the faceFacts.fla Flash file. Select File > Import from the top menu. The Import dialog box opens. Navigate to the folder where you saved the images. Select all of the images for the course and click Open. The images are imported into Flash and appear on the Stage. Press Delete on your keyboard. The images are now in the Library like your symbols. To use them in Face Facts, you only need to drag instances of them onto the Stage.
produce exceptional photos, and with large preview screens, you can see the photo on-camera before even transferring it to your computer.
Create a button
» HP Photosmart M527 digital camera series
The images for the buttons are named for the section they control and the state of the button. For instance, btnEyesDown.gif refers to the eyes section of your movie and the down state of the button. We'll discuss button states in more detail a little later. For now, know that there are three images for each button.
Insert a new layer below labels and name it buttons. You'll put the buttons on one layer. This works just fine because you won't be animating the buttons on the Timeline. Make sure the buttons layer is selected in the layer stack. Start each button creation process with the up state of the button, so drag an instance of btnEyesUp.gif onto the stage. Select the image with the Arrow tool. Press F8 to convert the image to a symbol. In the Name field, type btnEyes, and set the Behavior to Button. Click OK.
Understand button states
Using the Arrow tool, double-click the button you just created. The rest of the objects on the Stage fade out a bit and the Timeline shows four frames labeled Up (no mouse activity) Over (mouse over button) Down (left mouse button pressed and in down position) Hit (area within the symbol used to detect mouse activity) The first three frames represent the three possible states of a button symbol in Flash. The states reflect the button's response to the user's mouse. As the button symbol detects the user's mouse activity, it goes to the appropriate frame. When a button is first created, there's a keyframe on the first frame only. If you do not insert additional keyframes, the button uses the first keyframe for all states. Insert keyframes in each of the four frames now.
You can create different effects for your buttons by making changes to the objects in each of the first three keyframes. You could make the button get bigger when the user positions his mouse over the button. You could also change the color of the button when the user clicks the button by changing the color of the objects in the Down keyframe. These are the some of the most basic things you can do in the buttons states. You could place an animated Movie Clip symbol in any of the first three keyframes and make the button animate in response to the user's mouse. In this example, you'll use images that simply change color each of the three button states. The final keyframe, the Hit area, tells the mouse what area to use when determining the button states. The Hit area uses the region that is occupied by the shape in the Hit keyframe. For vector text, it's best to use a rectangle that covers the entire text object for the Hit area keyframe. If you were to use only a text object, the user would have to click exactly on the text object to activate the button; that can be troublesome and annoying. For your buttons, draw a shape in the Hit keyframe that reflects the size and shape of the button in your images.
Create the other button states
In the layer stack, rename Layer 1 to image. Select the Over keyframe in the button Timeline. Select the btnEyesUp image on the Stage, and press the Delete key. Drag an instance of btnEyesOver.gif onto the Stage. In the Align panel, click the To Stage button. With this option selected, all alignment adjustments you apply to objects are aligned to the Stage as well. Click the Align Vertical Center and Align Horizontal Center buttons in the Align panel to align the image to the center of the Stage. Remember, you're in the button's Timeline and not the main Timeline. Each Timeline has its own Stage. The alignment you made put the image in the direct center of the buttons Stage, not the main Stage. Aligning all the images to the center of the button Stage ensures that the images are lined up properly and don't appear to jump out of place when the user interacts with them. Select the Down keyframe in the button Timeline. Select the btnEyesUp image on the Stage and
press the Delete key. Drag an instance of btnEyesDown.gif onto the Stage. Align this image to the center of the Stage using the same process described above.
Select the Hit keyframe in the button Timeline. Insert a new layer above the image layer. Name this new layer hit . Insert a keyframe in layer hit for the Hit frame. Using the Oval tool, draw an oval that overlays the button image. You may need to scale and adjust the Oval with the Free Transform and Arrow tools to accurately place it over the oval in the image. When you're satisfied with the Hit shape you've drawn, select the btnEyesUp image on the Stage and press the Delete key. Your button Timeline should look similar to Figure 4-1.
Figure 4-1: This is the final button Timeline with images on the Up, Over, and Down keyframes and the Hit shape drawn on the Hit keyframe. To edit the main Stage and Timeline, double-click anywhere on the Stage. Repeat the process you just learned to create the two other buttons: Mouth and Hair.
Add text
You now have three buttons on the Stage: Eyes, Mouth, and Hair. Align them horizontally to each other and distribute them across the Stage. There needs to be only one keyframe in frame 1 of the buttons layer. Tween frames to last frame of animation to ensure that the buttons always remain on Stage and don't disappear. Flash normally inserts these tween frames to the end of the Timeline for you. To create text to describe the three animations sections, first insert a new layer and name it text. From the Toolbox, select the Text tool, which is used to add text to your Flash Movies. Open the Properties Inspector to see all of the options for use with the Text tool, such as font, size, and color. We chose Futura Book, with a Font Size of 20, and white as the color. Choose an initial font setting for your text. You can change these settings later as needed. Click and drag a box on the Stage where you want to place the text. We put ours below the buttons, as shown in Figure 4-2. An input cursor and field appear where you click. In the field, type In Character animation, the eyes are one of the most important features. They are the feature that the audience generally identifies with first.
Figure 4-2: We placed text below the buttons.
Use the Arrow tool to select the text you just created. In the Properties Inspector, adjust the settings for Font, Size, and Color until you're satisfied with the results. You may also need to fine-tune the position of the text. Use to the Arrow tool to move the text into the desired position. Insert a keyframe in the text layer at the beginning of the next animation section. It has the same frame number as your mouth frame label. Make sure that this new keyframe is selected. Doubleclick the text on the Stage to edit the text. Replace the text in this keyframe with In conjunction with the eyes, the mouth signifies a character's mood and expression. Insert a keyframe in the text layer for the final animation section. It has the same frame number as your hair frame label. Make sure that this new keyframe is selected. Double-click the text on the
Script the buttons
Stage to edit the text. Replace the text in this keyframe with A character's hairstyle or lack thereof can radically influence his or her persona. You've now positioned text that describes the animation for each section of Face Facts.
You're nearing the end of your scripting work on Face Facts. It's time to add the script to your buttons. Select the btnEyes button symbol by clicking it once, and open the Actions panel by pressing F9. Click the Add Actions button, open the drop-down menu, and select Actions > Movie Control > goto. In the Actions window, you should see this code: on(release){ gotoAndPlay(1); }
Download the source
The on (release) portion of the code is specific to buttons, and Flash inserts this code for you. Make sure that the gotoAndPlay portion of the script is selected in the Actions window. In the Type drop-down, above the Actions window, select Frame Label. In the Frame drop-down menu, select eyes. The Actions window reflects these changes and shows this code: on(release){ gotoAndPlay("eyes"); }
Download this zip file that contains the source files and this buttons.zip to see the techniques in this lesson at work and try them for yourself.
Minimize the Actions panel. In the top menu, select Control > Enable Simple Buttons so that you can test simple button functionality within the Flash Workspace. Make sure that Enable Simple Frame Actions is also selected in the Control menu. Position your mouse above the Eyes button. The mouse cursor should change to the hand icon similar to the one used in Web Browsers. If you did everything right, the button should switch to the Over state and turn green. Click the Eyes button to play the eyes animation.
Test your movie another way
Here's another method to test you movies. In the top menu, select Control > Test Movie or press Control+Enter ( Command+Enter on a Mac) on your keyboard. Flash generates a new window and shows your movie. This window is running your movie with the Flash Player. Testing your movie in this way is more reliable than using the Enable Simple Buttons and Enable Simple Frame Actions methods because you are seeing the actual Flash movie in the Player.
Click the Eyes button and play the eyes animation. Now, click the button, let the animation play for a second or two, and before it completes its cycle, click the button again. Notice that the second time you click the button, the animation stops. This is caused by the stop Action on frame 1. When you click the Eyes button, you're telling the Flash Player to return to frame eyes and play. The Flash Player does so. It returns to frame eyes, which is also frame 1, the frame where you inserted the stop Action. The Player encounters this stop Action and executes the script, stopping the playhead in the process. There's a simple fix for this problem that you'll learn now.
Close the test window to get back to the Workspace. Select the keyframe eyes in the Timeline. Now, click and drag the keyframe one frame to the right, placing it at frame 2. Now when the Eyes button is clicked, the Player goes to frame eyes but does not encounter the stop Action on frame 1. Press Control+Enter ( Command+Enter on a Mac) on your keyboard and test your movie again.
Add actions to the other buttons
Select the Mouth button on the Stage. Open the Actions panel, click the Add Actions button, and select Actions > Movie Control > goto. Make sure that the gotoAndPlay portion of the script is selected in the Actions window. In the Type drop-down, above the Actions window, select Frame Label. In the Frame drop-down menu, select mouth. The Actions window reflects these changes and shows: Repeat this process and add the appropriate Actions to the Hair button. Be sure to select hair as the label in the Frame drop-down menu. The Actions window shows: on(release){ gotoAndPlay("mouth"); }
Moving On
Test your movie again. Click all three buttons to test each section. Make sure that the text shows up at the appropriate time. on(release){ gotoAndPlay("hair"); } In this lesson, you learned to create buttons that control the main Timeline, to import images for use in your movies, and to use frame labels and Actions. Although a somewhat simple project, Face Facts contains all the basic groundwork you need to create more advanced Flash projects. Apply
what you've learned and hone your skills on your own and by completing the assignment and taking the quiz. Visit the Message Board to see what your fellow students are up to, and to post any questions you may have.
Assignment #1
In Lesson 5, you learn about Web accessibility and the importance of considering the disabled as an important part of your audience. You'll then use the new accessibility features of Flash MX, and finally publish your movie. Now that you've added the interactive functionality to Face Facts, do you see any additions or modification you'd like to make? Here's a suggestion. Using what you learned in Lesson 3 about keyframe animation, make the text that describes the animations fade in as the animation plays. Animate the Alpha property as you did for the hair. The process is quite similar. Hint: The Alpha for the text needs to be 100 percent on the first keyframe of each animation section. Remember, when the playhead gets to the end of an animation section, it returns to the labeled keyframe and then stops. The fade-in animation needs to start after the labeled keyframe. Question 1: True or False: The Script panel is where you add ActionScript to your movies. Question 2: True or False: ActionScript can only be attached to Buttons. Question 3: What method can you use to reference Frames in ActionScript other than Frame numbers? A) B) C) D) A) B) A) B) E) F) A) B) Size Elapsed Time Labels FPS A) B) True False A) B) True False
Quiz: #1
Question 4: True or False: When you import an image into Flash, it's stored in the Library. Question 5: What are the four Frames on the Timeline of a Button labeled? (Check all that apply.) C) D) Up Off Pressed Over Down True False
Question 6: Which of these snippets of code will tell the Playhead to move to a labeled Frame and play? C) D)
Hit
gotoAndPlay(1); gotoAndStop("foo"); gotoAndPlay("foo"); gotoAndStop(2);
Publish for everyone
Inclusive Web design. Lesson 4 discussed the basics of ActionScript, Flash's native scripting language for interactivity. You used your ActionScript knowledge to provide interactivity and animation to your Flash movie, Face Facts. Now that you've completed your movie, you need to publish it for your friends and other Internet users to enjoy.
Get connected
Know your audience
Keep in mind that not everyone can experience your content in the same way. Flash Player provides a consistent medium for presentation of Web content, so why wouldn't everyone experience it the same way?
With an HP notebook PC and a wireless WAN card, you have the freedom to work in Flash from nearly anywhere.
The Internet is a medium for information dissemination. Anyone should be able to access your Web page information, even if he's not a typical Web user. For example, someone may have a slow Internet connection or an old computer. It's unlikely this person would get exactly the same experience as someone with a fast connection on a new computer.
The main group of atypical Web users we want to emphasize is the disabled. There are Web users with many types of disabilities, including Blind or low-vision users: Those who are either completely blind or have great difficulty seeing a computer screen. They may need a large format display or they may need to have screen text spoken to them. Most Web accessibility concerns revolve around this group. Deaf users: These people can't hear the audio feedback of a Flash interface or the soundtrack of a Web video. Since we're not using audio in this course, we aren't concerned with deaf users for now. If you continue Flash development and decide to incorporate audio, you should be mindful of this group's special needs by providing subtitles, alternate visual feedback, or some other audio equivalent. Mobility-impaired users: Some people aren't able to use a typical pointing device like a mouse. (And some nondisabled people even prefer using a keyboard instead of a mouse.) For this group, you need to make your Flash movie accessible from the keyboard, relying on the mouse only as a supplemental input device. Color-blind users: These people typically have trouble distinguishing between red and green colors, although many other types of color-blindness exist. Statistics show that about 1 out of 12 people has some sort of color vision deficiency. For these users, you must not use color as the only distinguishing factor in an interface. For example, don't use the phrase "Press the green button for Yes and the red button for No." Users with cognitive learning disabilities: This category can be very broad, ranging from disabilities such as dyslexia to severe mental retardation. Due to the wide scope of needs in this group, it's difficult to plan specific accessibility features, but we'll discuss some accessibility guidelines that help all people, including those with learning disabilities. There are many different types of disabilities affecting people today. Chances are that you know a person with a disability of some kind. Your course authors are not disabled in any way -- other than perhaps some slight hearing loss from loud music -- but we feel strongly that the disabled can never have too many advocates. We hope this lesson raises some awareness for their benefit and we hope you'll keep their special needs in mind as you continue Flash and other Web content creation.
» HP Wireless wide area network (wWAN)
Enable the disabled
Let's discuss some specific accessibility challenges that affect these users and how AT (Assistive Technology) can help.
Standards and laws regarding Web accessibility
To provide a usable experience for people with disabilities, you must first understand the accessibility challenges they face, and the tools they use to overcome them. There are several standards and laws regarding Web accessibility that you should probably know about.
Visit an inaccessible Web site
Section 508, the name commonly used for Section 508 of the Rehabilitation Act of 1973, as amended [29 U.S.C. ?794(d)], requires that government, educational, and many other public Web sites adhere to a standardized set of accessibility guidelines. You can learn more about these guidelines on the Section 508 Web site or on the Access Board Web site .
The DRC (Disability Rights Commission) recently published an inaccessible Web site demonstration in Flash. The demonstration simulates how users with disabilities might experience a Web site that does not have essential accessibility features. There are demonstrations for low-vision
The W3C (World Wide Web Consortium) is an international Web standards body and think tank selfdescribed as "a forum for information, commerce, communication, and collective understanding" about the World Wide Web. The W3C's WAI (Web Accessibility Initiative) has issued many recommendations of Web technology including one for Web authoring standards called the WCAG (Web Content Accessibility Guidelines). The Web Content Accessibility Guidelines are split into three levels of recommendations: Priority 1 or Level A: Web content must satisfy this checkpoint. Priority 2 or Level AA: Web content should satisfy this checkpoint. Priority 3 or Level AAA: Web content may satisfy this checkpoint.
and mobility-impaired users, as well as a screen reader simulation of a blind user's experience.
WCAG Level A covers the highest priority regulations, and should be considered a bare minimum for accessible Web content. Content must satisfy this checkpoint or some disabled users will find it impossible to access the information. For the most part, Section 508 and WCAG Level A cover the same topics and recommendations. Levels AA and AAA cover other recommendations to make content more accessible and usable, but these are not technically required for an accessible Web site. For an in-depth analysis of the differences between Section 508 and WCAG Level A, read the side-by-side comparison on Jim Thatcher's Web site (. htm).
Explore accessibility challenges and assistive technology
Help low-vision and blind users
We encourage each of you to read the guidelines because they're invaluable resources for understanding Web accessibility as a whole. (Despite the technical look of the document, the Web Content Accessibility Guidelines are written in plain English and are quite easy to understand.) AT (Assistive Technology) refers to tools or services used to improve the capabilities of a person with a disability. AT can provide a more enjoyable and manageable user experience for the disabled. Let's look at several specific AT devices commonly used today. The accessibility challenges we're discussing mainly revolve around vision-impaired and mobilityimpaired users. These groups typically have the most difficult experiences with inaccessible Web content and therefore justify most of our consideration.
Low-vision users (some are designated as legally blind) can see but most likely have difficulty reading small screen text. If possible, allow resizable text on a Web page or Flash movie. Many of these people use a program called a screen magnifier that enlarges all or a portion of their computer screen. Some of you may already have a simple screen magnifier installed on your computer.
Windows 2000 and Windows XP users can find their screen magnifier by selecting Start > Programs > Accessories > Accessibility > Magnifier. Mac OS X users can find their screen magnifier by selecting the Apple Menu > System Preferences > System > Universal Access > Seeing > Turn On Zoom. Blind and mostly-blind people typically use an AT device known as a screen reader. As you learned in Lesson 1, a screen reader is a computer program that speaks screen text out loud to blind or lowvision users. The most commonly used screen readers are JAWS by Freedom Scientific Window Eyes by GW Micro Home Page Reader by IBM Each one has different features and behaviors, although your goal remains the same: to provide your content in an accessible way so that everyone can use it.
A screen reader can access text on the screen, but cannot describe images, graphics, or illustrations. You can overcome this problem by providing a text alternative -- that is, associating a bit of text with a non-text piece of content. When the screen reader encounters this item, it speaks the text alternative you provided. You'll learn how to provide text alternatives for Flash graphics on the next page.
Help mobility-impaired users
Users with mobility impairment may be unable to use a mouse or may use a different kind of
pointing device like a light pen or joystick. Some users, such as those suffering from carpal tunnel syndrome, may prefer to use a keyboard even though they're physically able to use a mouse.
Make Flash accessible
Whatever the situation, you should set up your Flash interface so that the use of a mouse is not required. You'll learn how to make Flash objects accessible from the keyboard and how to create a logical tab order through your Flash movie in this lesson. Macromedia has significantly improved the accessibility features of Flash with the release of Flash MX. If you're familiar with previous versions of Flash, you may have noticed some of them already.
The best of both worlds
Flash has many accessibility features that are outside the scope of this course, so for now, you'll only learn about the most important ones: text alternatives and tab order. Text alternatives help people using screen readers, and a logical tab order helps everyone using a keyboard. Use your tab key on the movie below to see for yourself.
Use the Accessibility panel
The Accessibility panel is a feature that enables you to provide text alternatives for each piece of your Flash Movie. Double-click an empty area of the stage to reset the Property Inspector to its default settings, shown in Figure 5-1. The Accessibility icon (a white figure on a blue circle) is on the right side of the Property Inspector. Figure 5-1: The right side the Property Inspector displays a blue Accessibility icon.
It used to be that in order to have the freedom of a notebook PC, you had to sacrifice performance. HP notebook PCs are the best of both worlds: the performance of a desktop, the mobility of a notebook, and at a price you can afford.
Macintosh users who found their screen zoom settings will recognize this as the icon used for the Universal Access control panel in the OS X System Preferences. Click the Accessibility icon to open the Accessibility panel or select Window > Accessibility from the program menus. Because the Property Inspector is a contextual menu, the Accessibility icon may not always be available, but you can always open it from the Window menu. Like the Property Inspector, the Accessibility panel's contents are contextual. Figure 5-2 shows a few possibilities of how the panel may appear.
» HP Compaq nc4200 notebook PC series
» Notebook buying guide
Figure 5-2: The contents of the Accessibility Panel change depending the object that's selected. View a larger version of this image.
The panel on the left displays the accessibility options for the Stage and movie. The middle panel shows the options typically available for symbols, such as buttons or movie clips. A disabled Accessibility panel is on the right -- plain shapes, like the ones you drew in Lesson 2, cannot have accessibility options applied to them.
Make your movie accessible
Set the accessibility options for your Face Facts movie: Make Movie Accessible: This checkbox enables screen readers to speak text sent from the Flash Player. With very few exceptions, this should remain checked. Make Child Objects Accessible: Leave this checkbox checked to make your buttons and body text accessible. Auto Label: A check here enables Flash to generate button and form labels automatically. For example, if you use plain text for buttons instead of importing raster graphics, you wouldn't have to explicitly label them. Flash can automatically look for text on, inside, or near an element and auto-label it. Name: Brief text that will be read in association with your movie. Name is the Flash equivalent
Make your buttons accessible
In Lesson 3, you imported raster graphics to use as buttons. If you had used Flash text for your buttons, labeling them would be unnecessary, but since you didn't, you need to explicitly label each button. With the Accessibility panel open, select the Eyes button on the Stage. The Accessibility options change, and here's what to do:
of an HTML alt attribute. Type the words Face Facts into this field. Description: This field is for an extended description, should one be needed. Description is the Flash equivalent of an HTML longdesc attribute. Unless you want to add some other text here, you may leave this field blank.
Make your face graphic accessible
6. Repeat these steps for all three buttons.
If you'd like to use the Shortcut field, read up on Providing Keyboard Shortcuts and see "Capturing key presses" in Macromedia Flash Help (. com/macromedia/accessibility/features/flash/buttons_forms.html).
1. Leave the Make Object Accessible checked. 2. Uncheck the box labeled Make Child Objects Accessible. This is irrelevant because the buttons have no child objects, but do it for good measure. There are other reasons to uncheck this box that we'll discuss later. 3. Type the button name in the field labeled Name. This text should correspond exactly to the text that is visible on the each button. For the Eyes button, type Eyes, for the Mouth button, type Mouth, and so on. 4. The Description field could also be left blank for the buttons. If you wanted to add something here, a possible sentence might be, "Learn the importance of eyes in animation." Our content is short, though, so a description is unnecessary and possibly redundant. Consider using Description if you have larger amounts of content. For example, if you use Flash for a complete Web site, a button Name might be Company Info and its Description could be "Information about our company. Learn who we are, what we do, and how to contact us." 5. Ideally, the Shortcut field provides a single keystroke to access a button, although getting it to work requires more ActionScript than we cover in this course. This is the closest equivalent to the HTML accesskey attribute. For now, leave this field blank.
To make your face graphic accessible, you need to determine the level of detail you want to provide to disabled users. Not enough information can make for a useless movie, but too much information can make for an unusable movie. In future development, you'll have to weigh these options on a case-by-case basis. Since we used Graphic Symbols on the main timeline, no accessibility features are available for the Face graphic. If this entire graphic had been a Movie Clip symbol, you should probably not make the child objects accessible, but make up for it by providing a detailed Description. You decide what that description should be. The Name field should be something short and literal, such as Animated illustration of a face.
In Face Facts, your primary accessibility concern is to provide access to the button names and related textual content. The animation is an added benefit for sighted users, but it's not necessary to understand the content.
Set logical tab order
Remember that some users may access your Flash movie without a mouse. These users primarily use a keyboard and will navigate through your content using the Tab key. For this reason, it's important that you give your buttons a logical tab order.
An object on the main stage can be accessed from ActionScript as _ root. plus, the instance name of the symbol. You gave each of your buttons a unique instance name: btnEyes , btnMouth , and btnHair . Make a new layer on the Timeline. Name this layer tabIndex, and open the Actions panel by selecting Window > Actions. In the left column of the Actions Panel, select Actions > Variables >
The tabIndex property is an integer (number) that defines the tab order. This property is equivalent to the tabindex attribute in HTML. You can access the tabIndex property of any button by the variable _root.instanceName.tabIndex .
set variable. In the Variable field, type _root.btnEyes.tabIndex and in the Value field type 1. Repeat this process for the other two buttons but use the values 2 and 3. When you're finished, the ActionScript code you've written should match the following: Figure 5-3 shows the Actions Panel in the finished state. _root.btnEyes.tabIndex = 1; _root.btnMouth.tabIndex = 2; _root.btnHair.tabIndex = 3;
Figure 5-3: Provide a logical tab order by assigning the tabIndex property through the Actions panel. View a larger version of this image.
Previously you've used the Publish Preview feature by pressing Ctrl+Enter ( Command+Enter on the Mac). Unfortunately, the preview function is not accessible to the keyboard so you won't be able to test the tab order until you really publish your movie. Once you do, I encourage you to come back to this script and rearrange the tab order, just so you can better see how it works. You only have three buttons, so this tabIndex step was probably unnecessary; however, if you build an interface with many buttons, the automatic the default tab order may not be logical. Now if you run into an illogical tab order, you'll know how to fix it.
You'll learn how to publish your movie on the next page.
Publish your movie
Bob Regan, head of the Macromedia Flash accessibility division, maintains a Web log dedicated to the Accessibility features of Flash (). This Web log is an invaluable resource for anyone interested in accessible Flash development.
Publish as Flash
You're finally ready to publish your movie. We know you're excited, but this won't take much longer.
Download the source
Select File > Publish Settings. On the Formats tab is a list of checkboxes and filenames. For the default setting, you have only the first two checked: Flash (.swf) and HTML (.html). These are the ones you need to publish a Web page. If you'd like to name your HTML file something other than faceFacts.html, uncheck the box labeled Use default names. You may want to make it a directory index such as index.html. On the Flash tab, you can select the Flash Player version you would like to use. This is a useful setting for backward compatibility, but you need to leave it as Flash Player 6 or none of the accessibility features we included will be used. Leave the other settings alone as well.
Download this zip file that contains the source file and to see the techniques in this lesson at work and try them for yourself.
On the HTML tab, find the Template field. Use the default setting Flash Only, but take the time to look over the other templates, because you may need to use some of them in the future. For example, Detect for Flash 6 includes a JavaScript function that writes in the Flash object only if the user has the Flash Player 6 plug-in installed. A detailed analysis of these templates is beyond the scope of this course, but check the resources in Lesson 6 for help in this area.
If you consider yourself HTML-savvy and understand scripting variables, you may want to modify the default HTML templates. Most Windows users can find them in C:\Program Files\Macromedia\Flash MX\First Run\HTML. Most Mac OS X users can find them in /Applications/Macromedia Flash MX/First Run/HTML. The template files are plain HTML but include a few variables such as $WI for width, $TI for title, and so on.
One modification we made was to place the Movie Text variable ( $MT ) inside the <embed> element. This can benefit people using browsers incapable of receiving Flash content, such as the text-only browser, Lynx. Please be careful when modifying these templates. If you break them, you'll have a hard time finding replacements and may need to reinstall the program. It's far better to save a copy to create a new custom template (open a template and immediately Save As, using a different filename than the original).
In the Publish Settings dialog window, click OK to confirm your changes. Now select File > Publish or press Shift+F12 on your keyboard. That's it. You're done.
Use other publishing formats
You can view these files in the same directory where you saved faceFacts.fla. If you would like to publish them to your Web site, upload the SWF and the HTML files using any FTP (File Transfer Protocol) program, such as WS_FTP for Windows or Transmit for Mac OS X. Flash can export to a variety of formats including, but not limited to, the following: Windows AVI Quicktime MOV Animated GIF Sequence of images in various formats
The benefit of publishing in other formats is that someone may be able to receive this other type of content, but not Flash. For example, Flash can be used (or abused) to create Intro Movies. A user without Flash cannot view this movie but might be able to view an AVI or Quicktime video.
You can publish in these other formats by selecting File > Export Movie. In the Save as type field ( Format on a Mac), select the file type and click Save. You can also publish as a stand-alone projector file for Windows or Macintosh from the Format tab in the Publish Settings dialog window.
Moving on
If you use XHTML and would like your Flash pages to validate, read Issue No. 154 of A List Apart, Flash Satay ().
Take the time to do the assignment and take the quiz for this lesson. They'll help you assimilate what you've learned. As always, should you have any questions, please bring them to the Message Board.
Assignment #1
In the next and final lesson, you learn some more tips and tricks for progressing your knowledge of the Flash Authoring Tool. We provide you with best practices techniques and a list of resources where you can learn more about Flash. Play around with your publish settings to see what works best for you. Go back and modify your tabIndex settings to see the effect it has on your movie.
If you have access to a Web server, use an FTP program to upload your files to your Web server and share them with the class by posting the URL to the Message Board. Unless you used the class example files, everyone's Flash movie will look slightly different, and it's always interesting to see other people's interpretations. You may want to try publishing in other formats as well. Send the URL to your friends and show off what you've learned! If you're feeling especially industrious, use what you've learned to make a new Flash movie of your own creation. Publish it and post another note to the Message Board. We'd love to see it. Question 1: What type of disabled users should you consider when developing accessible Web content? A) B) C) Vision-impaired users. Hearing-impaired users. Learning-impaired users.
Quiz: #1
Question 2: The Web Content Accessibility Guidelines state that which of the following must be met for Web content to be accessible? Question 3: Which of the following is not a popular screen reader? A) B) C) D) A) B) Home Page Reader Window Eyes JAWS Web Speaker A) B) C) Priority 1 or Level A Priority 2 or Level AA Priority 3 or Level AAA
D)
All of the above.
Question 4: Which of the following is the correct way to access the tabIndex property of a Flash symbol in ActionScript? C) D) A) B) E) A) B)
_root.tabIndex.instanceName _root.instanceName.tabIndex _root.tabIndex
Animated GIF Windows AVI Motion JPEG
Question 5: Flash MX can publish to all of the following formats except ____.
_root.symbol.instance.tabIndex
Question 6: True or False: In the Flash MX Accessibility Panel, you should always check the box labeled Make Child Objects Accessible.
C) D)
Stand-alone projector True False
Quicktime MOV
Keep learning
What's next?
This course teaches you the basics of Flash publishing, but Flash has much, much more to offer. This lesson discusses what you've learned and where to go to find more information. Learning Flash MX can be a daunting task. As with any program, it's best to learn in small chunks. We touched on many of the basics in this course, but you'll have to learn the rest without our help.
Printing your tutorials
Import material into Flash
Don't worry. There are lots of things to learn and lots of people on the Internet willing to help you learn them. We'll give you a few topics to research and, later on, a list of resources to help you along the way.
You know how to import raster graphics to use as buttons, but that's only one of the many things you can import in Flash MX. Let's take a look at some of the other material you can import through File > Import: Other raster graphics: In Lesson 4, you imported GIF images to use as buttons for the movie, Face Facts. Flash also allows you to import other raster graphic file formats, such as JPEG (Joint Photographic Experts Group) and PNG (Portable Network Graphic). The JPEG format can save you file size on imported photographs. The PNG format supports a native alpha
When working in Flash, it helps to have hard copies of tutorials and courses to consult easily while you're trying new effects. Print out your guides with an HP LaserJet, capable of printing multipage documents without missing a beat, and at a price you can afford.
» HP LaserJet 1022 printer series
There are other ways to import content into Flash, too. Some of them can even be done on-the-fly -that is, while a person is viewing your Flash movie. Import external ActionScript files by using the #include directive in the first frame of your movie. Importing ActionScript is beneficial because it enables you to share your plain-text script library across many Flash movies. It also enables you to centralize all your code instead of adding snippets in many different places throughout the FLA file. Here's the syntax for importing an ActionScript file: #include "myCustomScripts.as" Notice that the #include directive does not have a semicolon ending the statement. This is a special case and causes an error if you include a semicolon.
channel that allows partial transparency on certain pixels. Experiment with each format because they all have different benefits. Vector graphics: Flash has the capability to import graphics from other vector-based drawing programs, such as Macromedia Freehand or Adobe Illustrator. Vector graphics are especially useful for their small file size and infinite scalability. Audio: Flash can import many different sound formats, such as MP3 and WAV. You can effectively use audio in Flash to produce short sound effects or even a longer soundtrack for your entire movie. Video: Flash MX can import and control video with ease. You can import video file types such as MOV, AVI, WMV, MPG, and so on. Other Flash movies: One of the coolest things about Flash is its capability to import other completed Flash movies in the SWF format. Start small. You can save little movies and then import them as symbols to a larger movie when you're ready.
» HP Care Pack services
You can also import text content on-the-fly to load into your movie. The benefit of this is that you can separate your content from your Flash movie. As plain text, it's easier to update and could even be generated from a server-side scripting language, such as PHP (PHP Hypertext Preprocessor). Flash application developers commonly use XML (Extensible Markup Language) data. Flash can import and parse XML data for use in advanced applications. For example, Google provides XML data via its Web Services APIs , so you could theoretically build a Flash search engine running on Google content.
Import external symbol libraries to share all your Flash objects across multiple files. Instead of having to re-create objects each time you create a new movie, you can start with your symbol library ready to go.
Use audio
You can use audio in Flash to provide background music, sound effects, or other aural feedback. If you play a song in the background, it's common courtesy to give the user a way to turn off the music. If you provide sound effects on your buttons or other areas, remember, "Less is more." A Flash Web page is not a video game (although it could be) and users can quickly be turned-off by annoying or loud sounds. Be tasteful in your audio choices.
One common use of Flash audio is to provide an audio alternative for vision-impaired users. You may want to record your own voice and use it for button sound effects in your Face Facts movie. For example, when you mouse over the Eyes button, the sound-effect could speak the word eyes. Audio feedback like this can help people with learning disabilities, too. If you add audio to the button, you may want to uncheck the Make Object Accessible box in the Accessibility panel so that the screen reader and your additional audio do not conflict. For an example of this type of audio feedback in action, view one of the Homestarrunner Main Menus ().
Audio can be used to enhance the experience of a vision-impaired user, but be sure to consider a deaf user's needs when adding audio. If the soundtrack provides essential information, you should include an option for subtitles.
Use video
If you're interested in providing subtitles for your videos, research MAGpie (Media Access Generator -), developed by the National Center for Accessible Media (NCAM).
Since Internet connections are getting consistently faster, you may want to include video in your Flash movie. Keep in mind that video files are very large and can load slowly even on a broadband
connection.
Flash MX provides much more control and incorporation of video than previous versions of Flash. Find out more about video in Flash at the Macromedia Flash Support Center .
Learn advanced ActionScripting
Understand SWF
If your video includes essential information, try to include an alternate audio track for visionimpaired users. This alternate audio track is common on DVDs and provides a spoken description of the video in between sections of dialog. We highly encourage you to learn as much as you can about Flash's native scripting language, ActionScript. Although you don't need much for basic Flash authoring, using more advanced ActionScript can unleash an enormous amount of control and interactivity. The possibilities are endless.
For more information about advanced ActionScript, scour the resources section at the end of this lesson.
Macromedia recently released the Flash movie format, SWF, as an open format. What this means is that any number of applications can bypass the Flash Authoring Tool and write SWF files by themselves. Vector drawing applications, such as Adobe Illustrator and Macromedia Freehand, can save directly as a SWF file, although of course you cannot provide animation from those programs. Even some video editing programs can export as SWF and include the video directly. In our opinion, the best benefits of the open format are modules and libraries for various server-side scripting languages like Ming for PHP. These modules enable developers to create Flash movies directly from plain text programming code. Look at some examples of Ming for PHP (). If you're interested in how the SWF files are created, all the source code is freely available. PHP and Ming are both open-source and free. If you have access to a Web server, you may request that your server administrator install the Ming module for PHP. Now that you've learned what you can do, let's take a look at what not to do.
Watch out for these mistakes
Beginning Flash authors tend to make a lot of the same mistakes. You, as a beginning Flash author, are no exception. Mistakes can be frustrating, but what you learn from them helps you avoid them in the future.
Avoid letterforms as Hit areas Don't rush to play
Although making mistakes is a beneficial part of programming, we'd like to tip you off to a few mistakes we've made at times, so that our experience might save you some of the headaches and nail biting we've been through.
We can help you continue your learning process
Technical expertise, IT education, and user training have never been easier to purchase or to implement, thanks to HP.
If you use plain text for your buttons, make sure you include a larger Hit area instead of just using your letterforms. The reason becomes obvious in practice.
If you use only letterforms as your Hit area, the button activates only when the mouse is exactly over the letter. Any transparent space between letters or even inside of a letter does not activate the button. For example, if you used a text-only Hit area for the Mouth button in your movie, Face Facts, the button would not activate inside the letter O. Instead, the user would have to click the outline of the letter. One common mistake is to play a movie before it is fully loaded. Sometimes it isn't necessary to preload a movie, but in many cases it can help. Because not everyone's Internet connection is the same, your Flash movie can take longer to load on some people's computers.
» HP Total Education One
Face Facts is relatively small piece, so preloading is probably not necessary, but you may want to preload your larger movies. It's common to place a loading graphic at the beginning of your movie and import any external files on frame 1. We sometimes make a preloader by placing a frame looping Movie Clip on frame 1 of the main movie. We also need a stop() command in frame 1 after
all the imports.
We can check to see if a movie is completely loaded by comparing the number of frames already loaded to the total number of frames in the main movie ( _root ). This preloader might go on frame two of the Movie Clip symbol: Or, by comparing the file size loaded to the total file size of the movie: if(_root._framesLoaded < _root._totalFrames){ prevFrame(); } else { _root.gotoAndPlay(2); } if(_root.getBytesLoaded() < _root.getBytesTotal()){ prevFrame(); } else { _root.gotoAndPlay(2); }
In plain English, these bits of code mean, "If the main movie is not fully loaded, go back one frame in the child Movie Clip." Because the Movie Clip is playing, frame 1 plays on through to frame 2. With this code on frame 2, it runs again. This loop continues until the movie is completely loaded, and the ActionScript starts the main movie playing on frame 2. Don't worry if you don't understand all of that yet; just realize that preloading your movie can prevent jumpy animation or trying to play a frame that hasn't loaded yet. In the same way, you can get a logic error in ActionScript if you refer to a function, variable, or object before it is loaded. We'll get to logic errors in the next section. Like any programming language, ActionScript has the possibility for errors. There are two main types of errors in programming: syntax errors and logic errors. Syntax errors are caused by code that does not follow the basic syntax of the language. For example, you may forget to close a quoted string: var foo = "test; // missing second quote Fortunately, syntax errors are usually easy to track down because the program knows where they are. You will never have a syntax error if you use Normal Mode in the Actions panel. If you type a syntax error while in Expert Mode, you cannot switch back to Normal Mode. Instead you get a message that says, "This script contains syntax errors. It must be edited in Expert Mode," as shown in Figure 6-1.
Common ActionScript mistakes
Figure 6-1: If you type a syntax error into the Actions panel under Expert Mode, you have to fix it before you can return to Normal Mode. View a larger version of this image.
There are many different reasons for logic errors. Unfortunately, these errors can sometimes be very difficult to track down. We cannot go over all the different possibilities of logic errors, but we can give you an example: gotoAndPlay(myFrame);
The syntax of the preceding statement is fine. The function is valid and it's passed one variable. The variable, myFrame , should either be a frame number (integer) or a frame label (string). Because it's a variable, though, its value might change before this statement runs. myFrame could contain a frame label that does not exist or may refer to a different data type, such as an object or floating point number (decimal). You can usually use the Trace Window and the Script Debugger to find logic errors. If you get an error on a piece of code like this statement, try the following: trace(myFrame); gotoAndPlay(myFrame); Now use the Publish Preview, and the Trace Window will show the current value of the myFrame variable, just before the error is thrown. If it's the wrong type, this could tip you off to finding the bug.
Understand case sensitivity in ActionScript
Because the trace() function is used only for debugging, you do not need it for the final output of your movie. Select File > Publish Settings > Flash tab, and check the box labeled Omit Trace actions.
In programming, case sensitivity means that uppercase and lowercase letters are treated as completely separate characters. If a language is fully case sensitive, foo and Foo are not the same word. If a language is not case sensitive, or case insensitive, foo and Foo are the same. ActionScript is partially case sensitive, meaning that some words (like the reserved keywords if , while , and so on) are case sensitive and some (like custom variable names) are not. This can be confusing, but it was done to ensure backward compatibility with Flash 4 and Flash 5 ActionScript. Although certain words in ActionScript are case insensitive, we encourage you to treat everything as if it were fully case sensitive. Precision coding helps you avoid errors.
Compare frame loops versus script loops
If you have trouble tracking down an error, check the case of your code. It's quite common for beginning programmers to overlook case-sensitivity.
In the preloader example, you saw an example of a frame loop. A frame loop is a bit of code on one frame that conditionally sends the playhead back to a previous frame. When the playhead returns to the original frame, the conditional code runs again. A frame loop is a common way to run the same bit of code over and over. There are other types of loops, called script loops, which you can use with ActionScript. They include for loops and while loops. Script loops have their place, but sometimes it's better to use a frame loop. For example, we could have done our preloading with a while loop. Do not use the following bit of code. It has a few unfortunate side effects we will discuss.
In plain English, this code means, "If the movie has not fully loaded, wait." Ideally, this code accomplishes the same thing as the previous preloader. In practical use, however, it can cause problems. While the script loop is executing, the Flash Player plug-in can do nothing else. This means that the Web browser may freeze or the computer may even appear to crash. while((_root._framesLoaded < _root._totalFrames){ 0; // this line does nothing }
The Flash Player has a built-in mechanism to avoid infinite loops in ActionScript. Like it sounds, an infinite loop is a loop that never stops. The following is an example of an infinite loop: Sometimes, like in a looping animation, infinite loops are done purposefully. Other times, usually in code, they are an accident. // infinite loop var foo = 1; // foo is equal to one while(foo>0){ // while foo is greater than zero foo++; // add one to foo } // foo is still greater than zero, so loop continues If the loop runs for too long a period of time (15 seconds), the Flash Player stops executing the script and present a message to the user that says, "A script in this movie is causing Macromedia Flash Player 6 to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?" You may never see this problem, but a person on a slow modem connection might. For this reason, we do not recommend a script loop for preloading.
Use Flash MX resources
See Pausing a Flash Movie on the Macromedia Flash Support Center for information about frame loops and script loops ().
Find information
By now, you've learned enough about Flash MX to realize that this course only scratches the surface of its use. As we've stated before, the possibilities are endless. The best thing we can do for you now is to point you toward resources where you can learn the rest on your own. As you have probably guessed from some of our sample URLs, the Macromedia Web site is a great source of information about Flash.
Save on computing products
HP's specials on computing products allow you to cut costs when you're outfitting your business.
The Macromedia Flash Support Center provides news and information about the Flash product line, as well as code samples and articles on the Flash Authoring Tool. The Support Center also provides a searchable database of information on Flash. The Macromedia Flash Forum is a Web forum with discussion threads on all aspects of Flash development. Sign up and read the forum overview to get started, and then search for some interesting threads or start a new one with your own question. Flash Kit is a Flash developer's resource Web site. It provides links to articles, news, showcases, message board, and many other beneficial resources.
» Save on computing accessories
Colin Moock has written several books on Flash and ActionScript. He maintains a personal Web site containing code samples, authoring tips, Flash examples, and links to other Web resources.
Bob Regan's Accessible Flash Web log is an excellent source of practical information and tips on how to make your Flash movies more accessible to people with disabilities. Mr. Regan is the head of the Macromedia Flash Accessibility team.
Find inspiration
WCAG (Web Content Accessibility Guidelines) are not specifically related to Flash, but we encourage you to read over them anyway. Knowledge of this subject raises your awareness and is beneficial to anyone creating Web content. The Macromedia Web Site of the Day is a showcase of contemporary work built with Macromedia products. It used to be mainly Flash but lately we've seen more Director (Shockwave) Web sites showcased. In any case, the work is usually fantastic. Homestarrunner.com is an entertainment Web site that your humble authors can't seem to get enough of. We especially recommend Strong Bad's advice on Web site development .
Shockwave.com is another Macromedia entertainment Web site featuring games and other interactive pieces produced mainly in Flash and Director. We also mentioned a few Web sites in Lesson 1 that you may remember: Nike Lab JoshuaDavis.com Cartoon Network Let's briefly recap what you learned in this course.
You've learned a lot
In Lesson 1, you learned a little bit of the history of the Internet and how it came into being; the difference between raster and vector graphics; that Flash Player is an HTML-embedded technology that is usually viewed as part of an HTML Web page; and that the Flash Authoring Tool enables you to create and publish Flash movies. In Lesson 2, you began using the Flash Authoring Tool and learned how to draw simple graphics in Flash; how to use some other tools to help you manipulate graphics on the stage; about the Timeline; and how the layer stack works.
The final source
Download the complete and final zip file containing the source file and then try some Flash magic of your own using the resources suggested in this lesson.
In Lesson 3, you learned about frames, keyframes, shape tweening for animation, symbols, and the library, and then you animated eyes, mouth, and hair in Face Facts. In Lesson 4, you added interactivity to your movie by utilizing ActionScript, Flash's native scripting language, and then created buttons by importing raster graphics and assigning actions to them. In Lesson 5, you learned about some problems with Web accessibility and how you could use the new accessibility features of Flash MX to benefit users with disabilities. You also learned how to modify your publish settings and publish your movie for the world to see.
Moving on
Quiz: #1
A) B) C) D) A) B) Thank you.
And finally, this lesson gave you some ideas for continued Flash learning, and gave you a list of resources to help you learn more.
We sincerely hope that you've enjoyed this course and learned a lot. If you have any questions, please post them to the class Message Board to see if any of your classmates can answer it. Do the assignment and take the quiz to complete your course work. Question 1: Which of the following cannot be imported into the Flash Authoring Tool by using File > Import? Video XML data Audio Vector graphics
Question 2: What's the correct syntax for importing an external ActionScript file? C) D) A) B)
#include myCustomScripts.as #include myCustomScripts.as; #include "myCustomScripts.as"
Preloader Load-up
Question 3: What's the common name for a script that makes sure the movie is fully loaded before allowing it to proceed?
#include "myCustomScripts.as";
Question 4: Which of the following best describes ActionScript's case-sensitivity level? Question 5: What's the common term for a loop that never stops looping? Question 6: Which type of loop did we recommend for the preloading example? (Hint: There were two examples, but we recommended against using one.) A) B) script loop frame loop A) B) never-ending loop infinite loop A) B) C) Fully case sensitive Partially case sensitive Not case sensitive (case insensitive)
C) D)
Movie loader
Load balancer
|
https://www.scribd.com/document/249352/learn-flash
|
CC-MAIN-2017-51
|
refinedweb
| 24,126
| 72.66
|
.filename is empty, the module name defaults to 'index'.
Once module is imported, the remaining part of the URI up to the beginning of any query data (a.k.a. PATH_INFO) is used to find an object within the module. The Publisher handler traverses the path, one element at a time from left to right, mapping the elements to Python object within the module.
If no path_info was given in the URL, the Publisher handler will use the default value of 'index'. If the last element is an object inside a module, and the one immediately preceding it is a directory (i.e. no module name is given), then the module name will also default to 'index'.
The traversal will stop and HTTP_NOT_FOUND will be returned to the client if:
If an object in the path could not be found, HTTP_NOT_FOUND is returned to the client.
For example, given the following configuration::
DocumentRoot /some/dir <Directory /some/dir> SetHandler mod_python PythonHandler mod_python.publisher </Directory>
And the following /some/dir/index.py file::
def index(req): return "We are in index()" def hello(req): return "We are in hello()"
Then: publisher handler provides simple ways to control access to modules and functions.
At every traversal step, the Publisher handler checks for presence of __auth__ and __access__ attributes (in this order), as well as __auth_realm__ attribute.
If __auth__ is found and it is callable, it will be called with three arguments: the request object, a string containing the user name and a string containing the password. If the return value of __auth__ is false, then HTTP_UNAUTHORIZED is returned to the client (which will usually cause a password dialog box to appear).
If __auth__() is a dictionary, then the user name will be matched against the key and the password against the value associated with this key. If the key and password do not match, HTTP_UNAUTHORIZED is returned. Note that this requires storing passwords as clear text in source code, which is not very secure.
__auth__ can also be a constant. In this case, if it is false (i.e. None, 0, "", etc.), then HTTP_UNAUTHORIZED is returned.
If there exists an __auth_realm__ string, it will be sent to the client as Authorization Realm (this is the text that usually appears at the top of the password dialog box).
If __access__ is found and it is callable, it will be called with two arguments: the request object and a string containing the user name. If the return value of __access__ is false, then HTTP_FORBIDDEN is returned to the client.
If __access__ is a list, then the user name will be matched against the list elements. If the user name is not in the list, HTTP_FORBIDDEN is returned.
Similarly to __auth__, __access__ can be a constant.
In the example below, only user 'eggs' with password 'spam' can access the hello function::
__auth_realm__ = "Members only" def __auth__(req, user, passwd): if user == "eggs" and passwd == "spam" or \ user == "joe" and passwd == "eoj": return 1 else: return 0 def __access__(req, user): if user == "eggs": return 1 else: return 0 def hello(req): return "hello"
Here is the same functionality, but using an alternative technique::
__auth_realm__ = "Members only" __auth__ = {"eggs":"spam", "joe":"eoj"} __access__ = ["eggs"] def hello(req): return "hello"
Since functions cannot be assigned attributes, to protect a function, an __auth__ or __access__ function can be defined within the function, e.g.::
def sensitive(req): def __auth__(req, user, password): if user == 'spam' and password == 'eggs': # let them in return 1 else: # no access return 0 # something involving sensitive information return 'sensitive information`
Note that this technique will also work if __auth__ or __access__ is a constant, but will not work is they are a dictionary or a list.
The __auth__ and __access__ mechanisms exist independently of the standard PythonAuthenHandler. It is possible to use, for example, the handler to authenticate, then the __access__ list to verify that the authenticated user is allowed to a particular function. psp – Python Server Pager...
|
http://modpython.org/live/current/doc-html/handlers.html
|
CC-MAIN-2015-35
|
refinedweb
| 665
| 59.53
|
Originally posted by prabha: Assume Test is a directory. Under which we have two files. Super.java and Sub.java Super.java --> file name //code starts package Test; public class Super { protected int x = 10; } //code ends Sub.java --> file name //code starts import Test.Super; class Sub extends Super { public static void main(String[] args) { Super s = new Sub(); System.out.println(s.i); } } //code ends Super.java compiles successfully and class file created. While compiling Sub.java, following compile time error comes. Can't access protected field i in Test.Super. Test.Super is not a Sub class of current class. System.out.println(s.i); ^ If you modify protected to public in Super.java for int i, it works good. Please explain the above. Bye, cibhi.
Originally posted by Savithri Devaraj: prabha, class Sub does not belong to package Test, it belongs to default package, so it cannot be under the Test directory. Try putting it in a different directory, and leaving the protected field protected. Savithri
|
http://www.coderanch.com/t/192841/java-programmer-SCJP/certification/Package-Accessibility
|
CC-MAIN-2015-40
|
refinedweb
| 170
| 54.08
|
This article has been included GitHub There are also real interview questions, interview strategies, efficient learning materials, etc
1, Implementation principle of container
In essence, container is a sandbox technology. It's like isolating an application in a box and making it work. Because of the box boundary, there is no interference between applications. And like a container, take it and run it everywhere. In fact, this is the ideal state of PaaS.
The core of the implementation container is to generate the boundary limiting the application runtime. As we know, the compiled executable code plus data is called a program. After running the program, it becomes a process, which is called an application. If we can add a boundary to the application when it starts, can't we achieve the expected sandbox?
In Linux, there are two main technologies to implement the container boundary, cgroups and Namespace. Cgroups are used to limit the resources of the running container, and Namespace will isolate the container and implement the boundary.
In this way, the container is just a restricted special process.
2, Container isolation: Namespace
Before introducing Namespace, let's look at an experiment:
# Using the official image of Python 3.6.8, an environment running django is established # After entering the container, use the ps command to view the running process root@8729260f784a:/src# ps -A PID TTY TIME CMD 1 ? 00:01:22 gunicorn 22 ? 00:01:20 gunicorn 23 ? 00:01:24 gunicorn 25 ? 00:01:30 gunicorn 27 ? 00:01:16 gunicorn 41 pts/0 00:00:00 bash 55 pts/0 00:00:00 ps
As you can see, the process with PID=1 in the container is the django application started by gunicorn. Students familiar with Linux know that the process with PID=1 is the first process when the system is started, also known as init process. Other processes are generated by its management. At this point, PID=1 is really a django process.
Next, exit the container and execute the ps command on the host
# The environment is Centos7 [root@localhost ~]# ps -ef | grep gunicorn root 9623 8409 0 21:29 pts/0 00:00:00 grep --color=auto gunicorn root 30828 30804 0 May28 ? 00:01:22 /usr/local/bin/python /usr/local/bin/gunicorn -c gunicorn_config.py ctg.wsgi root 31171 30828 0 May28 ? 00:01:20 /usr/local/bin/python /usr/local/bin/gunicorn -c gunicorn_config.py ctg.wsgi root 31172 30828 0 May28 ? 00:01:24 /usr/local/bin/python /usr/local/bin/gunicorn -c gunicorn_config.py ctg.wsgi root 31174 30828 0 May28 ? 00:01:30 /usr/local/bin/python /usr/local/bin/gunicorn -c gunicorn_config.py ctg.wsgi root 31176 30828 0 May28 ? 00:01:16 /usr/local/bin/python /usr/local/bin/gunicorn -c gunicorn_config.py ctg.wsgi
From the perspective of the host, it is found that the PID of django process has changed to 30828. It is not difficult to prove that some processing has been done in the container. The process that Mingming is 30828 is changed into the first process in the container, and no other process of the host can be seen in the container. This also shows that the environment inside the container is indeed isolated.
This kind of processing is actually the Namespace mechanism of Linux. For example, the above method to change PID to 1 is through PID Namespace. The way to create threads in Linux is clone, where clone is specified_ Newpid parameter, so that the newly created process will see a new process space. At this time, the new process becomes the process of PID=1.
int pid = clone(main_function, stack_size, CLONE_NEWPID | SIGCHLD, NULL);
There are many parameters similar to PID Namespace in Linux, such as:
3, Container restrictions: Cgroups
Through the Namespace technology, we realize the isolation between the container and the host, and between the container and the host. But this is not enough. Imagine a scenario where two containers are running on the host. Although the containers are isolated from each other, from the perspective of the host, in fact, the two containers are two special processes, and there is a natural competitive relationship between the processes, which can eat up the resources of the system. Of course, we can't allow that.
Cgroups is a technology used to set resources for processes in the Linux kernel.
The full name of Linux Cgroups is Linux Control Group. Its main function is to limit the upper limit of resources used by process groups, including CPU, memory, disk and network bandwidth.
You can also set the priority of the process, audit, suspend and restore operations.
In previous versions, cgroup can be managed through libcgroup tools. After RedHat 7, it has been managed through systemctl instead.
We know that the function of systemd in Linux is to manage system resources. For the convenience of management, a concept called unit is derived. For example, a unit can have a broader definition, such as abstract services, network resources, devices, mounted file systems, etc. In order to make a better distinction, Linux divides unit into 12 types.
In Cgroup, slice, scope and service are mainly used.
For example, create a temporary cgroup, and then restrict the resources of the processes it starts:
# Create a service called toptest and run it in slice named test [root@localhost ~]# systemd-run --unit=toptest --slice=test top -b Running as unit toptest.service.
Now the toptest service is running in the background
# View Cgroup information through SYSTEMd CGLS [root@localhost ~]# systemd-cgls ├─1 /usr/lib/systemd/systemd --switched-root --system --deserialize 22 ├─test.slice │ └─toptest.service │ └─6490 /usr/bin/top -b # View the status of the service through systemctl status [root@localhost ~]# systemctl status toptest ● toptest.service - /usr/bin/top -b Loaded: loaded (/run/systemd/system/toptest.service; static; vendor preset: disabled) Drop-In: /run/systemd/system/toptest.service.d └─50-Description.conf, 50-ExecStart.conf, 50-Slice.conf Active: active (running) since Tue 2020-06-02 14:01:01 CST; 3min 50s ago Main PID: 6490 (top) CGroup: /test.slice/toptest.service └─6490 /usr/bin/top -b
Now, the resources of the toptest service are limited.
# First, look at the information of Cgroup before restriction. 6490 is the process PID [root@localhost ~]# cat /proc/6490/cgroup 11:pids:/test.slice 10:blkio:/test.slice 9:hugetlb:/ 8:cpuset:/ 7:memory:/test.slice 6:devices:/test.slice 5:net_prio,net_cls:/ 4:perf_event:/ 3:freezer:/ 2:cpuacct,cpu:/test.slice 1:name=systemd:/test.slice/toptest.service # Limit the CPU and memory it uses systemctl set-property toptest.service CPUShares=600 MemoryLimit=500M # Check the information of Cgroup again and find that some content has been added to cpu and memory. [root@localhost ~]# cat /proc/6490/cgroup 11:pids:/test.slice 10:blkio:/test.slice 9:hugetlb:/ 8:cpuset:/ 7:memory:/test.slice/toptest.service 6:devices:/test.slice 5:net_prio,net_cls:/ 4:perf_event:/ 3:freezer:/ 2:cpuacct,cpu:/test.slice/toptest.service 1:name=systemd:/test.slice/toptest.service
At this time, you can use / sys/fs/cgroup/memory/test.slice And / sys/fs/cgroup/cpu/test.slice Under the directory, there is an extra name toptest.service Directory of.
Cat in its directory toptest.service/cpu . shares can find that the CPU is limited to 600
Back to docker, in fact, docker and the above operations are basically the same. The specific resources that need to be restricted are specified in docker run:
$ docker run -it --cpu-period=100000 --cpu-quota=20000 ubuntu /bin/bash
For the specific limitations of docker, you can view them in the sys / FS / CGroup / CPU / dockekr / and other folders.
4, Container's file system: container image - rootfs
Now we know that the core of container technology is to limit the vision of the container through Namespace and the resources that the container can access through Cgroup. But there are some special points about Mount Namespace that need to be paid attention to.
The special feature of Mount Namespace is that in addition to the process's authentication of the file system mount point when modifying, it also needs to explicitly declare which directories need to be mounted. In Linux system, there is a command called chroot, which can change the root directory of the process to the specified location. Mount Namespace is based on chroot.
Within the container, you should see a fully independent file system that is unaffected by the host and other containers. This independent file system is called container image. It also has a more professional name called rootfs. rootfs contains the files, configurations and directories required by an operating system, but does not contain the system kernel. Because in Linux, files and kernel are stored separately, the operating system will only load the specified kernel when it is started. This means that all containers share the kernel of the operating system on the host.
In the era of PaaS, due to the difference between the cloud and the local environment, the process of application packaging has always been a more painful process. But with rootfs, this problem is well solved. Because in the image, not only the application but also the required dependencies are packaged together. This solves the problem that the application can run well no matter where it is.
Not only that, rootfs also solves the problem of reusability. Imagine this scenario. You packaged a centos image containing the java environment through rootfs. Someone needs to run an apache service in the container. Does he need to build the java environment from scratch? When docker solves this problem, it introduces a concept called layer. Every time it modifies rootfs, it only saves incremental content, not a new image of fork.
The idea of hierarchy also comes from Linux, a unified file system. Its main function is to mount directories in different locations to the same directory. Corresponding to Docker, different environments use different federated file systems. For example, the latest version of CentOS 7 uses overlay2, while Ubuntu 16.04 and Docker CE 18.05 use AuFS
You can use docker info to query the used storage driver. Here is overlay2.
[root@localhost ~]# docker info Client: Debug Mode: false Server: Containers: 4 Running: 4 Paused: 0 Stopped: 0 Images: 4 Server Version: 19.03.8 Storage Driver: overlay2
Next, let's see how overlay 2's file system is used in docker?
Overlay2
On Linux hosts, OverlayFS generally has two directories, but it will be displayed as one directory. The two directories are called layers, and the process of combining is called union mount. The lower directory is called lowerdir, and the upper directory is called upperdir. After the two directories are combined, the exposed view is called view. It sounds a little abstract. First, look at the overall structure:
As you can see, lowerdir actually corresponds to the image layer, while upperdir corresponds to the container. And merged corresponds to the content after the joint mount of the two. And we found that when the image layer and the container layer have the same file, the file of the container layer will prevail (the file of the top layer will prevail). Generally, overlay2 supports up to 128 lower layers.
Next, I will see the specific embodiment of the container layer and image. On my linux host, there are four containers running.
The general storage location of Docker is / var/lib/docker. First look at the structure:
[root@localhost docker]# ls -l /var/lib/docker total 16 drwx------. 2 root root 24 Mar 4 03:39 builder drwx--x--x. 4 root root 92 Mar 4 03:39 buildkit drwx------. 7 root root 4096 Jun 1 10:36 containers drwx------. 3 root root 22 Mar 4 03:39 image drwxr-x---. 3 root root 19 Mar 4 03:39 network drwx------. 69 root root 8192 Jun 1 15:01 overlay2 drwx------. 4 root root 32 Mar 4 03:39 plugins drwx------. 2 root root 6 Jun 1 15:00 runtimes drwx------. 2 root root 6 Mar 4 03:39 swarm drwx------. 2 root root 6 Jun 1 15:01 tmp drwx------. 2 root root 6 Mar 4 03:39 trust drwx------. 3 root root 45 May 18 10:28 volumes
We need to focus on the folders container, image and overlay2.
- Container: Needless to say, the running or created container will be in this directory.
- Image: the corresponding record is the image.
- Overlay 2: records the lowerrdir contained in each image
As mentioned before, there are many possible implementations of unionfs, such as overlay2,aufs,devicemapper, etc. Naturally, under the image folder, there will be multiple drive folders:
image/ └── overlay2 ├── distribution ├── imagedb │ ├── content │ └── metadata ├── layerdb │ ├── mounts │ ├── sha256 │ └── tmp └── repositories.json
Here, imagedb and layerdb are the places where metadata is stored. As we have learned before, the file system of a container is composed of image layer and container layer, and each image may be composed of multiple layers. This means that each layer may be referenced by multiple images. So how are they related? The answer is in the imagedb file.
Here I take mysql image as an example:
# View the image id of mysql [root@localhost docker]# docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE ctg/mysql 5.7.29 84164b03fa2e 3 months ago 456MB # Enter the imagedb/content/sha256 directory to find the corresponding image id [root@localhost docker]# ls -l image/overlay2/imagedb/content/sha256/ ... -rw-------. 1 root root 6995 Apr 27 02:45 84164b03fa2ecb33e8b4c1f2636ec3286e90786819faa4d1c103ae147824196a # Next, take a look at the contents recorded in it. Here you can take a useful part cat image/overlay2/imagedb/content/sha256/84164b03fa2ecb33e8b4c1f2636ec3286e90786819faa4d1c103ae147824196a { ......... "os": "linux", "rootfs": { "type": "layers", "diff_ids": [ :0c615b40cc37ed667e9cbaf33b726fe986d23e5b2588b7acbd9288c92b8716b6", "sha256:ad160f341db9317284bba805a3fe9112d868b272041933552df5ea14647ec54a", "sha256:1ea6ef84dc3af6506c26753e9e2cf7c0d6c1c743102b85ebd3ee5e357d7e9bc4", "sha256:6fce4d95d4af3777f3e3452e5d17612b7396a36bf0cb588ba2ae1b71d139bab9", "sha256:6de3946ea0137e75dcc43a3a081d10dda2fec0d065627a03800a99e4abe2ede4", "sha256:a35a4bacba4d5402b85ee6e898b95cc71462bc071078941cbe8c77a6ce2fca62", "sha256:1ff9500bdff4455fa89a808685622b64790c321da101d27c17b710f7be2e0e7e", "sha256:1cf663d0cb7a52a3a33a7c84ff5290b80966921ee8d3cb11592da332b4a9e016", "sha256:bcb387cbc5bcbc8b5c33fbfadbce4287522719db43d3e3a286da74492b7d6eca" ] } }
You can see that mysql image is composed of 11 layers, among which f2cb is the lowest layer and bcb3 is the highest layer.
Next, let's look at the content of layerdb:
[root@localhost docker]# ls -l image/overlay2/layerdb/ total 8 drwxr-xr-x. 6 root root 4096 May 13 13:38 mounts drwxr-xr-x. 39 root root 4096 Apr 27 02:51 sha256 drwxr-xr-x. 2 root root 6 Apr 27 02:51 tmp # First, look at the contents of sha256 directory [root@localhost docker]# ls -l image/overlay2/layerdb/sha256/ total 0 .... drwx------. 2 root root 71 Apr 27 02:45 bbb9cccab59a16cb6da78f8879e9d07a19e3a8d49010ab9c98a2c348fa116c87 drwx------. 2 root root 71 Apr 27 02:45 f2cb0ecef392f2a630fa1205b874ab2e2aedf96de04d0b8838e4e728e28142da ....
It can be found that only the lowest layer id can be found here, because the association between layers is saved in the way of chainID. In short, the container id of one layer can be calculated by sha256 algorithm
For example, here, the lowest id is f2cb0eef392f2a630fa1205b874ab2e2aedf96de04d0b8838e4e728e28142da, and the upper id is a9f6b7c7101b86ffaa53dc29638e577bf5b24150577a59199d8554d7ce2921. Then, the calculation method of the next id under the sha256 directory is as follows:
[root@localhost docker]# echo -n sum bbb9cccab59a16cb6da78f8879e9d07a19e3a8d49010ab9c98a2c348fa116c87 -
Then we can find the content of bbb9.. in the sha256 directory.
OK, now we have associated the image with the layer, but as mentioned before, metadata is stored in the image directory. The real rootfs is actually in another place - / docker/overlay2.
# By querying the cache ID, we get the real rootfs layer [root@localhost docker]# cat image/overlay2/layerdb/sha256/f2cb0ecef392f2a630fa1205b874ab2e2aedf96de04d0b8838e4e728e28142da/cache-id 2996b24990e75cbd304093139e665a45d96df8d7e49334527827dcff820dbf16[
Enter / docker/overlay2 to view:
[root@localhost docker]# ls -l overlay2/ total 4 ... drwx------. 3 root root 47 Apr 27 02:45 2996b24990e75cbd304093139e665a45d96df8d7e49334527827dcff820dbf16 ... drwx------. 2 root root 4096 May 13 13:38 l
So the real rootfs layer is also found.
To rearrange, we first check that the image has all layer IDS according to the image id in mage/overlay2/imagedb/content/sha256 /, and then calculate it through sha256 according to the lowest layer ID and the upper layer ID, and then associate all layers by referring to the upper layer ID, and so on. Finally, through the cache ID of each layer, the metadata is mapped to the real rootfs layer data.
Finally, the composition of rootfs.
Each rootfs is composed of a Lower Dir and a Upper Dir. The mirror layer can only be read-only, while the container layer can read and write. And the image layer can have up to 128 layers.
In fact, there is another layer in the composition of rootfs. However, this layer will not be added during submission or compilation, so it is not included in rootfs, but it actually exists.
Before we looked at the ls -l /var/lib/docker/overlay2 / lower mirror layer, we could see several directories ending in - init, and the number is exactly equal to the number of containers. This layer is sandwiched between the image layer and the container layer. It is a separate layer generated by docker, which is specially used to store etc/hosts, / etc/resolv.conf Etc. The purpose of existence is that the user needs to configure some specific values, such as hostname, dns, etc. when the container is started, but these configurations are only valid for the current container, and there are other configurations naturally in other environments, so this layer is taken out separately. When submitting the image, this layer is ignored.
5, Comparison between container and virtual machine technology
The following picture is taken from the official docker. Based on what we learned above, we re analyze the difference between docker and traditional VM:
Mobility and performance:
- Traditional VM: hardware virtualization technology based on Hypervisor is needed to simulate CPU, memory and other hardware. Then build a set of complete operating system on it, which will lose a lot of performance naturally. Migration naturally doesn't need to mention that the traditional ova export is a complete operating system.
- Docker: docker changes the location of Hypervisor to its own dockekr engine. The running container is only a special process, and its natural performance will not be greatly lost. And can be applied and its required system files packaged into a mirror, no matter where the read can run normally, and compared to ova, the volume is also smaller. (kernel support required)
Generally speaking, KVM running CentOS needs to occupy 100-200m memory without optimization after startup. In addition, the user's call to the host needs to be intercepted and processed by virtualization software, which is also a layer of performance loss, especially for computing resources, network and disk I/O, etc.
Isolation:
Traditional VM: due to the virtualization of a complete operating system, so the isolation is very good. For example, Microsoft's Azure Platform is to virtualize a large number of Linux virtual machines on Windows Servers.
- Docker: there are many differences in isolation, because the container itself is a process, and all processes need to share a system kernel.
- This means that the Linux container running on Windows, or the container running a higher version kernel on a Linux host, cannot be implemented.
- In the Linux kernel, there are many resources and objects that cannot be namespaced, such as time. For example, if you modify the time through the settimeofday(2) system call, the actual host will be modified.
- Security issues, the fact that the host kernel is shared, the container exposes a larger * * * side.
Resource limitations:
Traditional VM: very easy to manage, control the use of resources, rely on the virtual operating system.
Docker: due to the limitation of resources in docker, Cgroup is implemented through Cgroup, which has many imperfections, such as
How to deal with / proc. After entering the container, execute the top command, and the information you see is the same as that of the host, not the data of the configured container. (can be corrected by lxcfs).
When running java programs, the memory set in the container is 4g, using the default jvm configuration. The memory read by the default jvm is the host (maybe larger than 4g), so the OOM situation will occur.
6, Problems solved
1. How is the container isolated?
When a new process is created, isolation is realized by Namespace technology, such as PID namespaces. Let the running container only see its contents.
For example, when the container is running, it will add PID, UTS, network, user, mount, IPC, cgroup and other Namespace by default
2. How do containers restrict resources?
With Linux Cgroup technology, you can set Limited CPU, Memory and other resources for each process, and then set the upper limit of process access resources.
3. Briefly describe the file system of docker?
Docker's file system is called rootfs, and its implementation idea comes from Linux unionFS. Mount different directories together to form a separate view. On this basis, docker introduces the concept of layer to solve the problem of reusability.
In the specific implementation, the storage of rootfs is divided into overlay 2, overlay, aufs, devicemapper, etc. according to the linux kernel and the version of docker itself. Rootfs (image) is actually the superposition of multiple layers. When there are the same files in multiple layers, the files in the upper layer will overwrite the files in the lower layer.
4. Container startup process?
- Specify Linux Namespace configuration
- Set the specified Cgroups parameter
- Switch the root of the process
5. The problem of running multiple applications in the container?
First, correct a concept. We all say that the container is a single process application. In fact, the single process here does not mean that only one process is allowed in the container, but that only one process is controllable. You can use ping, ssh and other processes in the container, but these processes are not controlled by docker.
The main process in the container, that is, the process with pid =1, is generally specified by ENTRYPOINT or CMD in the DockerFile. If there are multiple services (processes) in a container, the main process may run normally, but the sub process exits and hangs up. For docker For example, if you just control the main process, you can't deal with this unexpected situation. It will also appear that the container is running normally, but the service has been suspended. At this time, the orchestration system becomes very difficult. Moreover, multiple services are not easy to troubleshoot and manage.
So if you really want to run multiple services in a container, you will usually manage them with tools like systemd or supervisor, or through the -- init method. In fact, the essence of these methods is to let the processes of multiple services have the same parent process.
But considering the design of the container itself, it is hoped that the container and the service can be in the same life cycle. So it's a bit of a contrarian.
Control (recycling and Lifecycle Management)
|
https://programmer.help/blogs/5ef0358d18845.html
|
CC-MAIN-2021-43
|
refinedweb
| 3,798
| 56.35
|
Unadulterated Java is so groovy
Groovy is an alternate language for the JVM– alternate in that Groovy is a simpler, more expressive Java (which, by the way, also happens to work with normal Java). In fact, if you already know Java, you basically know Groovy, man.
Groovy’s syntax is a less strict version of Java’s and adds a few new features here and there. You could say that Groovy’s syntax is terse, which yeilds a highly expressive medium for conveying behavior without a lot of extranous verbiage. But the beauty is that that verbiage isn’t gone– it’s assumed. Hence, Groovy is an unadulterated version of Java, baby.
As a demonstration, here is a hip Java class that represents a song, aptly named
Song. As you can imagine, this code exists in a file named
Song.java and is located in some sort of package structure (like
com.acme.blah).
public class Song { private String name; private String genre; private String artist; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getGenre() { if(genre != null){ return genre.toUpperCase(); }else{ return null; } } public void setGenre(String genre) { this.genre = genre; } public String getArtist() { return artist; } public void setArtist(String artist) { this.artist = artist; } }
This bogue class doesn’t do anything particularly interesting and is basically a JavaBean– but it serves as an excellent demonstration of how you can achieve the same behavior (albeit simple) in Groovy with fewer lines of code.
As a first step, you can make this a Groovy class by just changing the file’s type to
.groovy– in fact,
Song.groovy as is, will compile just fine with
groovyc.
One thing about Groovy is that it is Java without accessibility modifiers (i.e. you don’t have to specify
public– everything is assumed to be so unless you say otherwise) and semi-colons. Consequently, I can trim down this class somewhat by removing all semi-colons and
public modifiers, baby.
class Song { private String name private String genre private String artist String getName() { return name } void setName(String name) { this.name = name } String getGenre() { if(genre != null){ return genre.toUpperCase() }else{ return null } } void setGenre(String genre) { this.genre = genre } String getArtist() { return artist } void setArtist(String artist) { this.artist = artist } }
Already, because it’s my bag,
Song is getting a bit shorter, but nothing to write home about.
What’s particularly handy in Groovy is the way it treats properties– in this case,
Song has 3 (
name,
genre, and
artist). By convention, in Java, if you want to access these values (i.e. via getters and setters) you copasetically create corresponding
setProperty and
getProperty methods. In Groovy, these accessors are generated for you; consequently, in the
Song class, I can remove those methods leaving me with the following code:
class Song { private String name private String genre private String artist String getGenre() { if(genre != null){ return genre.toUpperCase() }else{ return null } } }
Note that I left in the
getGenre method– that’s doing something special.
Be careful though, disco dancers, as in Groovy, if I leave the properties as
private Groovy will not generate the accessors– accordingly, the next step is to remove the
private modifier on the properties.
class Song { String name String genre String artist String getGenre() { if(genre != null){ return genre.toUpperCase() }else{ return null } } }
Looking at this code, I can hear the Java faithful grinding their teeth over what appears to be a lack of encapsulation, baby– in fact, in Groovy, you can access the
name property directly!
Or do you?
Using a simple
GroovyTestCase, I can knock out a quick test to see property access in action:
class SongTest extends GroovyTestCase { void testPropertyAccess() { def sng = new Song(artist:"Lipps, Inc", name:"FunkyTown", genre:"Disco") assertEquals("FunkyTown", sng.name) assertEquals("FunkyTown", sng.getName()) } }
In the code above, I’m grabbing a property either directly or via the getter method– the same, by the way, is true for setting a value. But the question remains, when the property is seemingly accessed directly, does this by pass the getter (or setter)?
One way to find out is to use the
getGenre method, right? It does something special– accordingly, the following test case demonstrates hip encapsulation in action:
void testEncapsulatedAccess() { def sng = new Song(artist:"Lipps, Inc", name:"FunkyTown", genre:"Disco") assertEquals("DISCO", sng.genre) assertEquals("DISCO", sng.getGenre()) }
Even though the properties in the
Song class are not explicitly
private, they are acting privately, aren’t they, man?
Going back to the
getGenre method on the
Song class, it turns out that Groovy also has a handy syntax for null pointer safety, consequently, I can simply that method even further.
class Song { String name String genre String artist String getGenre() { return genre?.toUpperCase() } }
Groovy also permits dropping
return statements– in essence, the last line of a method is assumed as the
return value. So, that leaves the
getGenre method as:
String getGenre() { genre?.toUpperCase() }
Groovy infers types– for instance, writing
String value = "groovy"; is a bit verbose, no? Think about it for a second–
String value is superfluous isn’t it?
value must be a
String as I set it to one, right? Likewise, in Groovy,
value is clearly a
String (because it is set to a
String directly!) without having to give the compiler (or runtime) a hint. Accordingly, you can drop types and replace them with Groovy’s hip
def keyword.
class Song { def name def genre def artist def getGenre() { genre?.toUpperCase() } }
Removing an explicit type does have some consequences though– in this case, given that Groovy is Java, these properties must have some type associated with them. What do you think that type is? Right!
java.lang.Object, baby. Consequently, if you were to use this Groovy
Song class in Java, the
getGenre method will have a return type of
Object, not
String (unless you explicitly make
String the return type).
Applying groovy techniques to Java yields a more effective Java– in this case, the
Song class started out at roughly 30 lines of code. Refactoring it down a bit by leveraging Groovy, I ended up with basically 10 lines of code. The code is essentially the same– the only behavioral difference being that
Object is now king with method return types (should you use this class in normal Java). But switching out
def for
String doesn’t add any new lines of code, does it?
Groovy is unadulterated Java– in fact, it’s Java without a lot of Java. Can you dig it, baby?
Friday 07 Mar 2008 | Andy | Groovy
Wicked! we want more content like this!
[…] Original post by Andy […]
Andy is such a humble cat that he has yet to post anything about his big news. This week, the book he co-authored, Continuous Integration, won the Jolt Award for best technical book. That’s like so way better than 8-track! Congrats, Andy. You’re grooving!
Many thanks, Andrew– it was a pleasure to see you at SD West!
It seems like atleast once a week I hear about a new dynamic language that’s going to make me work faster, get more done, and save us from the communist. Its at the point that I ignore most of them.
I did the same with Groovy, until now. This was great summary. It reminds me of how everyone jumped on C++ at first because it was backwards compatible with C.
In this example, the Java code has more lines i agree, but it describes more properties for the class, than the groovy example.
For example, the private modifier in “genre” prohibits a developer that just uses the class to accidentally reference the content without using the getGenre … right?
In the groovy counterpart i could just say Song().genre … right? (i’m not a groovy expert though).
In addition, i think the example is not very indicative … since it is easy to ommit and simplify things things in a getter/setter class.
My experience with dynamic languages (especially python and Perl) is that they have earned their place, but they cannot be used efficiently in large applications.
Vassilios, even with the simplified syntax Groovy does generate getters/setters for each property (in byte code) which means that a call like Song().genre is in fact Song().getGenre() It looks like direct field access but it isn’t, it is still property access.
To be honest i would excpect the opposite :). Why bother generate the getGenre() method in bytecode if the end programmer will always use the property?
In Java also, noone is forcing anyone to write getters/settters. You can forget about them if you like
And believe me, except the genre? the code will look exactly the same
public class Song {
public String name
public String genre
public String artist
public String getGenre() {
if(genre != null) { return gerne; }
return “”; // something …
}
My previous comment suggested that you dont have strict OO concept in those languages (talking mostly from my python experience though).
It’s fast and beautiful, i agree. But it has its limitations :). Serves its puprose though.
I dont think that are really comparable though
The article covers using the Groovy written class in Java, to have a terser syntax. So in that sense they are directly comparable because the Groovy code is pretty much exactly equivalent to the Java code at the byte code level that only difference being the Groovy one will implement the GroovyObject interface.
In terms of the setters and getters they are however directly equivalent. And regardless as to whether people are forced to write getters/setters. Sun pretty much dictated this decision with the release of the JavaBean spec donkies years ago.
|
http://thediscoblog.com/2008/03/07/unadulterated-java-is-so-groovy/
|
crawl-001
|
refinedweb
| 1,621
| 64.3
|
Posts one or more threads of an event completion.
Standard C library (libc.a)
#include <sys/thread.h>
int thread_post_many( nthreads, tidp, erridp)
int nthreads;
tid_t * tidp;
tid_t * erridp;
The thread_post_many subroutine posts one or more threads of the occurrence of the event. The number of threads to be posted is specified by the value of the nthreads parameter, while the tidp parameter points to an array of thread IDs of threads that need to be posted. The subroutine works just like the thread_post subroutine but can be used to post to multiple threads at the same time.
A maximum of 512 threads can be posted in one call to the thread_post_many subroutine.
An optional address to a thread ID field may be passed in the erridp parameter. This field is normally ignored by the kernel unless the subroutine fails because the calling process has no permissions to post to any one of the specified threads. In this case, the kernel posts all threads in the array pointed at by the tidp parameter up to the first failing thread and fills the erridp parameter with the failing thread's ID.
On successful completion, the thread_post_many subroutine returns a value of 0. If unsuccessful, a value of -1 is returned and the global variable errno is set to indicate the error.
The thread_post_many subroutine is unsuccessful when one of the
following is true:
The thread_wait (thread_wait Subroutine) subroutine, and thread_post (thread_post Subroutine) subroutine.
|
http://ps-2.kev009.com/wisclibrary/aix51/usr/share/man/info/en_US/a_doc_lib/libs/basetrf2/thread_post_many.htm
|
CC-MAIN-2022-33
|
refinedweb
| 242
| 61.36
|
Drag and drop
For our feature editor, we want users to be able to import their own data for editing. We'll use the
DragAndDrop interaction for this. As before, we'll stick with the GeoJSON format for parsing features, but the interaction can be configured to work with any number of feature formats.
We're going to be passing our map to a number of other components in this exercise, so make sure you have assigned the map to a variable named
map:
const map = new Map({
Import the drag and drop interaction into your
main.js:
import DragAndDrop from 'ol/interaction/DragAndDrop';
Next, we'll create a vector source with no initial data. Instead of loading data from a remote location as in the previous example, this source will store features that the user drags and drops onto the map.
const source = new VectorSource();
Now, remove the old
layers list from the map, create a new layer with our empty vector source, and add it to the map.
const layer = new VectorLayer({ source: source, }); map.addLayer(layer);
Finally, we'll create a drag and drop interaction, configure it to work with our vector source, and add it to the map:
map.addInteraction( new DragAndDrop({ source: source, formatConstructors: [GeoJSON], }) );
Now you should be able to drag and drop GeoJSON files onto the map and see them rendered.
|
https://openlayers.org/workshop/en/vector/drag-n-drop.html
|
CC-MAIN-2021-43
|
refinedweb
| 228
| 57.91
|
Entry point to Fortran MEX function
#include "fintrf.h" subroutine mexFunction(nlhs, plhs, nrhs, prhs) integer nlhs, nrhs mwPointer plhs(*), prhs(*)
nlhs
Number of expected output
mxArrays
plhs
Array of pointers to the expected output
mxArrays
nrhs
Number of input
mxArrays
prhs
Array of pointers to the input
mxArrays. Do not modify any
prhs values in your MEX file. Changing the data in these read-only
mxArrays can produce undesired side effects.
mexFunction is not a routine you call. Rather,
mexFunction is the name of the gateway subroutine in Fortran which
every MEX function requires. For more information, see Components of Fortran MEX File.
When you invoke a MEX function, MATLAB® finds and loads the corresponding MEX function of the same name. MATLAB then searches for a symbol named
mexFunction within the MEX
function. If it finds one, it calls the MEX function using the address of the
mexFunction symbol. MATLAB displays an error message if it cannot find a routine named
mexFunction inside the MEX function.
When you invoke a MEX function, MATLAB automatically seeds
nlhs,
plhs,
nrhs, and
prhs with the calling arguments. In the
syntax of the MATLAB language, functions have the general form:
[a,b,c,...] = fun(d,e,f,...)
where the
... denotes more items of the same format. The
a,b,c... are left-side output arguments, and the
d,e,f... are right-side input arguments. The arguments
nlhs and
nrhs contain the number of left side and
right side arguments, respectively.
prhs is an array of
mxArray pointers whose length is
nrhs.
plhs is an array whose length is
nlhs, where your
function must set pointers for the output
mxArrays.
Note
It is possible to return an output value even if
nlhs = 0, which
corresponds to returning the result in the
ans variable.
See these examples in
:
matlabroot/extern/examples/mex
|
https://au.mathworks.com/help/matlab/apiref/mexfunction_fortran.html
|
CC-MAIN-2021-49
|
refinedweb
| 308
| 65.83
|
On Sun, Mar 12, 2006 at 10:37:45PM +0300, Bulat Ziganshin wrote: > Sunday, March 12, 2006, 8:49:15 PM, you wrote: > MP> 1. Haskell-nativeness: I have had some issues compiling and linking with gsl > MP> libraries on 64-bit platforms. Also, it would be quite interesting to gauge > MP> haskell's effectiveness as a scientific computing platform, in particular > MP> making use unboxed arrays as representation. > > it's a bad idea. simple test of vector addition shows the 20x > performance loss comparing GHC and GCC. so you can consider this as > learning example but not as a real-world lib. btw, i've proposed > making changes in ghc that will change this situation, at least for > simple loops. but that is only words for this moment. if you want to > allow ghc became the really good choice for writing matrix libraries, > it's better to take part in ghc's own development :) What a pity :-( Probably the best thing to do is to extend Alberto's library to do in-monad versions of GSL's updating algorithms. They would have to be in the IO monad, as I'm calling foreign code, but I could use the unsafeIOToST trick you mention. > MP> 2. Use of monads: in the afore-mentioned libraries, monads are either ignored, > MP> or are restricted to the IO monad. > > IO monad is just ST monad specialized to RealWorld state. you can > easily use this libs in ST monad with help of unsafeIOToST. surprised? :) No, because I did know about this. But precisely because IO monad is ST specialized to RealWorld, the "correct" (i.e. elegant) way of writing the library would be as I suggest; from ST to IO, not the other way around. > you will laugh even more if i say that STUArray in Hugs implemented in > just this way - by using peek/poke IO operations wrapped in unsafeIOToST. Now this *is* funny! ;-) > seems that you don't know that Haskell's indexes can be a tuples :) > > type Matrix a = UArray (Int,Int) a > type Matrix3d a = UArray (Int,Int,Int) a It's true that your version is slightly cleaner. > so, you can return anything else together with array returned by > unsafeFreeze. of course, because you should use tuples for indexing, > it has only theoretical interest. I *do* use tuples for indexing (even though I don't use them [yet] for *specification* of the dimension of the matrix). Indeed: infixr 2 !@ infixr 3 <-- (?@) :: MMatrix s -> (Int, Int) -> ST s Double m ?@ b = readArray (getMBlock m) ((mrows m)*((fst b)-1) + snd b) (!@) :: MMatrix s -> ((Int, Int), Double) -> ST s () m !@ ((i,j), m_ij) = let n = mrows m in writeArray (getMBlock m) (n*(i-1) + j) m_ij (<--) :: (Int, Int) -> Double -> ((Int, Int), Double) i <-- x = (i, x) which allows code like: runMatrix = do _A <- newListMatrix [[2, 0, 0], [0, 2, 0], [0, 0, 2]] _B <- newListMatrix [[1, 2, 1], [0, 1, 1], [0, 0, 1]] b_12 <- _B ?@ (1,2) _B !@ (1,1) <-- 2*b_12 _C <- matMul _A _B return _C which I think looks quite readable -- and without needing to "cheat" by using outside parsers ;-) > MP> runSTMatrix :: ST s (Matrix s) -> Matrix > > runSTMatrix :: ST s (MMatrix s) -> Matrix > > runSTMatrix a = runST ( do (MMatrix i j mblock) <- a > block <- unsafeFreeze mblock > return (Matrix i j block) > )))' > but i strongly recommend you to read > entire data.array.* sources to know about all intrinsics of arrays > library and in particular freeze/thaw tale I will do, and thanks for your excellent advice! Martin
|
http://www.haskell.org/pipermail/haskell-cafe/2006-March/014903.html
|
CC-MAIN-2014-42
|
refinedweb
| 588
| 69.11
|
You can see the part 1 of the article at LocalizationGlobalizPart1.aspx.
When we look around we see that architectures mainly discuss about loose coupling, scalability, performance, etc. Many architectures forget one of the important aspects in software which is making an application globalized. Depending on the project some applications would not really want to have multi-language based websites, but I am sure many will. So in this article we will go through a series of FAQ which will give you a quick start on making applications multi-language based.
Lately I have been writing and recording videos mostly on design patterns, UML, and many architectural stuff and you can visit for the design patterns and UML videos. You can read my previous articles on design patterns and UML in the below links:
In the previous section, you have seen how we can use resource files to store data according.
The above diagram will give you a complete picture of how to generate a satellite assembly. You can see from the above figure that we need two exes, resgen.exe and al.exe. Once you have made your resx file or text file, you should first convert in to a “.resource” file. This is done by using resgen.exe. Below is the command snippet for resgen.exe where LoginScreen.aspx.el.resx is the resx file and the output is the Greek. Resources file. If you do not provide the output file name it will generate “LoginScreen.resources”.
Resgen LoginScreen.aspx.el.resx Greek.Resources
You can also generate resx files from a text file using resgen.exe, below is the code snippet for that:
Resgen MyLanguage.txt MyLanguage.resx
The above command snippet will generate a MyLanguage.resx using the MyLanguag.txt file. You can make a DLL using resource files and not resx so you should make this conversion. Now once the resource file is generated it is time to make the compiled assembly. In /c you need to specify the culture of the resource file. With file.
A Resource Manager class helps us to read resource files and get the values using a key. First, you need to create an object of the resource manager. You need to specify the resource name and the assembly in the constructor.
privateResourceManagerobjResourceManager =
new ResourceManager("Globalization.resource",
System.Reflection.Assembly.GetExecutingAssembly());
Once the resource manager is populated with details, you can then use the GetString function to get the value by key. For instance in the below code snippet we are using the cmdAddNew key to get the value for the button cmdAddNew.
GetString
cmdAddNew
cmdAddNew.Text = objResourceManager.GetString("cmdAddNew");
When we deploy the assembly, the folder structure has to very organized. The below table shows how the folder structure should be organized. The main folder is the main application folder. All satellite assemblies should be deployed in the main application folder within their own respective folders. The respective folder is denoted by the culture code.
You can see from the above figure the Hindi satellite assembly is deployed in the hi folder, Greek satellite assembly is deployed in the el folder, and so on. If the program does not find resource files for a culture it uses the invariant culture satellite assembly. The above folder structure is a strict requirement when we deploy the satellite assembly. Any mismatch in the folder structure will lead to inappropriate results.
In the previous question, we had seen how the resource manager class could be used to read a string from the resource file. However, there has been considerable improvement in VS.NET 2005 for resource support. You no more need to load using the resource manager class. However, Microsoft has still kept it for backward compatibility. You can now get strongly typed classes in your VS.NET intelligence as shown in the figure below.
All belongs to the Resources namespace. Let us do a small sample and see how the strongly typed classes work in VS.NET 2005 and the simplicity which they bring while implementing globalization in projects. Below is the screenshot of the project. It is a simple login screen with a user ID and password text boxes. The user has options to select the language. Currently only two languages are provided: English and Greek. Depending on the languages selected, the user ID and password label values will be displayed.
Resources
Note: In the globalization project you can get the project sample in “LoginScreenUsingStrongType.aspx”.
Below is the code snippet which describes the various important sections of the code. The first thing is the resource files. We have generated two resource files, one for Greek with el and a general resource file which will be used when the regional code does not match.
There are three important steps in the code:
Thread.CurrentThread.CurrentCulture = new CultureInfo (structure);
Resource
Resources.Resource.Culture = Thread.CurrentThread.CurrentCulture;
lblUserId.Text = Resources.Resource.lblUserIdResource1.ToString ();
blPassword.Text = Resources.Resource.lblPasswordResource1.ToString ();
Note: You can get the same from the globalization folder in “LoginScreenUsingStrongType.aspx”. Try to add a new language and most of the fundamentals will be clear.
These two functions belong to the HttpContext object. Using it you can get the object reference of the resource object. For instance you can see from the below code snippet we have reference to the Global resource object and we are trying to get the value for the “lblUserIdresource1” key.
HttpContext
lblUserIdresource1
lblUserId.Text=HttpContext.GetGlobalResourceObject("Resource", "lblUserIdResource1").To String();
Note: In the same globalization folder there is “LoginScreenUsingGetGlobal.aspx” which demonstrates how “GetGlobalResource” works.
GetGlobalResource
One short note because “GetGlobalResourceObject” and “GetLocalResourceObject” operate from within the current HttpContext. It uses what the regional settings are set from the browser end.
GetGlobalResourceObject
GetLocalResourceObject
Yes you can sign a satellite assembly using the /key file switch which takes a “.snk” file as the input parameter.
al /res:MyLanguage.resources /c:de /keyfile:MyLang.snk out:MyLanguages.resources.dll
First, let us define collation. Collation sequences are a set of rules which determine how the data is sorted and compared. Sorting rules can be defined with options with case-sensitivity, accent marks, kana character types, and character width.
Case sensitivity
If A and a, B, and b, etc. are treated..
You can create a database with a language specific collation sequence. For instance in the below Create statement tblCustomer is created by a Latin language collation sequence.
Create
tblCustomer
Create database tblCustomer collate Latin1_General_BIN
You can also create tables with a particular collation sequence. Below is the Create Table syntax for the same.
Create Table clause.
Order By
ORDER BY
{
order_by_expression
[ COLLATE collation_name ]
[ ASC | DESC ]
} [ ,...n ] ]
Below are the best practices while developing international language support software:
System.Text
System.Globalization
CultureInfo.InvariantCulture
CultureInfo.CurrentCulture
System.Resources.ResourceManager
CurrentUICulture
CurrentCulture
First, let me explain this question. If you look at the code snippet of how to set the culture info:
Thread.CurrentThread.CurrentCulture = new CultureInfo(strCulture);
It uses the current thread to set it. What does that mean? Let us drill down a bit how IIS handles requests to understand this concept. When a user requests a resource from IIS like an ASPX page or any other resource, IIS services that request in its own thread. That means if 100 users have requested some resource from IIS it will serve every request in its own thread. In short, IIS will spawn 100 threads to service the 100 requests. It is very much practically possible that you can have different locales in different threads. Therefore when we set a culture we cannot set it for the whole application as it will affect all the requests. So when we set a culture we set it to a particular thread rather than to the whole application.
.NET Interview Question PDF
Project Management interview.
|
https://www.codeproject.com/Articles/29362/Architecture-FAQ-for-Localization-and-Globalizatio?fid=1526596&df=10000&mpp=50&noise=4&prof=True&sort=Position&view=Thread&spc=Relaxed&select=2849286
|
CC-MAIN-2017-22
|
refinedweb
| 1,301
| 58.48
|
Opened 4 years ago
Closed 4 years ago
#23776 closed defect (fixed)
arctan2 for RDF causes plotting errors
Description
Carlo Verschoor reports that this is broken in Sage 8.0
cones = [Cone([(0,1),(1,0)]),Cone([(-2,-1),(-1,-3)]),Cone([(0,1),(-2,-1)]),Cone([(-1,-3),(1,0)])] F = Fan(cones) F.plot()
due to
float(arctan2(RDF(-3),RDF(-1))) having an imaginary component
Change History (8)
comment:1 Changed 4 years ago by
comment:2 Changed 4 years ago by
- Component changed from graphics to symbolics
comment:3 Changed 4 years ago by
To me the whole passage trying to figure out if
P is real or not looks wrong and error prone (and
parent(P) given that
P is common parent is confusing). And presumably the question of whether to work over reals or not may arise in other situations, so there has to be a better way to do that will work for possible future fields as well. Why not do something like
is_real = RDF.has_coerce_map_from(P) and stop on it? Are there situations when this will not work or are there performance considerations?
comment:4 Changed 4 years ago by
While we are at it, this is also wrongish:
if P is ZZ: P = RR
for
from sage.libs.pynac.pynac import py_atan2_for_doctests as py_atan2 py_atan2(-1/2, 0)
gives
TypeError: unable to convert pi to a rational Not sure what is correct fix here - maybe if
P is real, we need to check that it is possible to convert something like
RDF or
RR into
P as well and if not - replace
P with "generic reals" whatever that is?
comment:5 Changed 4 years ago by
- Branch set to u/novoselt/23776
comment:6 Changed 4 years ago by
- Commit set to 3bdda389ef5356befe94c8f7586e9ffc650d9901
- Status changed from new to needs_review
Using the check that
P coerces into
RR seems to work.
New commits:
comment:7 Changed 4 years ago by
- Reviewers set to Ralf Stephan
- Status changed from needs_review to positive_review
Thanks. Looking good, patchbot testing passes.
comment:8 Changed 4 years ago by
- Branch changed from u/novoselt/23776 to 3bdda389ef5356befe94c8f7586e9ffc650d9901
- Resolution set to fixed
- Status changed from positive_review to closed
The problem is that we are chasing parents in
A naive fix would be
but maybe there is a better way to recognize real parents and catch them all?
|
https://trac.sagemath.org/ticket/23776
|
CC-MAIN-2021-49
|
refinedweb
| 399
| 60.89
|
once~
once~
i mean like having spaces between the words
2 things I can think of right now... first:
char your_array[limit];
cin.getline(your_array, limit-1, '\n');
in cin.getline, the first thing is the destination (an array in this case) second, is the limit, always leave an extra one for the null character, and third is the delimeter. '\n' means newline (enter).
and second could be done using
cin.unset(ios::skipws);
at the beginning. It unsets the 'default' skip white space option in iostream.
I'd be glad to help you with your game. PM me if you want!
for the cin.undet(ios::slipws);
i get this error message:
C:\Program Files\Microsoft Visual Studio\MyProjects\Renegadeillusion\Renegadeillusion.cpp(114) : error C2039: 'unset' : is not a member of 'basic_istream<char,struct std::char_traits<char> >'
I most likey did something wrong
none of those worked...
do i need to use char - or will it not work otherwise?
omg - if a created a new project and look at it IT WORKS - but if i try it with my game IT DOESN"T Help PLEASE
--------------------Configuration: Renegadeillusion - Win32 Debug--------------------
Compiling...
Renegadeillusion.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\Renegadeillusion\Renegadeillusion.cpp(54) : error C2562: 'main' : 'void' function returning a value
C:\Program Files\Microsoft Visual Studio\MyProjects\Renegadeillusion\Renegadeillusion.cpp(11) : see declaration of 'main'
C:\Program Files\Microsoft Visual Studio\MyProjects\Renegadeillusion\Renegadeillusion.cpp(99) : error C2562: 'main' : 'void' function returning a value
C:\Program Files\Microsoft Visual Studio\MyProjects\Renegadeillusion\Renegadeillusion.cpp(11) : see declaration of 'main'
Error executing cl.exe.
Renegadeillusion.exe - 2 error(s), 0 warning(s)
That is what i get
Oops! sorry about mine, sumetiemse i typ tou fast! (lol)
it should be "cin.unsetf(ios::skipws);"
Well if you need help because it doesn't work in your game attatch the source code and we'll tell you what you did wrong!
PS: (no offense) but if you didn't about about the stuff we just told you, you should a bit more C++ before you continue your game. You might learn things that make life so much easier such as Structs, Enums and Classes that might help you in the game!
About these: "'void' function returning a value" errors
if you declared a void function it CAN'T return a value. If it was a switch case that returns a value for the string typed in make your function is: int Function(i dunno what you need)
What's your definition of main? You should opt for one of the following:
void main()
{
// do stuff here
}
or:
int main()
{
// do stuff here
return 0;
}
The former is not standard C++ but a lot of compilers will accept it. You should prefer the latter though.
The latter is standard and in fact the return statement is optional, although some older compilers will complain if you omit it.
fine heres my code:
Code:#include <iostream> #include <string> using namespace std; int main() { // CopyRight 2003 Shadowillusions // Justin Shreve // // Site UnderContruction string name, lastname, landname, confirmINFO, geteverything, tooksolong; int age, HP, MP;") { cout <<endl; } else if (confirmINFO =="y") { cout <<endl; } else if (confirmINFO =="Yes") { cout <<endl; } else if Magic Gem in the center of the town... \n"; cout <<"Mom: Did you get everything you needed? "; cin >> geteverything; cout <<name <<": "<<geteverything; cout <<endl; if (geteverything =="yes") { cout <<"<Mom: Good Let's Go!"; } else if (geteverything =="Yes") { cout <<"Mom: Good Let's Get Going"; } else if (geteverything =="no") { cout <<"Mom: We Don't have enogh Time to go get it - we will have to leave it"; } else if (geteverything =="No") { cout <<"Mom: We Don't have enogh Time to go get it - we will have to leave it"; } else { cout <<"Mom: What? I didn't understand that.....But We have to get going"; } cout <<endl; cout <<name <<" And his Mom run as fast as they could to the gem... \n"; cout <<"Stephine: Thanks god your safe what took you so long? "; //); }
Plese help me with this
|
http://forums.devshed.com/programming/69199-word-string-last-post.html
|
CC-MAIN-2015-11
|
refinedweb
| 670
| 64.41
|
A VideoTrack that is played at a constant rate.
More...
#include <video_decoder.h>
List of all members.
A VideoTrack that is played at a constant rate.
If the frame count is unknown, you must override endOfTrack().
Definition at line 655 of file video_decoder.h.
[inline]
Definition at line 657 of file video_decoder.h.
[inline, virtual]
Definition at line 658 of file video_decoder.h.
[virtual]
Get the duration of the track (starting from this track's start time).
By default, this returns 0 for unknown.
Reimplemented from Video::VideoDecoder::Track.
Definition at line 591 of file video_decoder.cpp.
Get the frame that should be displaying at the given time.
This is helpful for someone implementing seek().
Definition at line 578 of file video_decoder.cpp.
[protected, pure virtual]
Get the rate at which this track is played.
Implemented in Video::AVIDecoder::AVIVideoTrack.
Get the time the given frame should be shown.
By default, this returns a negative (invalid) value. This function should only be used by VideoDecoder::seekToFrame().
Reimplemented from Video::VideoDecoder::VideoTrack.
Definition at line 563 of file video_decoder.cpp.
Get the start time of the next frame in milliseconds since the start of the video.
Implements Video::VideoDecoder::VideoTrack.
Definition at line 556 of file video_decoder.cpp.
|
https://doxygen.residualvm.org/d3/de4/classVideo_1_1VideoDecoder_1_1FixedRateVideoTrack.html
|
CC-MAIN-2019-47
|
refinedweb
| 207
| 71.61
|
An S corporation is a regular corporation with a special tax designation as a small business corporation. It issues shares of stock that represent the percentage ownership interest of each owner, just like a regular corporation. Those shares of stock are freely transferable, subject to any restrictions that might be in place through a shareholder's agreement.
Things You'll Need
- Stock purchase agreement
Call a meeting of shareholders. Have the secretary verify the ownership percentage of the retiring shareholder. If there is a shareholder's agreement in place that establishes a procedure for buying a shareholder out, follow the agreement. If no agreement exists, consult an accountant and set a value on the retiring partner's shares in the business.
Execute a stock purchase agreement between the shareholder and the corporation. This is basically a bill of sale that outlines the number of shares being sold, the date of the transfer and the consideration paid. Template forms are available for use through an Internet search or you can have an attorney draft an agreement.
Have the retiring shareholder sign over his shares of stock if stock certificates were issued. Then have the corporate secretary record the stock transfer in the corporate records book. Once the stock is transferred, either physically by signing the stock over or through the execution of the stock purchase agreement, and the payment for the stock has been received by the retiring shareholder, the shareholder is no longer an owner of the S corporation.
Redistribute the recaptured shares of stock among the remaining shareholders. An S corporation is a pass-through entity, meaning it does not pay taxes itself but passes all of its profits and losses to its shareholders to be reported on their individual tax returns. One hundred percent of an S corporation's profits and losses must be allocated to its shareholders every year so taxes can be paid. An S corporation is not allowed to have treasury stock (stock that is not owned by a person but is owned by the corporation itself).
Prepare the corporation's tax return (Form 1120S) at the end of the year. Close out the retired shareholder's interest for the part of the year her share was owned, record any capital gains and reflect the transfer of interest to the other shareholders on the appropriate schedules. See an accountant for the proper way to prepare the corporation's return to reflect the sale of stock.
Related Searches
References
- Photo Credit Comstock Images/Comstock/Getty Images
Resources
You May Also Like
- Can an S Corp Buy Common Stocks?
S corporations can exercise the same rights of stock ownership as any individual. They exist to provide legal protections to individuals or...
- Partnership vs. Corporation
A corporation is more complex to set up than a partnership. However it also offers greater protection for the owners' personal assets.
- How to Remove an Officer From Articles of Incorporation
When a corporation goes into business, they must file an Articles of Incorporation. According to the US Legal website, the Articles of...
- How to Record an S Corporation Stock Sale
An S corporation is a common way that small businesses incorporate themselves. Incorporation as an S corporation shields the private assets of...
- Steps to Buy Out a Partner in a 50/50 S Corp
S corporations typically represent a closely held business owned by a few individuals. This business type is similar to a partnership, but...
- How to Divide the Shares in an S Corp Partnership
An S corporation that has elected to be taxed as a partnership still maintains all of the legal functionality of a regular...
- Can an S Corp Have Treasury Stock?
An S corporation is a company structured under the sub-chapter S tax code of the Internal Revenue Service. This tax election allows...
- What Does Corporate Ownership Mean?
Starting a business is a chance to offer a new product or get involved with a growing industry. But the process of...
- Checklist for the Asset Sale of a Sub S Corp
When an S corporation sells assets and ceases operations, there are income tax considerations for the shareholders. Detailed records are required to...
- Buyout Options for LLC
LLCs, or limited liability companies, are a form of legal structure for small and mid-sized businesses. Each owner of an LLC is...
|
http://www.ehow.com/how_7378280_partner-off-corporation.html
|
CC-MAIN-2017-13
|
refinedweb
| 722
| 54.32
|
I have an XML which is not well formed as I am getting this error when I am trying to read XML:
import xml.etree.ElementTree as ET ET.parse(r'my.xml')
I get the below error
ParseError: not well-formed (invalid token): line 2034, column 317
So, I used
BeautifulSoup to read the xml by below code:
from bs4 import BeautifulSoup with open(r'my.xml') as fp: soup = BeautifulSoup(fp, 'xml')
If I print
soup it looks like this:
<Placemark> <name>India </name> <description>Country</description> <styleUrl>#icon-962-B29189</styleUrl> </Placemark> <Placemark> <name>USA</name> <styleUrl>#icon-962-B29189</styleUrl> </Placemark> <Placemark> <description>City</description> <styleUrl>#icon-962-B29189</styleUrl> </Placemark>
I have a total of more than 100
Placemark tags and the information in them. I want to capture
name and
description of each tag and make a
df with respective columns.
My code for same is:
name_tag=[x.text.strip() for x in soup.findAll('name')] description_tag =[x.text.strip() for x in soup.findAll('description')]
The problem is for some of the
Placemark tags I don't have
name or
description tag at all. And hence I am not able to know which name has what description. So, there is a mismatch between name and description because of absence of tags.
Expected Output Dataframe:
Name Description India Country USA City
Is their any way I can achieve the same?
Since you are searching for
nameand
descriptiontags separately, you are losing track of which name belongs to which description.
Instead, you should parse each
placemarktag on its own, and handle the case of missing
nameand
descriptiontags for each placemark tag.
|
https://techqa.club/v/q/get-column-names-from-not-well-formed-xml-c3RhY2tvdmVyZmxvd3w1NTkyMDA0NA==
|
CC-MAIN-2021-17
|
refinedweb
| 276
| 64
|
Ruby on Rails and Couchbase-Model for a Social Application!
Also using HAML, SASS, Bootstrap, And Twitter OmniAuth....
This blog assumes knowledge of Rails and some use of the Twitter Developer Portal. If you haven’t used Couchbase or the Couchbase-Model gem before, don’t worry, I will guide you through that part, but it is worth reading up on Couchbase-Model first!
The overall idea behind this app is that Users can post their own Vine videos, to be voted on by the public to see who has the Funniest Vine videos globally. Users must be authenticated before submitting a Vine, and we need to keep track of which Vine belongs to which user by means of referential ID’s. i.e. each Vine should have a User_ID within it’s JSON document, so we know who it belongs to.
So without further hesitation, let's dive in and see how we can build a gamified application atop-of Couchbase using Ruby and Rails. The whole idea of having a social application with a leaderboard and a competitive element is one that has been a very common use-case, but not necessarily one that has been well documented (especially for us in the Ruby community!) Now then, enough chit-chat, let’s go!
Prerequisites:
- Couchbase Server 2.0+
- Ruby 1.9.3+
- Rails 3+
Instead of posting every individual gem for our Rails app here, simply click here to view my Gemfile to see which Ruby Gems we need to bundle for our application.
1 note to make here is my choice of Ruby server. I am using Puma. This isn’t necessarily a benefit in this small use-case, more a personal habit. Puma is a threaded, concurrent webserver for Ruby that starts on port :9292 by default. You can use whichever web server you feel comfortable with, and simply start your app with ‘rails s’ or ‘rails server’.
Now, before we get started with our code, let’s go ahead and create a bucket in our Couchbase instance called ‘rvine’. It’s not necessary to worry about sizing this bucket, so depending on how much RAM you have allocated to your cluster, just give it 200mb or so.
So, let’s generate a new Rails app. We’re going to append our usual command with the ‘-O’ flag. This is to skip active_record includes. (We can’t use active_record with Couchbase, but that is why we have the Couchbase-Model gem!)
Rails new rvine –O
Now then, let’s make sure you’ve copied the Gemfile from the repo linked above. The importance of this is to make sure we’ve got both Couchbase and Couchbase-Model bundled. Couchbase-Model is an abstraction over the Couchbase gem allowing Active-Record like design patterns. It makes it super easy for us to get up and running with Rails & Couchbase. Make sure you click on the link above and read through the gem details to find out more.
When we know we have both gems in our Gemfile, run ‘bundle install.’ Once we’ve done that, we setup our rails app with Couchbase as a backend. From your rails directory in Terminal, run the command:
Rails generate couchbase:config
This will generate a couchbase.yml file in our config directory that links up our app with our database backend. Go ahead and edit that file, and enter our bucket credentials. Your config file should reflect this:
hostname: localhost
port: 8091
username:
pool: default
development:
<<: *common
bucket: rvine
test:
<<: *common
bucket: rvine
# set these environment variables on your production server
production:
hostname: <%= ENV['COUCHBASE_HOST'] %>
port: <%= ENV['COUCHBASE_PORT'] %>
username: <%= ENV['COUCHBASE_USERNAME'] %>
password: <%= ENV['COUCHBASE_PASSWORD'] %>
pool: <%= ENV['COUCHBASE_POOL'] %>
bucket: <%= ENV['COUCHBASE_BUCKET'] %>
Ok, so now that that’s done, we should have a Rails barebone project, that’s hooked up to Couchbase as it’s backend data store. Seem simple? That’s because Couchbase-Model makes our life 1000x easier when it comes to data modeling!
Now, the next thing we need to do is setup our User & Authentication classes.
Let’s create our User model first. Create the file /app/models/user.rb
attribute :name
attribute :twit_username
attribute :avatar
def self.find_or_create_from_auth_hash(hash)
user = User.find_by_id(hash[:uid])
unless user
user = User.create!(:id => hash[:uid],
:name => hash[:info][:name],
:twit_username => hash[:info][:nickname],
:avatar => hash[:info][:image])
end
user
end
end
The attributes in this document are the fields we wish to include in our JSON document. We are collecting the user’s Name, Twitter Username & Avatar. We need to give a unique key to each User in our database. In this instance, we are doing so by collecting the User’s twitter UID and creating a hash from that to generate a key for our User document. It’s important to remember that the key of every document in our database must be unique. Also, worth noting is the class we have created. ‘find_or_create_from_auth_hash’ This class is doing exactly what it says on the tin! If a user exists; auth them. If not, create them from the Twitter details we receive.
You will hopefully have noticed that we have chosen to use Twitter-Omniauth for this, to save us a hell of a lot of time instead writing an Auth class from scratch! The first thing to do here, is to head over to Twitter Dev and grab some application keys! If you have never done this before, click here and sign in with your Twitter account. Create a new application called ‘rvine’ and once you’ve done that, you will be presented with 2 application keys.
Create a config file in config/initializers/omniauth.rb. Once you have created this file, open it up and drop in the following code:
provider :twitter, "CONSUMER_KEY", "CONSUMER_SECRET"
end
This should now mean we have Omniauth setup with our Twitter application keys, and almost ready to go. The next thing we need to do is create a route in our Rails application to handle the Authentication process. So, let’s open up our config/routes.rb file, and enter the following:
Now, we’re telling Rails to send our Twitter Auth’d callback to our sessions controller…. What sessions controller? We need to create that now.
Go ahead and create file app/controllers/sessions_controller.rb
def create
user = User.find_or_create_from_auth_hash(auth_hash)
session[:user_id] = user.id
flash[:success] = "Welcome to the club!"
redirect_to dashboard_path
end
protected
def auth_hash
request.env['omniauth.auth']
end
end
As you can see from this code, our ‘Create’ method is calling the class we defined in our User.rb to initialize a session when a User clicks to authenticate from the frontend, or create the User if they don’t already exist. Once authenticated, we are redirecting the User to their Dashboard. (Which we will create soon!)
Next up, let’s update our application_controller.rb to include a helper classes for our Authentication – including a helper method to define a Current_User and a helper method to ensure a User is Signed in.
protect_from_forgery
def authenticate!
if signed_in?
return true
else
flash[:error] = "You aren't authorized to access this page"
redirect_to(root_path)
end
end
def current_user
@current_user ||= User.find_by_id(session[:user_id])
end
helper_method :current_user
def signed_in?
!!current_user
end
helper_method :signed_in?
end
Next up, we need to create the Dashboard for our Users to be redirected to upon authorisation. For this, let’s use a Rails Generate command.
Now, let’s open up the file app/controllers/dashboards_controller.rb and enter the following:
def show
end
end
Let’s open up our frontend view of the Dashboard, and edit that. In my case, it’s going to be a HAML file. Regardless of whether you choose ERB or HAML, the file is going to look pretty much the same! In app/views/dashboards - just create the file show.haml or show.erb.
.page-header
- if signed_in?
%h1
Hello, #{current_user.name}
%p
%img{:src => current_user.avatar, :alt => "Avatar"}
%p= link_to("All vines", "/vines")
- else
%h1
Hello, stranger
%p
= link_to("Sign in with your twitter account", "/auth/twitter")
%p
Now we’ve got our dashboard in place, we need to setup some more Routing, then we can go ahead and test things! Open up config/routes.rb and add the following:
Once you’ve done that, save, run your app, and Authenticate as a user, and you should see something like the following:
Great! We can now see that our Authentication works, and our Users have a Dashboard. If we open up our Couchbase console, we should also see that a User has been created inside our Rvine bucket!
Now we’ve got our Users and Authentication in place, let’s get onto the main part of the application: The Vine Videos! To get started here, we’re going to need to create a model for Vines. Now, unfortunately, Couchbase-Model does not yet support the rails Generator on this action. So we need to manually create /app/models/vine.rb
Once we’ve done that, let’s fill in the following:
require 'uri'
require 'nokogiri'
class Vine < Couchbase::Model
after_save :extract_video_url
belongs_to :user
attribute :title
attribute :vine_url
attribute :video_url
#Voting API
attribute :score, :default => 1
validates_presence_of :title, :vine_url
private
def extract_video_url
doc = Nokogiri(open(vine_url).read)
self.video_url = doc.css("source").first["src"]
save_without_callbacks
end
end
As we can see from the code above, we are including open-uri, uri, and nokogiri. This is because Vine does not have a public API, but we need to get those videos somehow! So, with the help of those libraries we’ve written a cheeky script to scrape the source of a Vine video and grab the exact mp4 URI when a User enters the Vine URL.
The class extract_video_url is called using the method after_save. From the code we can see Nokogiri is opening the URL entered by our User on posting a Vine. It then searches the Vine page’s source to find the line declaring the Vine’s actual mp4 URI.
Other than that, we can see that each Vine belongs to a User, has attributes for the Title, Vine URL (Entered by the user) and Video URL (Actual mp4 URI). We also have a Score attribute. (The most important attribute.) Also note that we are setting each video to start with a score of 1.
Now, let’s generate a controller & views for our Vine model. Run:
You may get a conflict error at this point saying the model already exists. Don’t worry, just say ‘N’ to not overwrite it. You may also see an error Couchbase not found. Again, don’t worry about this, as I stated above Couchbase-Model isn’t compatible with the Rails Model generator.
If all went to plan, you should now have a vines_controller.rb and a whole views folder for vines with the frontend HAML or ERB files. Go ahead and open up vines_controller.rb and make sure it reflects the file here.
In our controller file, you may have noticed a method called ‘upvote’. This is the voting mechanism for our Vine videos. The finish the implementation of this voting system, and to actually give the Vine videos a place to live, open up the file app/views/vines/show.haml(or .erb)
Make sure it relfects the file found here...
Before our voting system will work completely, we need to add the following to our routes.rb file:
member do
put :upvote
end
end
Ok, so now our Vine videos can be displayed, and the voting mechanism is in place! The next thing we need to do is setup the main page for the app – The Leaderboard! Our leaderboard, although being the main feature of the app, is incredibly simple. Open up the file app/views/vines/index.haml (or .erb) and ensure it matches the code here.
Now, if this were any ordinary relational Rails app, we should in theory have a leaderboard already created, listing each Vine video in our database. BUT this isn’t the case here.
In Couchbase, we need to create our leaderboard using Views in Couchbase and utilising the Map/Reduce technique before we get a leaderboard that actually works properly! So, let’s do that! Before we proceed here, if you haven’t used Couchbase Views prior to this, I recommend you read these docs, to give you a good bit of background knowledge on what Couchbase Views are, how we use them and to ease your way into using them in this Rails application
For our application, we need to create a View in Couchbase, that outputs each vine, with it’s Score and Title. They also need to be ordered, descending, by Score so the Vine video with the highest score is naturally at the top of the Leaderboard.
IF you have used Couchbase Views before, you may have created them from within the Admin console itself. Views can be created from within the Admin UI, from any of our SDK clients and by means of the REST API. In this case, Couchbase-Model has a unique, and rather brilliant way of allowing us to generate Views for our application. Have a quick read of these docs to see how it can be done, and how we’re about to do it.
In Terminal, simply run:
Now, in your app/models directory, you should have a new sub-directory named vine, with a subdirectory named all. This directory contains 2 .js files – our map.js and reduce.js. For now, all we’re interested in the map.js file. Go ahead and open it up, and enter the following:
if (doc.type == "vine" && doc.title) {
emit(doc.score, doc.title);
}
}
As we can see from this Map function; we are wrapping the entire thing in an IF statement. This is a best practice within Couchbase to check for attributes before trying to emit rows into our Index. In this case, our IF statement is ensuring only docs with the type == “vine” and ensuring the vine has a title. The emit function is then creating a row in our index using the document Score as the indexed key. We are also outputting the document Title as the output value.
The reason we are outputting the Score as the Indexed key, is that we can take advantage of the Unicode Sorting that Couchbase automatically applies to this field. In our case, we need to ensure our Score’s are descending, to push the highest scoring Vine to the top of the Leaderboard. This map function will work fine on it’s own, and if you ran the application now, you will have a list of Vine videos, but they would be in the wrong order!
It’s time to apply another feature of Couchbase to polish off our Leaderboard and ensure it works as it should. It’s time to Query our View to create our final product. Once again, Couchbase-Model allows us to do this straight from our Rails code. Open up your model file vine.rb and add the following line just above the ‘private’ declaration:
Not only is this code necessary to add query params to our View, but it must be added to our Vine.rb file with or without query parameters to ensure our application knows which View(s) it has to use in our application. In this case, we can see, not only are we defining which view our application is to use, but we have also added the query parameters:
By doing so, we are limiting the View’s output to 10 results and we are ensuring the Score is in descending order. Without much care to styling, we should have something that looks like this:
That’s it! If you populate your database with a few Vine videos, you should see you have a fully working Rate my Vine application. Throughout this article we have seen how we can model data with the Couchbase Rails gem Couchbase-Model, we have seen how we can use Views in Couchbase to create interactive applications, and we have seen how we can Query on those Views to get specific subsets of data for use in our application.
I realise that not everything inside the app is in this article (styling etc.) but that is unimportant. I hope I have covered the main points (Couchbase-Model, Document Modelling, Views and Queries) well enough so that you feel you could start your own Rails app using the Couchbase-Model gem.
If you are a London native, make sure you join our Couchbase London Meetup as over the coming weeks we will be hosting events detailing Document Modelling, Couchbase Mobile and many other topics.
If you have read this far, I can only congratulate you! I know this has been a LONG article! If you have any questions, as always, I am happy to answer them. Hit me up on Twitter at @Rbin and ping me any questions on there!
Robin Johnson
Developer Advocate, Europe.
|
http://blog.couchbase.com/jp/ruby-rails-and-couchbase-model-social-application
|
CC-MAIN-2014-15
|
refinedweb
| 2,846
| 72.66
|
Products and Services
Downloads
Store
Support
Education
Partners
About
Oracle Technology Network
During investigation of old bug 4939638 I found the next regression
caused by 20061023120554.jrose.dolphin-cleanups putback.
I attached the java file and the class file compiled by jikes.
hsdev-5% cp_prt6 20061020142756.sgoldman.6481940/ i486 2 product
hsdev-5% gamma -XX:LoopUnrollLimit=0 -XX:LoopOptsCount=0 Micro
Reflection: test(10) x 10000000
elapsed time: 924ms
elapsed time: 616ms
elapsed time: 582ms
elapsed time: 581ms
elapsed time: 584ms
Reflection: loop in sub-method: test(10) x 10000000
elapsed time: 630ms
elapsed time: 637ms
elapsed time: 584ms
elapsed time: 583ms
elapsed time: 583ms
Reflection: test(1..10000000)
elapsed time: 983ms
elapsed time: 956ms
elapsed time: 960ms
elapsed time: 957ms
elapsed time: 960ms
Reflection: loop in sub-method: test(1..10000000)
elapsed time: 975ms
elapsed time: 933ms
elapsed time: 950ms
elapsed time: 952ms
elapsed time: 977ms
result: 9999999
hsdev-5% cp_prt6 20061023120554.jrose.dolphin-cleanups/ i486 2 product
hsdev-5% gamma -XX:LoopUnrollLimit=0 -XX:LoopOptsCount=0 Micro
Reflection: test(10) x 10000000
elapsed time: 7461ms
elapsed time: 7363ms
elapsed time: 7350ms
elapsed time: 7359ms
elapsed time: 7351ms
Reflection: loop in sub-method: test(10) x 10000000
elapsed time: 7340ms
elapsed time: 7339ms
elapsed time: 7342ms
elapsed time: 7340ms
elapsed time: 7326ms
Reflection: test(1..10000000)
elapsed time: 7690ms
elapsed time: 7691ms
elapsed time: 7694ms
elapsed time: 7680ms
elapsed time: 7676ms
Reflection: loop in sub-method: test(1..10000000)
elapsed time: 7455ms
elapsed time: 7431ms
elapsed time: 7420ms
elapsed time: 7401ms
elapsed time: 7406ms
result: 9999999
EVALUATION
Compiled method is larger in newer JVM, because of increased size of
uncommon (cold) paths. The hot code is about the same size, but our
heuristic does not measure hot code size. It should; this is an old
problem. See comparative nmethod dumps below.
A reasonable solution would be to record, on the nmethod, an offset
which estimates the end of the hot code. (The compiler attempts to
lay all cold code out after all hot code.) This offset can be
estimated (for example) in Compile::Output, near the comment which
says "Insert epilogs before every return", by noting the offset of the
latest return (usually the only return).
Note that AMD64 does not manifest this bug because the invoke call is
*never* inlined, because InlineSmallCode is too small for a 64-bit
machine. This also should be fixed.
In this case, the extra cold code comes from a path taken just once.
The older compiler treats this path as never-taken, because the MDO
has no record of the path. But the newer compiler treats the path as
seldom-taken (which is more accurate), and therefore emits cold code
for it, calling ensureMemberAccess from Method.invoke (at bci 111).
This extra cold code bloats the compiled method and fools the inlining
heuristic.
--- Comparative nmethod dumps ---
Bad version of code:
Compiled 4 nmethod java.lang.reflect.Method::invoke (167 bytes)
total in heap [0xfa2ce588,0xfa2cf050] = 2760
relocation [0xfa2ce634,0xfa2ce698] = 100
main code [0xfa2ce6a0,0xfa2ceba0] = 1280 (** greater than InlineSmallCode)
main code, hot part = 531 (** up to RET opcode only)
exception code [0xfa2ceba0,0xfa2cebc0] = 32
stub code [0xfa2cebc0,0xfa2cebe8] = 40
scopes data [0xfa2cebe8,0xfa2cedfc] = 532
scopes pcs [0xfa2cedfc,0xfa2cefbc] = 448
dependencies [0xfa2cefbc,0xfa2cefc0] = 4
handler table [0xfa2cefc0,0xfa2cf020] = 96
nul chk table [0xfa2cf020,0xfa2cf044] = 36
oops [0xfa2cf044,0xfa2cf050] = 12
Good version of code:
Compiled 4 nmethod java.lang.reflect.Method::invoke (167 bytes)
total in heap [0xfa4cec88,0xfa4cf510] = 2184
relocation [0xfa4ced34,0xfa4ced8c] = 88
main code [0xfa4ceda0,0xfa4cf100] = 864 (** less than InlineSmallCode)
main code, hot part = 519 (** up to RET opcode only)
exception code [0xfa4cf100,0xfa4cf120] = 32
stub code [0xfa4cf120,0xfa4cf13e] = 30
constants [0xfa4cf13e,0xfa4cf140] = 2
scopes data [0xfa4cf140,0xfa4cf30c] = 460
scopes pcs [0xfa4cf30c,0xfa4cf49c] = 400
dependencies [0xfa4cf49c,0xfa4cf4a0] = 4
handler table [0xfa4cf4a0,0xfa4cf4e8] = 72
nul chk table [0xfa4cf4e8,0xfa4cf504] = 28
oops [0xfa4cf504,0xfa4cf510] = 12
|
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565458
|
CC-MAIN-2013-20
|
refinedweb
| 640
| 56.89
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.